Why does a bigger block size infer miner centralisation?

Question: I've read that one of the detriments to increasing bitcoins block size is that it will create a more centralised mining community. How is this so?
Answer: Because a key aspect to understand is that transferring a block over the network globally is not completely instant. The bigger the block is, the longer the block propagation statistically takes.
However if you are propagating the block to part of the network that is close, like transferring the block to yourself (which of course means that you won't need to transfer the block at all), the latency disappears. If you find a valid block, this means that you have a slight mining advantage to mine with the new block as the last valid block, while other parts of the network is still mining on the old block as the last valid block, during the time the new block you just mined is propagated to the rest of the network. The larger the new block you just mined, the longer time you have to mine on the new block while other parts of the network are still mining on the old block as the last valid block.
In an industry where even the slightest percentage wise of advantage leads to being able to outcompete your opponents, longer block propagation times should theoretically mean to higher concentration of big parties on the network.
Comment: «slightest percentage wise of advantage leads to being able to outcompete your opponents, longer block propagation times should theoretically mean to higher concentration of big parties on the network.»

So, how much a this is applicable to the current situation? Which is already much centralized. Is block size one of the current factors that prevents more centralization? To rephrase and complete, is it now (or is there a chance in the future) significant compared to other factors affecting the complex mining ecosystem and it centralization?
Comment: It's starting to look like an 8mb BCash block and backing from the world's largest mining pool/supplier will be quite lucrative for those involved.
Comment: On another note here is a graph of the current blockchain size in mb. It is already at 140gb. Imagine how sustainable it would be supporting a full node in the future if the block is 8mb now... https://blockchain.info/charts/blocks-size?timespan=all
Comment: @Josh No, Graphene will solve this problem: https://www.reddit.com/r/Bitcoin/comments/7b2pes/what_are_your_thoughts_on_graphene_discussed_at/


How to display an image on the NSWindow title bar that's half outside

Question: I have a custom NSWindow subclass - INAppStoreWindow (github) with a custom title bar view - and I'd like to do something like this image:

As you can see the ribbon is not totally outside the title bar. It's like in the middle.
How can i achieve this?
Answer: The easiest thing to do may be to use a separate window for the badge. Make it a child window of the main window and it will stay on top and move with it. It would be borderless and largely transparent, etc.
It may be hard to keep the badge child window positioned correctly if the main window is resized horizontally, though. Or, rather, you can move the badge child window easily enough, but it may lag the resize.
Answer: Your image must be drawn inside the area of a window.
Even if that means parts of your window are transparent.
You can do this with all the common border less window stuff. Just have two views your use for your title bar area. One for the titlebar itself where the view content is clear or you could say the opaque content is not reaching the top of the view.
In a sub view for your badge, draw whatever badge you like. Have your badge view extend to to top of your title bar view and overlap its transparent area.
You are likely to run into bad trade offs with how your window interacts and looks with the menu bar. As this is highly non standard and has UI problems that should be provided and addressed by Cocoa if anywhere, I recommend finding a different design. This will take alto of work to maintain and complete well. Custom, borderless windows are not hard to do, but they can be hard to do well. There are numerous subtleties of visual state change in sub views of NSWindow on OS X. Colors change based on key & main status of the window. It's free with standard windows and views. With custom stuff, you have to do a lot more.


Using Gracenote SDK (GNSDK) to read a file and perform a fingerprint recognition

Question: I'm trying to read a 16bit 16KHz wav (20 seconds long) from on iOS and perform a fingerprint identification. I tried following the guide "GNSDK-for-Mobile-iOS-Developers-Guide" but it doesn't have an objective-c example on page 53 (only C#).  My code reads in the whole file and then writes 2K blocks to the function fingerprintWrite (I've also tried passing a pointer to  the whole file). The variable "result' is never set to 1 - indicating insufficient data has been passed - but 20 seconds should be enough, right? Can anyone help? Thanks.
This is what I have done:
<code>    NSString *filepath = [[NSBundle mainBundle] pathForResource:@"Human.signed.20s.16bit" ofType:@"raw"];

    NSData *audioData= [NSData dataWithContentsOfFile:filepath];

    BOOL result;

    if (error)

        NSLog(@"Error reading file: %@", error.localizedDescription);

    // for debugging...

    NSLog(@"contents: %@", audioData);

    NSLog(@"Done:");

    unsigned char buffer[audioData.length];

    [audioData getBytes:buffer length:audioData.length];

    for (int i = 0; i < audioData.length; i++) {

        printf("0x%02x ",(unsigned char)buffer[i]);

    }

    [self.gnMusicIDFileInfo fingerprintBegin:16000 audioSampleSize:16 audioChannels:1 error:&error];

    if (error) {

        NSLog(@"Error = %@", [error localizedDescription]);

    }

    int count = 0;

    result = 0;

    while (result==0 && count<sizeof(buffer)-2048)

    {

        result = [self.gnMusicIDFileInfo fingerprintWrite:&buffer[count] audioDataSize:2048 error:&error];

        NSLog(@"Count = %i",count);

        count=count+2048;

    }

    NSLog(@"result = %i", result);

    if (error) {

        NSLog(@"Error = %@", [error localizedDescription]);

    }

    [self.gnMusicIDFileInfo fingerprintEnd:&error];

    if (error) {

        NSLog(@"Error = %@", [error localizedDescription]);

    }

    [self.gnMusicIDFileInfo fingerprint:&error];

    if (error) {

        NSLog(@"Error = %@", [error localizedDescription]);

    }
</code>
Comment: Can you share info about your use case? Are you trying to identify music file which came from a CD? Or identifying music from radio station/streaming?
Answer: 20 seconds may not be enough because the identification process requires enough amount of "usable" audio to proceed. Also, when doing a MusicID File identification, it is required to have the audio file from the beginning of a song. If your use case provides only part of a song and the song does not start from the beginning, it will most likely not work. You will need to use MusicID Stream instead.


How to Find Exact Row in Log File

Question: If you have a big log file, billions of lines long. The files have some columns, like IP addresses: xxx.xxx.xxx.xxx.
How can I find exact one line quickly, like if I want to find 184.108.40.206.
A naive line-by-line search seems too slow.
Comment: Binary search, assuming the entries are in some sort of order.  If they're not in any order then there's no choice but a full search.
Comment: without more detail, a linear search is as good as it gets
Answer: If you don't have any other information to go on (such as a date range, assuming the file is sorted), then line-by-line search is your best option.  Now, that doesn't mean you need to read in lines.  Also, it might be more efficient for you to search backwards because you know the entry is recent.
The general approach (for searching backwards) is this:
Declare a buffer.  You will read chunks of the file at a time into this buffer as fast as possible (preferably by using low-level operating system calls that can read directly without any buffering/caching).
So you seek to the end of your file minus the size of your buffer and read that many bytes.
Now you search forwards through your buffer for the first newline character.  Remember that offset for later, as it represents a partial line.  Starting at next line, you search forward to the end of the buffer looking for your string.  If it has to be in a certain column but other columns could contain that value, then you need to do some parsing.
Now you continue to search backwards through your file.  You seek to the last position you read from minus the chunk size plus the offset that you found when you searched for a newline character.  Now, you read again.  If you like you can move that partial line to the end of the buffer and read fewer bytes but it's not going to make a huge difference if your chunks are large enough.
And you continue until you reach the beginning of the file.  There is of course a special case when the number of bytes to read is less than the chunk size (namely, you don't ignore the first line).  I assume that you won't reach the beginning of the file because it seems clear that you don't want to search the entire thing.
So that's the approach when you have no idea where the value is.  If you do have some idea on ordering, then of course you probably want to do a binary search.  In that case you can use smaller chunk sizes (enough to at least catch a full line).
Answer: You really need to search for some regularity in the file and exploit that, Barring that, then   if you have more processors you could split the file into sections and search in parallel - assuming I/O would not then be a bottleneck.

How to Find Exact Row in Log File


P value got 2.6293E-109 is this statistically significant after doing t-test

Question: I was new in using t-test I got p-value 2.6293E-109 is this statistically significant how to represent in article results
Comment: By itself the numerical value is meaningless.
Comment: What is your question (hyphotesis)?
Comment: I recommend you do further research on the principles behind hypothesis testing, what are p-values and how the sampling distributions with which these tests are based on work. I recommend Khan Academy's series on AP Statistics which has good introductory statistical theory.
Answer: The p-value represents the probability of seeing a result as extreme as the result you got, assuming the null hypothesis is true (that there is no difference). Whether or not your p-value is significant is determined by your statistical significance threshold, which can be any value but is commonly set to 0.05. Since your p-value is far less than this (like by a lot) you can safely say your results are significant.
Comment: How to represent P vale sir
Comment: A bit pedantic: The p-value represents the probability of seeing a result as extreme as the result you got, assuming the null hypothesis is true *and assuming the statistical model is true*. (and actually no model is true, but some models are sufficiently accurate) This means that the p-value, a computation of a probability, does not incorporate uncertainty about the computation/model itselve. Normally it is assumed that these effects are negligible, but for such small number like p-values of the order of $10^{-109}$, details like the tails of the distribution are important.
Comment: So that is probably why many people, in sciences with uncertainty about the used statistical model, just stick to p<0.001 and consider any differentiation below it as not meaningful (it is sort of like saying that there is a one in thousand probability of a black swan or that there was some sampling error). In physics, it is often more easy to describe the system and model it accurately, and people tend to use smaller p-values. But even in physics the p-values must be considered with some skepticism (e.g. the observation of faster than light neutrino's in 2011 with 6.2 sigma significance).
Comment: What small p-values mean is that an anomaly has been observed. But such anomalies can have *two* reasons: either (or both) the null-hypothesis is wrong, or the statistical analysis is wrong (or three reasons, anomalies also happen by chance).
Answer: Whether the result is "significant" depends on your significance level, which, in turn, depends on the chance of obtaining the test statistics by pure chance, which, in turn, depends on many things, including the number of tests you perform.
Even if you do only a single test, I'd like to warn that it can still be some convoluted hidden effect you haven't thought about. For an example, see my question here.
How you report it, depends on the community. In some communities it is common to report almost exact, rounded to the next highest power of ten, e.g. $p < 10^{-108}$. In other communities, they prefer a more readable variant, $p < 0.001$ (which they tend to interpret as "highly significant").
But, the use of p-values has been criticised for years by statisticians for being unreliable, unsuitable for making decisions, and misleading. You shouldn't concentrate on the p-value, but on your hypothesis. The p-value is just a supporting evidence, among many other things, starting with the prior knowledge and experiment design.


Change the layout order of webform

Question: Normally, a webform places the body content first and then the form after. I want to reverse it. I want the form to appear first and the body content to appear afterward. Is this possible?
Comment: You can expose your form in a block and then position in your blocks settings and place it before the content in admin/structure/block
Comment: When I refer to "body content", I meant the body content of the form, e.g. Go to the webform, then the **Edit** tab. I want the content there to show up before the form.
Comment: In other words, I am not taking about the **Main page content** block but the actual body of the webform.
Answer: In Drupal the content of a page view is created by a template file and $variables. The variables are typically a simple PHP string or Drupal7 render arrays when the content is more complex than just a string, and the system composes all the render arrays into page output.
A render array for instance can be a Webform, or a Node of a Page (content type). When you place Node ID 1 which contains a Webform reference the system is really composing these 2 items into your 1 page.
A single key per render array may be a #weight value this integer value denotes where this content appears from top to bottom among the many render arrays composed by the system within a given Region of the page.
Yes, it is possible to flip or change the ordering of the Body field and the Webform presentation to the visitor. Typically you would do this in the theme layer of drupal by implementing a Drupal hook to change the weight value in a render array.
If you don't want to code alot there are numerous modules that can let you change the display of items on the page with little or not coding. One example is Display Suite (otherwise known as DS). It allows you to override or customize view_modes of content on your site.
For example I have on a website the default Drupal content type of Page, and I've configured Webform to allow webforms to be placed on Page Nodes. Using DS I could change all webforms to appear before the Body of the Page Node in a simple administrative UI:

I leave it to you to do additional research to find the tool(s) you are comfortable with to complete your task. I've outlined at least 2 here (DS and core APIs).
EDIT
To be clear, if you're using Webform as a content type directly (and not attaching it other content types) DS may not show you "Body" and "webform" fields on the Webform content type -- but the webform Node is still just a render array and its fields still have #weight values. I find it more useful to attach webforms onto content, then to use Webforms by themselves.
Comment: This is great. Exactly what I needed. Thanks so much!

Change the layout order of webform


What does gravity compensation do in flight control?

Question: In flight control designs for lateral directional movement, there is a block named "gravity compensation". This block changes yaw rate measurement from "$r$" to "$r-g/Vcos(\theta)sin(\phi)$" before it is sent to the controller. How does this block change the equation of motion?
Comment: can you provide an image example? have you studied the equation of motion?
Comment: I provided an image example
Answer: That term is a feedforward.
It simply makes sure that during a turn the rudder will anticipate the need for that $r$ component and thus helps making the turn coordinated.
Since the term is complete (i.e. there is also the $\theta$ component) this will work also for climbing/descending turns.
Comment: It looks like a feedforward. But note that it is fed to the feedback controller. If it was feedforward, it should be added to the output of the feedback. Can you provide a reference?
Comment: @shooshool no, it is a feedforward. the fact that is added to $r$ instead of the rudder command does not change its nature. source: I've implemented it several times on our research aircraft.
Comment: Should this feedforward be considered when the controller block is being designed? Or the controller is designed without considering the effect of feedforward and then the feedforward is added?
Comment: @shooshool if it is there, usually the controller is designed assuming that the feedforward is working as intended, i.e. lowering the load on the controller, but that's a different matter not for this stack


Tunelling And How to Tunnel

Question: I'm connected to a network that sends and receives a bunch of data packets, but these packets are visible to others (can be sniffed) so I want to tunnel them. I don't know how! I know about socket programming, proxies, vpns, all of the protocols like PPTP, SSH, SSL, TLS, etc. I'm looking for the actual CODE that takes the packages before they're sent,*sends them by tunneling (encapsulating the data)*
How can I do this?
Any information regarding this subject or how to tunnel is appreciated!
Comment: You want code but are providing no system requirements. Linux or windows, any specific language?
Answer: Use ssh and socks proxy:
<code>ssh -D 5000 remotehost.com
</code>
Then, while your SSH session is alive, you can configure your local apps (such as your web browser) to use this connection as an encrypted tunnel.  Just configure them use use localhost:5000 as the socks proxy server, and you're good to go.  Note that the packets will only be encrypted between your client and the remote ssh server - once they leave the server, they will be in whatever form they usually are.
If you are on windows, you can do with with putty.

Tunelling And How to Tunnel


Automatically create HTML pages on adding an item in SP 2013 list

Question: So I am very new to coding. Please bear with me. We have a SharePoint list wherein we store employee details. The task is to automatically create a new page with predefined UI -every time a new employee is added to the list. So every employee on the list has their own page with their data. How do I go about this?
Also, only that particular employee should be able to edit that page, but all other employees should be able to view each other's pages.
Answer: Don't think in creating pages;
Think in one (webpart)page that has dynamic content (metadata in your employee list)
Instead of solving it with code if you have a hammer everything starts to look like a nail
First learn what SharePoint is and does..
otherwise your approach is going to be like cooking curry in a pizza parlor
Comment: I am trying to learn but his is kind of an urgent requirement...thats why i have posted it here
Comment: It is like learning how to drive a race-car, it is easy to put the paddle to the metal... but you will die in the first corner. Same with SharePoint; now you won't die ... but you will lose data, or use the wrong data in business processes if you don't master it
Answer: SharePoint often does need a pretty gigantic hammer to do what you want.
It is of course advisable to only create one page with filtered content for the respective user. But that obviously will restrict you in a lot of ways and isn't what you asked for.
Sadly there is no OOTB way to do it. I would recommend these workflow actions, if you are in an environment, where you can use them (easy Installation[Site Settings->Solutions->Upload):
Custom Workflow Actions


Highly accurate constant current source

Question: I want a continuous and highly stable light from an LED for around a couple of hours, for which I need a highly constant and highly stable current source. I prefer an opamp-based circuit for the same. What should I use?
Comment: How stable is stable enough? LED's typically don't need anything super "precise" to work. Also, how much current are you expecting to drive, and at what voltage? Why do you want to use an op-amp? These usually have poor current drive outputs (good enough for a small signal LED, but a resistor works fairly well, and dedicated LED drivers even better).
Comment: To focus in on hello's key point: How stable is stable enough? If you really want highly stable light output you might be better off using optical feedback instead of worrying about the stability of the current source.
Comment: @user38630 An LM317 will provide an accurate and stable current source. What do you mean by "sensitivity"?
Comment: What's wrong with a LM317?
Comment: I suggest just do some more search. Check the resources at Analog Devices web site and look for a PDF copy of the National Semiconductor Analog Applications book - part of their big data book series.
Comment: I am expecting 60mA for 5V
Comment: LM317 does not have as much sensitivity as we need...so that is ruled out.
Comment: @ThePhoton i need maximum stability cuz i want the same light source to be continuous and stable for few hourse without any changes
Answer: I can speak from some small experiences on a part of this. I'll leave the "highly constant and highly stable" current source design to those who know this better than I. But I was involved in creating LED-based light sources intended as "lamp references" for optical work. Your description suggests the same to me.
(1) Even if you have a perfect current source, LED output varies with temperature. So they must be operated at a stable temperature. We chose to heat them to about \$75^\circ\text{C}\$ using a closed loop control. That solved the temperature drift problem.
(2) LEDs themselves aren't consistent. Even those cut from the same wafer aren't consistent. We had to pre-stress thousands of them, holding them at a stable temperature while running them with a current source for days. We monitored the optical output and data logged the results. A few, a SMALL FEW, would actually gradually drift and then settle down to a stable spot (peak wavelength and intensity.) We chose those for the standards. We threw away most of them, by far. At the time, we kept less than 1% of those tested because more than 99% of them simply weren't stable even over periods of hours.
I'm just saying. I believe you are focused on the wrong issue. Buy yourself a really nice 100ppm "stability" current source from a supplier that provides the range and resolution and accuracy you want and guarantees all of it (it won't be cheap.) And then use that with your LEDs and play around with temperature and various LEDs just to sample the modern situation with LEDs before going off and worrying about the current source end of it. You need to know what parameters need to be placed under your control in order to meet your requirements. Dog first, tail later. Just one opinion.
Comment: I forgot to add that earlier on we tested the LEDs for much longer than a few days. Those that stabilized in less than two days, were then stable over much longer periods. Those that didn't stabilize within two days, never were reliable even after "baking for weeks." So we determined that we could tell what we needed to know within two days and used that as a selection cutoff.
Comment: temperature maintainance will be taken care of in the dark room...I just want a 0.5% accurate current stability for the light.
Comment: I also used REF200 but it gives an accuracy of 1.5% and  i need lesser than that.
Comment: Temperature stability was only one problem I discussed. How do you handle the second problem?
Answer: As has already been mentioned, if you feed a perfect and stable current into a LED, the LED will vary its output light level with temperature and quite likely aging as well. Why don't you build a light sensor to monitor the output light level and use this in a feedback loop to control the LED current. A lot of low power lasers do this: -

I'm not saying light sensors are perfect but some are stabler than LEDs (and intended to be so) - the difficulty is how you couple the LED to the sensor and prevent reflections and ambient light affecting things. As I don't know your proposed idea other than what you wrote it's impossible to say if this is feasible.
Comment: This is the way to go. You want constant light, you need to feedback from the light. This will handle any changes in the light source over time.
Answer: Stability is pretty easy to achieve at the 0.5% level, even the lowly LM317 should be good enough.
If you want a current source with, say, 0.25% accuracy and better stability, consider something like an LM4140 as a 1.024V reference.

simulate this circuit – Schematic created using CircuitLab
The compliance of the current source is about 3.8V, depending on the MOSFET chosen,
so it should accommodate most types of LED. If you need more compliance, increase the
supply voltage from 5V or divide down the reference and reduce the sense resistor (but that places more demand on the op-amp Vos and TCVos characteristics.
With care, and trimming, this should have stability in the 5-10ppm/K range, and initial
error can be trimmed out completely (to the extent you can measure the current accurately).
Comment: The input RC is there to filter the LM4140 (see the linked datasheet). The R is required so it won't oscillate (it doesn't like very high quality capacitors on the output). The 1K is not critical, it was selected with the 10nF to make the amplifier stable.
Comment: Can you please explain the effect of the input RC? Also regarding the 1k resistor in the feedback, was that value selected for a specific reason ?
Comment: Why 1% on R2 and R4?
Comment: @markrages according  to my cost/benefit analysis it doesn't make sense to buy loose tolerance for moderate values in qty less than thousands
Answer: I know it has been a while, but what you want seems to be similar to a laser current source.
There is a physics paper that describes just that:  a very low noise (~45nA rms), stable (µA/°C) current source for up to 200mA.
Answer: If you wanted for example 20 % stability on Luminous Intensity, you would have an impossible goal , even with a   perfect current source due to bin tolerances, reflector tolerances, junction temperature rise differences due to ESR variance and fixture orientation variances.  Typical specs are 200% max of min Iv.
But if you know where or how you want the intensity metered, an ambient focused or diffused photo diode detector to control the current, would make it trivial to achieve 1% tolerance for Iv.  The eye can detect 1% step but a casual comparison with 10%difference  would be hard to tell between two LED's.  The eye has over a 10 decade range long term (day/night) and <3 decade range short term.
Answer: It depends on what is meant by "highly stable".  How much output variation can be tolerated?  As noted by others, the thermal characteristics of the LED will have a significant impact on the light output level, regardless of how stable the supply current is.
Providing a specific stable current can, in this case, be considered an open-loop control configuration.  A very simple (two component) constant current source that generally works well with some trimming, is a JFET current regulator.  A good write up may be found here:
JFET Current Regulator
If thermal effects cause too much variation for your application, a closed-loop control configuration, one which monitors the actual amount of light output from the LED and adjusts the current to compensate, will be necessary.

Highly accurate constant current source


Why was Anton Chigurh being arrested at the beginning of the film?

Question: In No Country for Old Men, why was Anton Chigurh being arrested at the beginning of the film?
Answer: The film doesn't give us an answer, but the book does. Chigurh (as explained to Carson Wells in the novel) allowed himself to be arrested (he was pulled over after he left the scene) for killing a man in a parking lot after the man said something Chigurh didn't like. He (Chigurh) wanted to see if he could "will" his way out of the situation. Although the book and the movie screenplay differ in many ways, both are excellent. Unless there is a directors cut of the film, the reason for Chigurhs arrest is only available in the novel.
Comment: The OP references the film, not the novel. I have not read the novel, but have seen the film countless times. I don't recall any reason for the arrest in the film. Is there anything in the film about the arrest?
Comment: @EvikJames The book does differ from the movie. It is explained in the one, but not in the other. It may be one of those "left on the cutting room floor" edits. So the answer to your question is no.
Answer: I don't know that I necessarily disagree with the other answer posted but I've read the book and seen the film and I don't think that an "explanation" can be copied so easily from one to the other.  I found the difference in the way they treat the character of Chigurh is so great that the two stories are practically independent.
In the film, Chigurh is presented less as a character and more as a force of nature.  He isn't a violent person, he is violence.  He's not trying to prove anything to anyone, least of all himself, he just is.  That otherworldly or mythical characterization is largely at odds with the book, in which Chigurh is represented as a thinking and morally capable character, albeit a psychopath.
It's pretty clear that the Coen Bros cut out the more human parts of Chigurh's character to emphasize/create a more elementally nightmarish creature.  As such, I think that not only was the reason for the initial arrest not shown but it couldn't have been shown because having a reason--even a psychopathic reason like the one in the book--would undermine the terrifyingly arbitrary nature of Chigurh's character.
That's how I understand it.  Perhaps if I reread the book and rewatched the film I would embrace the conventional wisdom.  And perhaps not.
Comment: When I saw the movie (and unfortunately I saw it only once) I was under the impression that the story is a metaphor of human life, and Chigurh is death itself.
Comment: @AndreaMori, I don't know that I would phrase it quite like that but that sense of preterhuman universality that Chigurh's character carries in the film is really quite different than the book, where he talks at much greater length and is shown to be fundamentally human, albeit an abnormal and evil human.
Comment: Excellent point about representing violence. I always compared Chigurh with the Judge from Blood Meridian.  Very similar characters in my mind.
Answer: It ties into Chigurh's ultimate flaw as the "ultimate badass", he is arrogant. He only puts himself directly into situations, in which he firmly believes he has control over.
Note that in every scene, he quite literally dominates the pace, tone and direction of the conversation. This is also true in his actions, whom does he terrorize? A young naive sheriff (whose back is turned), an old gas station attendant, two simpletons, and his competitor. But only twice is Chigurh shown to be surprised by the outcome: his near death experiences. This occurs twice in the film, first with the hotel shootout and second with his car crash. It's interesting to observe that we also are granted a glimpse at his process. After his near death experiences, we can see Chigurh attend to himself medically. I believe that this is him reflecting on his mistakes; however, it is his final experience that ultimately breaks him (literally) as character. He soon learns that he could never prepare himself against the random chaos of fate, and that literally, anything could happen.
It's also interesting, when he bandages himself up, it is usually through rudimentary and often primitive methods.
Answer: The keys to understanding the characters in any of the Cormac McCarthy novels is to look to a literary movement called "naturalism".  McCarthy, Elmore Leonard and Jack London relied heavily on the science of evolution and for the most part, rejected spiritual understandings of behavior.  They did not believe in free will but believed in predeterminism.  You couldn't overcome your genetics and your environment in combination.  Some of the comments by Sheriff Bell complaining of how things are changing for the worst show the power of nature introducing more perfect predators such as Anton Chigurh. The recent series "Klondike", had a deep vein of naturalism and forces of nature that mold men and women to behave consistently with their genetic loading.  I have read all of the novel's of Cormac McCarthy, Elmore Leonard (please watch justified) and many of the other proponents of this movement. "Blood Meridian" which featured the "judge" and " all the pretty horses" give further insight into the characters and their interaction with the natural environment.  I can also promise you, less than a fulfilling ending to the stories.
Comment: This is incredibly insightful and the most interesting thing on here (!!) but, Napoleon and Meat are right, it needs to be at least modified to answer the question..
Comment: Agreed - any chance you could do this Ed, otherwise I could convert it to a comment, but that would be disappointing for an otherwise great post.
Comment: Welcome to [Movies & TV](http://movies.stackexchange.com/help). While providing interesting insights, your post doesn't seem to answer the actual question (or you might want to clarify further in which way it does) and seems more fit as a comment. Your views and explanations are apreciated, but you might know that this site is not a discussion forum but a Q&A site.
Comment: This would be better as comment since it is not an answer. I'd suggest looking at the Tour under the help menu above. Hint: since reading the Tour gives you a badge, and you have no badges, it's obvious when someone has not read it. ;)
Answer: Remember Sheriff Bell visited the old guy in the end? Elvis or something? He was in a wheelchair.  Bell asked if the man who shot him died in prison. I believe this part explains why Chigurh was in cuffs. Maybe he shot him. He then mentioned something about being released. So, my guess is as good as anyone's.


What percentage of the time does White win in the Lomonosov tablebase?

Question: Studies show a slight advantage for White for having the first move.  In the tablebase of trillions of 7-piece endgames, with White to move, how many of those endgames end up as wins, how many as losses, and how many as draws for White?  And what are the numbers for 6, 5, 4, etc piece endgames?
Comment: It's 50-50, because if White wins a position, White loses the position with colors reversed, and both are in the database. The rest is drawn.
Comment: The question could be made more interesting by rephrasing it to read: What percentage are wins as compared to draws?
Comment: As @77and33is100 notes, the winning percentage for black and white is the same because of symmetry. Without having checked I would strongly suspect that only one version is stored in the data.
Comment: The question was not intended to compare black and white, as user1583209 detected.  For each tablebase entry, with white to move, are the totals 50% win, 49% loss, 1% draw, or what?
Comment: I've edited the original question to try and phrase it better.
Answer: As I do not have access to the full Lomosonov tablebases, here is an answer based on the Syzygy tablebases, which are available online in machine-readable format. I interpret your question as "how often does the side to move win, lose or draw". As the Syzygy tablebases only include positions where White has material advantage, we have to add the statistics with White to move to the statistics with Black to move.
You are going to be disappointed
It seems that there are actually more positions in which the side to move loses. The reason seems to lie in the positions with large material imbalance. For example, consider KQQQQQvK. If you check that link, you will see that:

with White to move, there are 37 099 315 080 winning positions for White (see "histogram":"white":"wdl":"2", the format is explained here)
with Black to move, there are 334 280 290 500 winning positions for White (losing positions for Black), which is about 9 times more! (see "histogram":"black":"wdl":"-2")

The reason for this is that, in KQQQQQvK, most of the positions are checks or checkmates. These positions are legal with Black to move, but illegal with White to move. This strongly biases the statistics to the point that the non-moving side (White) actually has more winning positions than the moving side.
I wrote a Python program to count the wins, draws and loses of the side to move for 3 to 7 pieces. Here are the results. In the spirit of open source/reproducible research, the source code is also included below. As these results are somewhat surprising, I will be happy to be informed of possible mistakes I may have made.
3- to 7-man Syzygy tablebases
Total positions: 945907910147154
Side to move loses: 439240886147124 (46.4359%)
Side to move loss saved by 50-move rule: 1405811609374 (0.1486%)
Draws: 124655757593757 (13.1784%)
Side to move win saved by 50-move rule: 1511382741156 (0.1598%)
Side to move wins: 379094072055743 (40.0773%)

3-man Syzygy tablebases
Total positions: 367868
Side to move loses: 99222 (26.9722%)
Side to move loss saved by 50-move rule: 0 (0.0000%)
Draws: 166126 (45.1591%)
Side to move win saved by 50-move rule: 0 (0.0000%)
Side to move wins: 102520 (27.8687%)

4-man Syzygy tablebases
Total positions: 143702885
Side to move loses: 48712335 (33.8980%)
Side to move loss saved by 50-move rule: 0 (0.0000%)
Draws: 45850555 (31.9065%)
Side to move win saved by 50-move rule: 0 (0.0000%)
Side to move wins: 49139995 (34.1956%)

5-man Syzygy tablebases
Total positions: 32612482961
Side to move loses: 12895319023 (39.5411%)
Side to move loss saved by 50-move rule: 38951980 (0.1194%)
Draws: 7248043033 (22.2248%)
Side to move win saved by 50-move rule: 33205648 (0.1018%)
Side to move wins: 12396963277 (38.0129%)

6-man Syzygy tablebases
Total positions: 6170694290902
Side to move loses: 2634258815181 (42.6898%)
Side to move loss saved by 50-move rule: 8110268813 (0.1314%)
Draws: 1075100392347 (17.4227%)
Side to move win saved by 50-move rule: 7817500373 (0.1267%)
Side to move wins: 2445407314188 (39.6294%)

7-man Syzygy tablebases
Total positions: 939704459302538
Side to move loses: 436593683201363 (46.4607%)
Side to move loss saved by 50-move rule: 1397662388581 (0.1487%)
Draws: 123573363141696 (13.1502%)
Side to move win saved by 50-move rule: 1503532035135 (0.1600%)
Side to move wins: 376636218535763 (40.0803%)

Source code
import json
import numpy as np

fd=open('stats.json')

wdl_keys=('-2', '-1', '0', '1', '2')
wdl=np.zeros((5, 5), dtype=np.uint)

data=json.load(fd)

for key, value in data.items():
    n_pieces=len(key)-1
    for i_wdl in range(5):
        # add WDL data for White to move
        wdl[n_pieces-3, i_wdl]+=value['histogram']['white']['wdl'][wdl_keys[i_wdl]]
        # add WDL data for Black to move
        wdl[n_pieces - 3, i_wdl] += value['histogram']['black']['wdl'][wdl_keys[i_wdl]]

total_positions=np.sum(wdl)
total_wdl=np.sum(wdl, axis=0)
print('3- to 7-man Syzygy tablebases')
print('Total positions: {:d}'.format(total_positions))
print('Side to move loses: {:d} ({:.4f}%)'.format(total_wdl[0], 100.0*float(total_wdl[0])/float(total_positions)))
print('Side to move loss saved by 50-move rule: {:d} ({:.4f}%)'.format(total_wdl[1], 100.0*float(total_wdl[1])/float(total_positions)))
print('Draws: {:d} ({:.4f}%)'.format(total_wdl[2], 100.0*float(total_wdl[2])/float(total_positions)))
print('Side to move win saved by 50-move rule: {:d} ({:.4f}%)'.format(total_wdl[3], 100.0*float(total_wdl[3])/float(total_positions)))
print('Side to move wins: {:d} ({:.4f}%)'.format(total_wdl[4], 100.0*float(total_wdl[4])/float(total_positions)))

positions=np.sum(wdl, axis=1)
for i_pieces in range(5):
    print()
    print('{:d}-man Syzygy tablebases'.format(i_pieces+3))
    print('Total positions: {:d}'.format(positions[i_pieces]))
    print('Side to move loses: {:d} ({:.4f}%)'.format(wdl[i_pieces, 0], 100.0 * float(wdl[i_pieces, 0]) / float(positions[i_pieces])))
    print('Side to move loss saved by 50-move rule: {:d} ({:.4f}%)'.format(wdl[i_pieces, 1], 100.0 * float(wdl[i_pieces, 1]) / float(positions[i_pieces])))
    print('Draws: {:d} ({:.4f}%)'.format(wdl[i_pieces, 2], 100.0 * float(wdl[i_pieces, 2]) / float(positions[i_pieces])))
    print('Side to move win saved by 50-move rule: {:d} ({:.4f}%)'.format(wdl[i_pieces, 3], 100.0 * float(wdl[i_pieces, 3]) / float(positions[i_pieces])))
    print('Side to move wins: {:d} ({:.4f}%)'.format(wdl[i_pieces, 4], 100.0 * float(wdl[i_pieces, 4]) / float(positions[i_pieces])))

Comment: @Annatar yes, not considering the prior (probability of those positions occurring) is definitely a large source of bias. It might be interesting to find the percentages for balanced positions (same material on both sides), though I suspect those will give an overwhelming advantage to the side to move
Comment: Only 13-14% of all 3-7 piece endgames being technical draws is a very interesting data point at first glance,
Comment: however, a similar bias applies: these 13-14% are **much** more likely to occur from a real game than all the KQQQQQvKs that only happen in amateur games with one side refusing to give up and the other trolling.
Comment: You could filter positions with *both* sides to move. Given the code, I might try it myself, but I am too lazy.


How to find the right token to use in a rule for sending an email to the node author?

Question: I am having the toughest time figuring out how to send an email to the node author. I created my rule and everything works if I hard code the email but I can't seem to get the right token to use and it seems the tokens available only allow:[node:author] nothing for the node authors email?
Answer: Sometimes, the Rules module user interface doesn't show all the allowed tokens.
Manually enter [node:author:mail]. If it's not an allowed token, an error message would be shown.
Comment: Great! I do confirm this tag works.
Answer: The Rules module is great, but it also has its hidden features ... Yes the "token for the eMail Id of the node author" is available to use it in the Rules Action. However you won't find it by simply expanding the typical "REPLACEMENT PATTERNS"-link that show up by default.
Moreover, there is no need for guessing or trial-and-error (similar to the "So try just manually inputting [node:author:mail]` and see if it validates in Rules" in the accepted answer). Instead, whenever you're looking for some token that at first doesn't seem to be available, you should try to use the Switch to data selection button as in this screenprint:

Then select "node...(Created content)" from the Data selector selection list (or if you know part of what you're looking for just start typing "node:"). Here is another screenprint that should look pretty similar:

After completing such selection, the list of possible values (= tokens starting with "node:") will change and start to show (dozens of) other values such as:

node:nid (Node ID)
node:type (Content Type)
node:author... (Node Author)
node:comment (Comments allowed)
node:comments... (Comments)

In the above list, note the ones that have a "...": those are the ones that, after you select any of them, will bring up yet another list of tokens that start with what you selected. So if you select "node:author... (Node Author)", it'll show (many) other values (some with yet another "..."), such as:

node:author:uid (User ID)
node:author:name (Name)
node:author:mail (Email)
node:author:roles... (User roles)

So there you are: using the drill-down approach as shown above, node:author:mail (Email) is what you're looking for. All that's needed now, is to select it from this list. Though in this case there is no more Label and Description for the token, you only have what's shown between "(" and ")" to decide about which token to select.
PS: If you don't find what you're looking for (after using the Switch to data selection button), you can always return to the previous display by using the Switch to the direct input mode button.
Answer: Also, the user is logged in when creating the node so:
<?
global $user;
echo $user->mail;
?>

Should work too.


Convexity and strong lower semicontinuity imply weak lower semicontinuity

Question: I have seen that if a set $K$ on an Hilbert space $H$ is convex and strongly sequentially-closed, it is weakly closed. The teacher said that if you take a convex and weakly lower semicontinuous functional $F$, using the fact that the sets $F^{-1}(-\infty, \lambda]$ are convex and that closure implies weak closure, it is easy to conclude that convexity and strong lower semicontinuity imply weak lower semicontinuity. I do not see how to do that though. I would like to see a proof not involving weak topologies etc. The way he said it menat it was supposed to be done using only the definitions, or little more.
Comment: when you say that a functional $F$ is closed or weakly closed, what is your definition for that?
Comment: With successions. Strongly closed means that if a succession $x_n$ of elements of this set converges to some $x$, then $x$ is also an element of the set. Weakly closed is the same, but with weak convergence
Comment: "Succession" = sequence. It is called sequential closure.
Comment: https://math.stackexchange.com/questions/2355100/how-convexity-is-related-with-weak-lower-semi-continuity
Comment: Yeah, but I don't get why weakly sequentially closed implies weakly lower semicontinuous. Every answer that I have found doesn't explain this.
Comment: Lower semicontinuous is equivalent to the epigraph being closed as a set. You say that you know the implication for sets. I do not see the problem that worries you. Sequential strongly closed $\Rightarrow$ (metric space) strongly closed $\Rightarrow$ (convex) weakly closed.
Comment: I would like to see a proof of this equivalence, indeed. If I get it right, closed is equivalent to lower semicontinuous, and weakly closed is equivalent to weakly lower semicontinuity?
Answer: Let us start with two facts and a remark.
Fact 1. Let $(X,\mathcal{T})$ be a topological space and let $f \colon (X,\mathcal{T}) \to
\left[{-}\infty,{+}\infty\right]$. Then $f$ is lower semicontinuous if and only if, for every $\xi \in \mathbb{R}$, the lower level set $f^{-1}(\left[{-}\infty,\xi\right])$ is closed. Here, by lower semicontinuity, I mean: for every $x \in X$ and for every $\xi \in \left]-\infty,f(x)\right[$, there exists a neighborhood $V$ of $x$ in such that $(\forall y \in V)\; f(y) > \xi$.
Remark Lower semicontinuity goes with the topology on the domain of $f$. In particular, in your question, lower semicontinuous means "$f$ is lower semicontunuous wrt to the strong topology" whereas "weakly lower semicontinuous" means "$f$ is lower semicontinuous wrt to the weak topology on $H$." So I guess there is no way to avoid weak topology in the proof as it directly relates to the topologies on the domain.
Fact 2. Let $C$ be a convex subset of $H$ (in your question). Then $C$ is closed in the topology induced by the hilbertian norm of $H$ if and only if $C$ is closed in the weak topology.
Returning to your question and assume that $f$ is lower semicontinuous w.r.t the strong topology (induced by the norm of $H$) and that $f$ is convex. We must show that $f$ is weakly lower semicontinuous, i.e., $f$ is continuous when $H$ is equipped with the weak topology. Let us use Fact 1 to do this, i.e., take $\xi \in \mathbb{R}$ and show that $f^{-1}(\left[{-}\infty,\xi\right])$  is weakly closed. Since $f$ is convex, the set $f^{-1}(\left[{-}\infty,\xi\right])$  is convex. On the other hand, since $f$ is lsc w.r.t to the strong topology, the set $f^{-1}(\left[{-}\infty,\xi\right])$  is closed in the strong topology by Fact 1. Altogether, Fact 2 implies that it is indeed weakly closed.
So, we have shown that, for every $\xi \in \mathbb{R}$, the set $f^{-1}(\left[{-}\infty,\xi\right])$  is closed in the weak topology. In view of Fact 1, we conclude that $f$ is weakly lsc, i.e., lower semicontinuous when $H$ is equipped with the weak topology.


What does "crime presents a concern for citizens" mean?

Question: Does "crime presents a concern for citizens" mean citizens find crime problematic in their city and they show concern for it?
Answer: Concern here means worry, anxiety.

Crime presents a concern/is a matter of concern for citizens.

This means crime exists in their environment and they are worried because of the danger it presents. It is not something to be ignored.


What is the effect of changing the Aperture

Question: What is the effect of changing the Aperture on the quality of the image?
Comment: Check also [Do smaller apertures provide more depth of field past the diffraction limit, even if peak sharpness suffers?](http://photo.stackexchange.com/q/11205/17441) for some nice sample photos in the answers.
Answer: Making the aperture smaller (F/2.8 is smaller than F/1.4) will cause increased depth of field, a darker exposure, and in some cases will result in increased sharpness. However, making the aperture too small can result in diffraction which makes the image softer. Also, small apertures result in starbursts from light sources if that's what you're after.


What is the story of sage Pulaha?

Question: Here  I have read something
but I didn't find a better reference related to Sage Pulaha,
I only know that he married a daughter of Daksha named Kshamā (Patience), by whom he had three sons.
Comment: Hi Eshan, it will be great if you can link the photograph back to the actual content. I am the original photographer for this photo. here is the actual link to the photo. https://flic.kr/p/ak2kbr
Answer: I found it
PULAHA
Pulaha is named among the principal Saptarishis, or those most often listed from the first Manvantara: Bhrigu, Angiras, Marici, Atri, Vasistha, Pulastya, Pulaha and Kratu. Pulaha was manas-putra of Prajapati as mentioned  Here
According to Vishnu Purana He was born from the navel of Lord Brahma. Source
According to Vishnu Purana The wife of Pulaha was Kshama.
Source

Kshamá, the wife of the patriarch Pulaha, was the mother of three sons, Karmasa, Arvarívat, and Sahishńu

According to Srimad Bhagwatam an another wife of Brahmarishi Pulaha was GATI
Source

pulahasya gatir bhāryā
trīn asūta satī sutān
karmaśreṣṭhaṁ varīyāṁsaṁ
sahiṣṇuṁ ca mahā-mate

Translation
Gati,( daughter of Kardama Muni) the wife of the sage Pulaha, gave birth to three sons, named Karmaśreṣṭha, Varīyān and Sahiṣṇu, and all of them were great sages.
Here is Something mentioned in Devi Bhagwatam related with sage pulaha.

What is the story of sage Pulaha?


What does extern do in objective C?

Question: If you extern a C++ method (not a variable) in an objective C file, what does this even do? What does it allow you to do? Especially in the context of an iPhone app.
Answer: It allows you to call a method which resides externally of your C file
Answer: extern is a C keyword that lets the programmer specify some construct (function or variable) that can be exported to other modules.
Is is said that C supports modularization but he does not permit a correct separation from implementation and interface of a module (so no encapsulation). extern is all it offers.
Here's a link for your attention.
Answer: A C++ method is basically a C function, C functions are extern by default (in the prototype anyway).  It just means that the function is not implemented there, although usually it means that its in another compilation unit (file).  Obviously, most C functions / C++ methods are implemented in another file, which is why they are extern by default.  Long story short, it does nothing.

What does extern do in objective C?


what is the difference between 寒い and 寒?

Question: is there really a difference between the 2? Jisho (辞書?) lists さむい for 寒い & さむ.い 寒. What difference い make?
Comment: What I mean if it's not clear is if they are both pronounced the same why is い used on 1 & not the other?
Answer: I'm assuming you are looking at this entry:

The dot in さむ.い means that 寒 is pronounced さむ in the word さむい. 寒 by itself is not pronounced さむい. In fact, if you click on さむ.い in jisho, it will link you to the entry for 寒い.
You might want to look a bit more into kanji, but idea is that for most cases, you will not know the reading of the kanji until it is combined with other kanji or followed with hiragana.


If signing a contract with a contractee outside of the U.S., should you tell the contractee to write it using the standards of the U.S.?

Question: If signing a contract with a contractee outside of the U.S., should you tell the contractee to write it using the standards of the U.S.? I am wondering if all contracts, especially business contracts, have the same formats and standard wording or they have different standards and formats and you need to hire a lawyer from the country where the third party resides because the formats and standards can only be understood in the context of their own laws, which is different from that of the U.S..
Comment: why should they write it to your standards instead of you writing it to their standards? Now they may need to hire a lawyer from the country where you reside because the formats and standards can only be understood in the context of your laws, which are different from that of their country.
Comment: I have seen small cultural/legal differences like initially every page and terms in both English and Dutch in Belgium. I assume there are stamps involved in China. Are you thinking of specific practices?
Comment: Don't think specifically in terms of the US. When writing a contract with contract parties in country A and B, should it use the standards of country A? Now substitute B with the US.
Comment: It would help to know the context of the contract and which side you sit on. For example, if you are a contractor accepting work for a foreign company then your likely going to be accepting standards/laws that are standard in their country. If its for a sale of goods then you'd need to factor in and laws/trade agreements that the 2 countries have and effect on the contents of a contract etc.
Answer:
should you tell the third party to sign it using the standards of the U.S.?

In most cases signing a contract is not subject to country-specific standards. All that matters is that it can be ascertained from the contract who the parties are as well as and their willful, informed formation of that contract.
It is more typical for a contract to specify that it is governed by the laws of country X and/or jurisdiction Y. That places on the counterparty(-ies) the burden of ensuring that they know the legal framework that underlies the contract at issue.
Lastly, note that a party entering a contract is "by definition" not a third party. At most, a third party might sign a contract in a witness capacity, not than in the capacity that implicates rights and duties pursuant to that contract.
Answer: There are no "standards of the U.S.?" with respect to contract forms
First, 99.99% of contracts are not in writing - see What is a contract and what is required for them to be valid?
Second, what you and the other party choose to put in your contract and how you choose to express it are entirely matters for you to decide. A contract document is evidence of the non-tangible contract. If you want to do it as a comic strip, that's perfectly fine.
That said, there are a number of standard contract terms that get used in certain industries and jurisdictions because all industry participants need to deal with the same laws, regulations and issues. Common problems lead to common solutions.
Courts are interested in the substance of a contract, not its form.
Cross-jurisdictional issues
Contract law in the US is primarily state law. So the issues that apply to cross-national contracts also apply to cross-state contracts.
Such issues include:

which jurisdiction's law applies to the contract?
are there laws in either or both of the jurisdiction that will apply notwithstanding? That is, some laws cannot be contracted out of.
if there is a dispute, which jurisdiction's courts are the most appropriate?
who takes the risk on import/export issues?
who takes the risk on currency fluctuations? That is, is the contract denominated in USD or AUD our GBP etc. or a mixture of currancies.
Comment: Some contracts are required to be memorialized in writing to be valid. In the U.S. copyright assignments and in most states, real estate sales.
Comment: @GeorgeWhite sure - did you read the answer to the linked question? The fact that a small minority of contracts (albeit usually high-value ones) need to be in writing doesn't mean that you need a written contract to buy a coffee, ride a bus post or a letter.
Comment: @DaleM You might need a formal contract to e.g. buy a million dollars of computer code from Generic Indian Outsourcing Corporation. Outsourcing and international supply chains in general are probably an area where a significant number (possibly the majority) of international contracts are made.
Comment: @nick012000 it might be a good idea to have a formal contract for that but you don't *need* one. Billion dollar contracts have been done on a handshake.
Answer: Quite likely, but not always and this isn't really about any specific jurisdiction, US or where.
Different jurisdictions interpret "obvious" questions in different ways, and place different emphasis on any number of arguments.
Some of the most obvious differences are in marital law… the very idea of pre-nuptial agreements was unheard of outside the US until how many years ago? With or without a pre-nup, does anyone not agree that given the chance, one or the other partner might prefer to have the case heard in this or that jurisdiction?
The most obvious current example of jurisdictional difference is prolly the case alleged against Prince Andrew by Virginia Roberts.
Thus far, the main points appear to be the age of consent and the recognised methods of serving legal documents… both of which seem to be different in UK and US jurisdictions in general - and even within the US, might well differ among individual states.


Can spy bi wire launchpad be used to program 4 wire JTAG MSP430

Question: I have  MSP430F5529 USB LaunchPad and MSP430FG4250IRGZR-16-Bit Ultra-Low-Power MCU. So is there a way to program the mcu using the launchpad.
Comment: If you simply need to load the firmware into the target then you can use the UART bootstrap loader.
Answer: The Launchpad can program any MSP430 that supports the SBW interface - you can tell these from the datasheet pin descriptions, if the RST pin is described as <code>/RST/.../SBWTDIO</code> then SBW is supported.
The MSP430FG4250 appears to be one processor in the MSP430 range that doesn't, so ... no.
If you've already made the PCB, you may be lucky enough to find another processor in the MSP430 range that (a) is available in the same package and pin-compatible for the pins you're using , (b) supports the peripherals you need and (c) HAS the SBW interface.
Otherwise it's up to you whether you want to invest in a full JTAG programmer or select a different member of the MSP430 range - this time, checking for SBW.
Table 1-14 of the JTAG programming guide (SLAU320) shows which device families have the SBW interface available.
Comment: Another requirement of the F5529's eZ-FET lite is that the target can run at the same 3.3 V.
Answer: Of course not! Spy Bi-Wire is a serialised JTAG and cannot be used with the full 4-wire JTAG.
In theory, I suppose that Bi-Wire could be converted to the full JTAG, but it would be a great deal of work, and cost more than simply buying the standard JTAG adapter. They cost $115.


Please help identify this icon of a young man holding a small cross

Question: Hello I would like help to identify this icon photograph. It is Greek Orthodox icon with a man holding a cross.
Comment: Thank you so much! So interesting! I thought it was a Greek Orthodox saint since my mother-in-law was from Cyprus. My family is from Russia! So nice to have a Russian icon in our home. God Bless!
Answer: images.google.com led to this orthodoxtimes which seems to indicate this is Saint John the Russian1

the Holy Confessor John the Russian was born in Little Russia around 1690

1 Wiki: John the Russian: many external links at bottom of page contain similar images
Many of the links are not in English. the above article has the image but doesn't specifically state who is in the picture, I'm assuming the content is about the image
Comment: You might add that [John the Russian - Wikipedia](https://en.wikipedia.org/wiki/John_the_Russian) has several external links at the bottom to sites that contain very similar images.


Water is still dripping from tank connection

Question: I noticed a slow but steady dripping from under the tank by the connection of the water pipe that goes into the tank. When I turned off the shut off valve it continued dripping in that area I mentioned....what can be wrong ?
Comment: Pictures are always good.
Comment: You have a leak. Add some more detail as to the type of tank and the connection you've made to it.
Answer: What can be wrong ? You have a leak. You closed a valve this probably trapped the pressure in the tank so yes it would continue to leak. If it is a large old school pressure tank it may be close to rusting out and the drip is the warning. Old pressure tanks were usually ~5+ feet tall and about 2' Across these were referred to as diaphragm    tanks, modern tanks are much smaller and are called bladder tanks. Both tanks use air pressure to push the water out with out having the pump to turn on for a few minutes (extending the pump life).
Bladder tanks are smaller as almost all the water gets pushed out before the pump turns back on. Bladder tanks only about 1/2 gets pushed out.  If this is just a large holding tank the water in the tank can cause a leak and would be of great concern a non pressurized tank holding water only has ~ .4 psi per foot of water.
So what is wrong you may have a fitting that has become loose but more likely the tank is getting close to failure if no work has been done in the area and the leak recently started.


Adjusting the process for each project

Question: Most of my experience in UX is based in Design Thinking. However, when faced with a new project, do you keep applying Design thinking to the task or are you flexible in your approach? For example, would you turn to a Lean UX process if the project requires it or do you stick to your own principles of Design thinking as that is what you are most familiar with and you know works?
Answer: Design thinking is sometimes difficult to define but, at its core, centers around a collection of methods or tools focused on achieving a design solution. You wouldn't necessarily have to choose between Design Thinking and Lean, or the user and the product, but rather how you apply your proven methods to the process of the greater team of which you are a part.
Answer: I tend to think that there is an approach or strategy that isn't necessarily fixed but has some common set of characteristics. And I would probably put Design Thinking and Human Centred Design in a similar bucket. By the way, you could probably say the same thing for Agile software development approach. So they are plenty of things that you can do that would still be considered taking a Design Thinking or HCD approach, and Lean UX would fit under that category.
Then you have a set of processes and methodologies that you can use to execute on those approaches and strategies, which have a more concrete definition or specification of what it is, such as doing customer journey maps or wireframes. And then there might be personal preferences or variations of those processes and methodologies that are largely based on your experiences and past projects. Unlike approaches, you certainly can't be doing customer journey maps and calling them wireframes (although you could consider it to serve a similar purpose to a storyboard perhaps).
I think Lean UX is a little bit confusion because the Lean methodology incorporates a number of principles (that have many similar roots to other process improvement approaches), but has been specifically adapted to the start-up environment (where businesses working in IT and digital economies seem to have really embraced). Because so many of the digital products and services are focused on customer needs to provide a competitive edge, it is not surprising to see HCD and Design Thinking also added to the mix, and hence you have Lean UX.
How do I navigate this kind of complexity? I try to simplify things by taking the processes that I have, abstracting it to the core outcomes I am trying to achieve and stripping out the dependencies (so that it is essentially agnostic of the technology and tools used to deliver the artefacts) so that I can apply it to the different types of projects that I am working on. As an example, one of the abstracted processes that I have when doing research is to come up with a hypothesis and validate it with actual data. Now you can apply this to a Lean UX approach by using simpler and more nimble research methods like guerrilla testing rather than large expensive user testing labs, but still stick to the same principles of formulating a research question, taking note of your assumptions and then trying to answer the question based on the data collected (and repeat if necessary).
I think if you can start adopting this type of thinking to your design process, you won't have to worry so much about adjusting your process for each project because you'll find that there is essentially a very similar way to solve most problems.

Adjusting the process for each project


How to add a sub-theme for mobile version?

Question: I finished my drupal site, and now I should create the mobile version.First I'm using Bootstrap 3.3.5 with a sub-theme, and drupal 7. I'm sorry I don't know how to explain it but I want like, add a another sub-theme  like my existing sub-theme and change on it for mobile with saving all my node and views, thank you.
Comment: The idea of using Bootstrap is that your site is responsive.. Is that not happening? Or do you want different content?
Comment: Most often this is done with media queries (https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries) in the existing theme. And I agree with the others: Bootstrap uses media queries itself and is designed to work on multiple devices.
Comment: Do you have some specific purpose of creating sub-theme? IF not you can apply any specific change to mobile version using CSS with that sub-theme itself.
Comment: thank you guys for responding, yes bootstrap is responsive , and i want to add another subtheme just to delete some contents and change others in mobile version , wich i switch to it by the module mobile theme
Comment: Hey @Aymen : All the advice above is good, stick to it. Try to update your question to better describe your reqs or goals. Then you can get better answers. For example; "I want to hide a specific block from the mobile version" would be a clear requirement. Cheers!
Answer: Create another subtheme (lets call it mobiletheme ) and with mobile theme module set your mobile version of site use mobiletheme.

Adds the ability to choose a mobile theme in
  admin/build/themes/settings which is used for serving users on mobile
  devices.

another solution is detect and set theme for mobile with themekey module (Check  tutorial here: http://mustardseedmedia.com/podcast/episode52 )

ThemeKey allows you to define simple or sophisticated theme-switching
  rules which allow automatic selection of a theme depending on current
  path, taxonomy terms, language, node-type, and many, many other
  properties. It can also be easily extended to support additional
  properties exposed by other modules. In combination with Drupal's
  theme inheritance you can easily achieve features like:
individually-styled channels
a front-page / "splash" screen
a date/time-selected Christmas theme
mobile themes for different auto-detected mobile devices
special themes for "limited" or "old" browsers
content, user, or role -specific themes
indicating your environment (production, staging, testing, sandbox, … )
testing your redesign safely on a live server
...

And unlike other theme switching modules, ThemeKey should play well
  with internal and external page caches, like Boost or Varnish, even
  for anonymous users.

but really it is heavy module and if you want only want switch to another theme when user surf site with mobile I strongly recommend you to use   mobile theme module.
Comment: thank you for responding,i want to keep my current subtheme with contents, and just delete some contents and change some others , that's way i want to create another subtheme and change on it ,and define it for mobile by the module mobile theme , thank you
Comment: @Aymen you're welcome, just duplicate current theme,  do your changes on it and use it as mobile.where is the problem?
Answer: Just add another theme to your site and setup the mobile devices indicator in the themekey]1 module. Themekeys supports:

mobile themes for different auto-detected mobile devices


Mysql workbench not showing realtions after reverse engineering database

Question: I'm using MySQL workbench 5.2.35 CE to reverse a Mysql Database and show the diagram of tables with their relationships.
I am able to get every table and its fields but the relations between them is not shown. Why is that? Is there any way it can be fixed?
Answer: Most often, the relations between tables are not stored in the DB. How to combine two tables is entirely up to the SQL query and because there are near endless possibilities to name your columns this is not easy to guess. Try to find some SELECT statements or use brute force to find out wich columns match.
Answer: If you are using MyISAM as the database engine, your database is not fully relational. Make your database fully relational by using InnoDB engine. Then you will be able to see the relations when you do reverse engineering. But please note that each has pros and cons of its own. Google MyISAM vs InnoDB to find out more about the differences.
Answer: I have tested mysql-workbench for both 5.2 and 6.0 latest version.  My database got foreign key constraints defined clearly.  My database is using mysql-native SQL. But the relationships are shown as line between tables.  I have created another test database with only two tables.  In this case the InoDb was used as engine.  The foreign key constrain clearly defined.  Still it only generate two lonely table object in the ER diagram after going through the "reverse engineering" module.
While using another commercial software, I was able to generate the 'lines' between the Entities.
My question is, is this a problem of workbench itself, or some error on my part.  My database server is the latest stable version 5.6.12.  If I can get an answer, this will be good for everyone.  You don't have to waste time trying to get an ER-diagram with this piece of software.


Energy of electrons in npn transistor

Question: Why do the electron loose energy when it moves from base to collector region?
In a npn transistor first emitter base junction is forward biased so electrons move to the base region . The electrons are minority carriers for base .now when base collector region is revered biased ,as the electrons injected in the base move towards the CB junction it gets easily transmitted to the collector region since the reverse bias produces a strong field which helps the electrons to move.so my question is the electron after reaching the CB junction feels a field i.e a force which further helps it to move to the collector region.so the electrons should be gaining energy and also reverse bias depletion region will not act as as a resistor.
Answer: The electric field between the CB junction and the Collector contact pulls the electrons to the Collector contact because it has a positive voltage compared to the Base and CB junction. The electrons loose potential energy as they travel from CB junction to the Collector contact.
Perhaps you are thinking about the speed of the electrons but that is irrelevant. You should think about the potential energy instead. Pulling an electron back to the CB junction would work against that electric field so would cost energy. So an electron traveliing to the collector contact looses potential energy.
Comment: Energy will be lost when resistance is provided but here  the depletion region helps or instantly attracts electrons and doesn't provide resistance instead it gives a extra pull which should increase the energy
Comment: You go on about resistance, show me where in the literature about the subject anyone talks about electrons encountering resistance in this context. The movement of electrons is determined by diffusion and electric fields. I think you should loose this thought about electrons encountering resistance in a PN junction because (electrical) resistance is not something which is considered at the atomic level, which is what detemines the behavior in this case. Resistance describes how a certain material is able to allow current to flow depeding on the applied voltage.
Comment: In case anyone is still reading this. Can we use the Fermi band diagram to explain this? clearly electrons are way lower in energy once in the C region.

Energy of electrons in npn transistor


Steps required to choose a suitable model for Poisson regression

Question: I have data on claim frequency and several predictors like age, gender of insured person and characteristic of vehicle. I have checked for the assumption of mean equal to variance of a Poisson model. Now I want to test for multicollinearity and homocedasticity. How am I supposed to proceed so that I choose a suitable model and fit it using the Poisson regression model?
Comment: One possibility to overcome the mean equal variance issue in poisson-regression is, to look at a quasipoisson-model which estimates a scaling parameter for the variance being able to change w.r.t mean. To check whether multicollinearity and homoscedasitcity is really a propblem I would suggest to develope a model-framework and estimate the corresponding parameters. Then you should look at the residuals.
Comment: If your counts are typically high, the usual diagnostic approaches to checking the model's variance assumption apply (i.e. to look at one of the types of standardized residuals for GLMs and do a display suitable for checking that those have constant variance much as one would with linear models).
Answer: If the variance equals the mean (the assumption for the Poisson that you say you have checked) then the only way to see homoscedasticity is if the mean does not change, i.e. you are fitting a straight line.  So that is usually not something that we check in Poisson regression.
You can look for multicolinearity by looking at plots and correlations of the predictor variables.  Then to see the effect of this on the regression fit the model with fewer predictor variables and see how much it changes the remaining slope estimates and how much it changes the overall fit (deviance or other measure).
Most important is to incorporate your knowledge of the variables and how they should work together.


What do we know about the transfer function away from its zeros?

Question: So lets say I have a transfer function for an FIR filter $H(z) = (z-a)...(z-n)$ where $a,...,n$ are points along the unit circle.  But what about other points along the unit circle that correspond to frequencies we want to leave alone?  Won't we end up multiplying these frequencies by random complex numbers? when we would really like them all to just be multiplied by one?
Comment: >Won't we end up multiplying these frequencies by random complex numbers? when we would really like them all to just be multiplied by one?  Well, not **random** complex numbers, but certainly not the desired unity.  Welcome to the real world where it is impossible to design ideal notch filters that zero out a selected set of frequencies while passing all others unchanged.
Comment: I resisted downvoting that the OP named an easily computable continuous and differentiable function as "random".  Quite the opposite.
Answer: The response of the filter at any frequency $\omega \in [-\pi, \pi)$ can be found by substituting $z = e^{-j\omega}$ (i.e. a position on the unit circle at an angle of $\omega$) into the transfer function. The resultant $H(e^{j\omega})$ is often referred to as a discrete-time system's frequency response. Most of the time, you're primarily concerned about the magnitude response of the system, so you will often see $|H(e^{j\omega)}|$ specifically considered in a system design.
When designing a filter, there will often be a region of frequencies that you would like "left alone;" this is called the filter passband. I wouldn't say that the presence of zeros elsewhere in the $z$-plane results in multiplying these frequencies by random complex numbers; indeed, the response at any frequency is well-defined. Design methods for digital filters that have flat passbands will yield a transfer function whose zeros are carefully placed such that the filter response is approximately unity in those regions (assuming no filter gain). The amount of allowed deviation from this ideal response is a design parameter that you often have at your disposal to control the required complexity of the filter.
So, to more pointedly answer your question, if you know all of the zeros of an FIR filter, then you know everything about its transfer function, at every point in the $z$-plane (and therefore everywhere on the unit circle).
Answer: It's an existence problem.  There exists no non-trivial linear time-invariant filter or transfer function that will "leave alone" any non-zero-size band of frequencies.
So either one deals with that characteristic of a linear system, or jumps into trying some non-linear or time-variable system which may be far less tractable and/or produce some really surprising weirdness for some inputs.


Google App always opens google.com on chrome

Question: When I open the Google App, it promptly opens Chrome and switches to google.com. I cannot access anything on Google App since it immediately switches to Chrome.
Answer: Same happened on my sister's Samsung Tablet. Turned out it was caused by the Qustodio Parental Control app. It blocked safe search which was forcing the Google app to open google search in Chrome because google would not allow the parental control app to enforce safe search and monitor its app .
Don't know if its that but here is Qustodio help article telling that :
https://www.qustodio.com/en/help/article/2832549/ (under heading "Safe searches on Android")
If you don't have Qustodio Parental Control app, maybe it could be some other app that high control on your device. Qustodio shows at this link what i mean by high control (ex. Apps with usage access, Accessibility, etc) - go to the step called "11. When prompted to Activate app supervision, choose Activate Now.".
Answer: Actually from the looks of things, Google has implemented Chrome custom tabs feature. The Google app now opens search results as Chrome Custom Tabs.
According to Google Search help:

You can open web pages directly inside the Google app on your Android
  device. This lets you:

Open search result links faster
Stay in the Google app
Copy or share a link, re-open a link in your browser, and more

To be able to open web pages in app you need:

Google app version 5.12+
To go to Settings > Accounts & privacy to toggle on the new 'Open web pages in app' option:

Pic source Reddit
If the above conditions are met try troubleshooting by

Clearing app defaults in Settings

Open your device's Settings app Settings.
Under "Device," tap Apps .
Tap the app that you no longer want to be the default (i.e Chrome)
Tap Open by default and then clear defaults.

Clear Google app cache and(or) data
(Settings >> Apps >> Google App >> Clear cache/data)
Comment: Try troubleshooting steps I mentioned above, and please report back additionally clear data for Chrome
Comment: I cannot even access the settings for the Google App, since Chrome launches immediately to Google.com. I am not searching anything, in fact, I'm not doing anything on the Google App except opening it.
Comment: It took a while and Google apps opened 30+ Chrome tabs of Google.com, but I was able to turn "open web pages in app" on. Chrome doesn't automatically open, but I still get a prompt asking which web browser to open with (Chrome, or Samsung Internet). Something is forcing Google App to open the google.com web page.
Comment: Yes, quite strange though I will update once I figure the root cause


Handle navigate from one icon to another icon.?

Question: I am currently working on a standard windows mobile application .I am creating 3 columns and three rows. i want to show 9 icons on form. But which event is used to  handle navigate from one icon to another icon.?
Thanx
Answer: You don't say what these rows and columns are in.  A custom control?  They're each seaprate controls?  Something else?  If they are each separate controls, then they will have a GotFocus and LostFocus event that you could use.


How do current spikes effect component lifetime?

Question: My Master's thesis project works with a system that mechanically prevents a DC motor from stalling and effectively thresholds the amount of current the motor draws and removes large current spikes from sudden loads.  It seems intuitive to me that removing these spikes will extend the lifetime of the components in the system (motor, motor controller, battery, etc.) but I need some sort of reference as to why this should be true; ideally some type of study or journal article that I can reference in my thesis.  I am also open to personal explanations.  Thank you!
Comment: I have a Pump system that runs since the 60s, several times a day, and has not yet failed. I doubt any current spikes do any harm to that thing...
Comment: @PlasmaHH has a point : the first step is going to have to be: identify a real problem (actual failures) and show that existing solutions are inadequate (complex or expensive or unreliable). A mechanical solution to an electrical problem is likely to be a hard sell.
Comment: @BrianDrummond I guess maybe some background would help. I'm designing a robotic bucket wheel excavator that will operate on the moon or mars.  I'm trying to show that my solution will make the electrical system more robust to large sudden loads from rock encounters.  With PlasmaHH's pump, the spikes are probably pretty consistent and well below stall current.  With my application the spikes could be very random and could stall the motor (without my solution).  A motor drawing stall current is obviously bad for the motor but I assume would also be bad for other components as well.
Comment: That establishes the need for reliability! And neat project! My impression is that limiting torque by limiting current in the driver - i.e. - allowing the motor to stall safely - is probably more reliable than adding mechanical means. (And easier to override if need be). But that's all I can offer, sorry.
Comment: @BrianDrummond That's definitely a good point.  Thanks for the help!
Answer: Look into "thermal cycle". Presumably any current spike would result in additional (albeit transient) power loss in the motor. Inside the motor there will likely be junctions (solder junctions ?) in the winding. The solder junction would be slightly higher resistance, thus slightly higher loss than the surrounding wiring. This would result in a temperature rise at the solder junction (again probably small). However, a rise in temperature and subsequent drop in temperature is known as a "thermal cycle".  I have dealt with thermal cycling in substrate bonded semi-conductors where thermal cycling reduces the lifetime of the semiconductor by eventually tearing away of the bond.
It may take several million extreme thermal cycles to disrupt or destroy equipment, but then  in an extreme environment, it might do well to at least consider thermal cycles.
    EDIT :  add link : http://nepp.nasa.gov/docuploads/99810235-C28A-4A8D-BD52223A33EF7CDF/ASME-Hawaii993-lockeed.pdf
Comment: Thanks!  That's definitely the kind of thing I'm looking for, and good to know!


Java alphabets in different languages

Question: How can I determine if String contains only alphabets and I want to have little more than [a-zA-Z]+, so is there any way to determine alphabets by Locale?
Answer: The Character class has methods such as isLetter which will be able to determine if a character is a letter as defined in the API specification for the method.
There is also another approach of using the Character.UnicodeBlock class which is able to return whether a character is in a specific character block of Unicode.
For example, I had to determine whether a character was a full-width katakana character, and to be able to do so, I had to use the Character.UnicodeBlock.of method:
boolean isKatakana =
    Character.UnicodeBlock.of(c) == Character.UnicodeBlock.KATAKANA;

Also to add, the character at a certain index of a String can be retrieved by using the charAt(int) method, and the Unicode code point can be retrieved by the codePointAt(int) method.
Answer: In addition take a look at com.ibm.icu.text package. For example, this snippet returns all alphabet letters for defined language:
ULocale ulocale = com.ibm.icu.util.ULocale
    .forLocale(Locale.forLanguageTag(language));
UnicodeSet set = LocaleData.getExemplarSet(ulocale, LocaleData.ES_STANDARD);
Iterator<String> iterator = set.iterator();
StringBuffer buf = new StringBuffer();
while (iterator.hasNext()) {
  buf.append(iterator.next());

}
return buf.toString();

This task cannot be reached by the means of java.* packages.

Java alphabets in different languages


What is the real derivation of Ohm's law?

Question: $I$ is proportional to $V$.
But then how it is that I directly got $V=IR$? It looks impossible to handle this thing!
If $I$ is proportional to $V$, then it must be $I=RV$. Why it is $V=IR$? The problem is of dependence of $V$ on $I$.
Comment: I have no idea what you are asking.
Comment: I is propotional to V right.What next
Comment: I believe the proportionality of voltage to current was determined experimentally, and it only applies to particular components, namely the resistor (Ohm's law does not apply to components such as transistors, op amps, etc.). Once you find a proportionality between two variables, it's always nice to determine a constant of proportionality. The resistance is exactly that, and is defined as the ratio of voltage to current (however, it is not the ratio of current to voltage. That would be one divided by the resistance.) The resistance is obtained by experiment.
Answer: Maybe you haven't got it right.
When we say that Ohm's law is about proportionality between $I$ and $V$ we mean that when you double $I$ then $V$ doubles as well (and vice versa, double $V$ and you'll get double $I$), and so on. We don't mean which is the constant of proportionality.
One formulation of Ohm's law is $V = R \cdot I $, and here the constant is the resistance $R$. But when you invert that formula, you get another formulation of Ohm's law, namely $I = \dfrac{V}{R} = \dfrac{1}{R} \cdot V$.
In this latter case the constant of proportionality is $\dfrac{1}{R}$, which is sometimes called conductance and represented with a $G$ letter, so that Ohm's law can also be rewritten as $I=G \cdot V$.
In both cases you have a proportionality relationship, i.e. a linear relationship between $I$ and $V$. They are not different laws, it's the same physical law expressed mathematically with different formulas.
Comment: Usman, if this post helped you understand what you were trying to figure out, then you should [accept this answer](http://physics.stackexchange.com/help/accepted-answer) :)
Answer: The thing we call "resistance" is a constant of proportionality for the relationship between $V$ and $I$. Because of the word, we like to think that "more resistance" should mean "less current".
Simply stating "current is proportional to voltage" leads to an expression of the general form
$$I = \alpha V$$
Now we need to decide the relationship between $\alpha$ and the thing we want to call "resistance", $R$. If resistance increases, we want current to decrease, so apparently
$$\alpha = \frac{1}{R}$$
Now we rearrange, and we obtain the familiar
$$V = I\cdot R$$


Fired for Bad Attitude

Question: I was recently let go for having a bad attitude and receiving customer complaints.  How do I explain this in an interview and on applications?
Comment: @TheMathemagician Then the hiring manager will think the OP might have a personality clash with him/her.
Comment: @Eric Still seems better than "Why did you leave your last job?" "I got fired because my bad attitude caused customers to complain."
Comment: How long were you at the job for?
Comment: Well I'd lie about it. Say that you had a personality clash with your supervisor.
Answer: Well, hopefully this is a learning/growth opportunity for you.  If so, you can talk about what you've done to address the situation and how the potentially negative experience has made you a better person/employee.
Answer:
I was recently let go for having a bad attitude and receiving customer
  complaints. How do I explain this in an interview and on applications?

You can just be honest about it if asked. Explain what happened, and how you have learned from it.
You sometimes don't have to explain much on an application. Be brief in your words. "Not a good fit for the position" is a good answer if you aren't looking for exactly the same kind of position in the future.
Depending on the kinds of jobs you are looking for, it may not matter much.
Answer: You can "hunt the good stuff"/find the silver lining in it and explain the positive changes you have made in interpersonal tact and self-control to your employers.
Some may say leave it off your resume, but honesty is typically the best policy, and if an employer can't appreciate you learning from a bad behavior (or see you as a liability) then just move on.
Hope this is an eye-opening experience, depending on your industry, country/locality and position in your industry it can easily be the beginning of a horrible reputation. Definitely want to try to get ahead of it.
Comment: Typically, you only list the details of the job on the resume: company, dates employed, roles, duties, accomplishments. Reasons for leaving are not usually listed due to making the best use of limited space. Reasons for leaving will come up in the interview, at which point, you're right, honesty is best.

Fired for Bad Attitude


Is this patent on a rudder innertube still valid?

Question: In reference to the patent: US6182594
Is this patent still valid ?
Jeff
Answer: US6192594 was filed on Oct. 12th, 1999 and should expire 20 years from that date assuming all fees are kept up to date. The best site to confirm the status of US patents is the US Public Pair. I checked and the fees are paid and up to date so the patent should expire on Oct. 12th, 2019.


Paying for drinks with Mexican and Texan dollars

Question: The story is told that when the Republic of Texas was feuding
with Mexico, there was a law passed by Texas to the effect that a Mexican silver dollar was
worth only 50 cents in Texas; whereupon Mexico passed a law that a Texan silver dollar was
worth only 50 cents in Mexico.
A citizen of Brownsville, Texas, walked across the bridge over the Rio Grande to Matamoros,
Mexico, went into a bar, ordered a 50-cent drink of whisky, paid for it with a Mexican dollar
and received a Texan dollar in change. He then walked back to Texas, went into a bar, ordered
a drink, paid for it with the Texan dollar, and received a Mexican dollar in change.
This pleasant pastime, repeated several times a day, went on all winter. At the end of the
time the Texan citizen still had his dollar. Obviously the barkeepers suffered no financial
losses; and the question is: Who paid for the drinks?
Comment: If this keeps going on, then in the end the Mexican bar keeper will run out of his Texan dollars. If he then wants to exchange the Mexican dollars that he earned for a doubled amount of Texan dollars, then he will find that nobody wants to exchange with him, because these Texan dollars can be more useful in Texas.
Comment: What is actually the puzzle here?
Comment: The puzzle is asking for who actually paid for the 50 cent value of the drinks
Comment: The barkeeps should have given change in their local currency to avoid such shenanigans.
Answer: The citizen has performed financial arbitrage against the inconsistent exchange rates offered by the two sides. The citizen purely gained value, and at the two barkeeps lost that much value in total.

Citizen: +2 drinks
Barkeep 1: -1 Texan dollar, +1 Mexican dollar, -1 drink
Barkeep 2: +1 Texan dollar, -1 Mexican dollar, -1 drink

So, one of the barkeeps has lost value, the amount of which will be determined when the exchange rate stabilizes and the value of the currency settles. For example, if the exchange rate settles to 1 Texan dollar equaling 1 Mexican dollar, then both will have lost one drink of value.
But, if it stabilizes to, say,

1 Texan dollar = 1 drink; 1 Mexican dollar = 4 drinks

then we'll have a value change

Citizen: +2 drinks
Barkeep 1: +2 drinks
Barkeep 2: -4 drinks

and one barkeep will have lost and the other gained.
If the barkeeps use their currency to buy goods and services from others, then they will pass on the risk of loss from the currency being misvalued. Like a pyramid scheme, this loss can be passed on indefinitely as people use this currency within their country. But, currency only has value in its purchasing power, so the loss must eventually be realized The loser depends on who is holding it when exchange rates settle and what they settle to.
Comment: Agreed. I, too, figured the barkeep(s) would be the ones to suffer the loss, but the original post - "Obviously the barkeepers suffered no financial losses;" - discouraged that thought.
Comment: The question does not specify _which_ sort of dollar the Texan ended up with; wouldn't his final valuation depend on that (if the exchange rate ends up unequal)?
Comment: If it is a law, then the barkeepers can go the the state bank and change the foreign dollars back to local dollars at the local legal rate.  So the barkeeper won't incur a loss.  The national banks will.
Answer: I think the beekeepers or their previous customers did pay for his drinks! Whoever had the Texan money in Mexico when the state rated the currency down.
If the Mexican barkeep had 10 Texan Dollars they were worth 10dollars before and then halved their value. So he lost 5dollars.
Another way to look at it, is that he is trading off his coins each with a loss of 50c, because he could use them over in Texas for their full original value, so he would be trading his coins undervalued and thus pay for the drink himself!
One more economical way to look at it is travel expenses, since the customer is traveling just like a trader, buying local currency and selling it somewhere else far away, the 50c can be seen as his cut/profit as a travelling salesman ;-)
Answer: The barkeepers pay.
The devaluation of the other countries currency is purely artificial. Instead of returning change in the foreign currency, the barkeepers could also return change in the local currency, go over the bridge and use their foreign currency to buy wares for the much higher value their foreign currency has there. Should they be forced to give away their foreign currency at the artificially low exchange rate, they are giving it away below the actual value.
In the real world, the barkeepers would refuse to give away any foreign currency they somehow acquired in their own country. They would do all transactions in local currency and spend any foreign currency abroad where it has more purchasing power.


trace TLM port connections using UVM ML wiith Specman and SV

Question: I am using UVM-ML on Incisive, and cannot figure out why data is not passing between my SV collector and e scoreboard. How can I see which TLM ports are connected, and in general debug ML environments?
Answer: Uvm_ml_phase -run connect
Uvm_ml_print_tree
Uvm_ml_print_connections
Answer: You can use uvm_ml_phase -run connect. after this phase the ports are connected and you can view the uvm_ml tree and all the ports relations via design browser.


Manually enter cck field data into database

Question: I have 1 content type and one cck text field.
if i create node and enter title and text field data and click to save save button its create node and enter data into node and content_field_table perfectly, but if i update cck field data manually into database its not shows update node data.
Answer: I can't say I'd advise manually inserting data into the database (there are a lot of API functions for CCK that will help you to do this), but that's for another question.
To make sure the node is reloaded from the database after you've inserted your record(s) just run this code:
$node = node_load($node->nid, NULL, TRUE);

The third argument to the function is $reset, which if TRUE will force the node to be built again from the database, not from the static cache.
Answer: Have you tried clearing the cache? A lot of things in drupal are being cached, so editing/removing them from their database table might give a conflict with what's in the cache.
Answer: I needed to do the same thing in Drupal 6, but ran into issues with the CCK Cache not clearing. I dug into the CCK Module code, and found the method they used:
cache_clear_all('content:'. $node->nid .':'. $node->vid, content_cache_tablename());

You can find details on cache_clear_all() here.
If you use this method, then your manual update code should look like this:
db_query("UPDATE `content_type_$type` SET field_$type_$fieldname_value='%s' WHERE nid=%d AND vid=%d",$node->fieldname[0]['value'], $node->nid, $node->vid);
cache_clear_all('content:'. $node->nid .':'. $node->vid, content_cache_tablename());