What pointing devices were available for C64/C128?

Question: Apart from 1351 mouse what other official Commodore C64/C128 pointing devices were available, or notable 3rd party like Mouse Cheese. Joysticks and controllers are out of question. C64-wiki seems to be blank on that.
Comment: We don't very much like questions that ask for list-like answers. The SE format is not very suitable for such questions.
Comment: If you don't like list questions, then **create a community wiki answer**.  That's what the community wiki was made for.
Comment: I believe there were not so many to make this question open-ended. "Leave open".
Comment: List like question, closing, but answer is still valid for me.
Answer: Before GEOS and the 1351 mouse became popular for the C64/C128, the most notable (non-joystick) pointing device was the famous Koala Pad.
There were a few programs for the C64 before GEOS that provided fairly complete GUI style interfaces. The Print Shop and Doodle come to mind, as well as the very early (1982) Pinball Construction Set. Because there was no mouse at the time, these programs generally relied on the joystick/keyboard to control the "pointer". It worked pretty well, but not so well for drawing programs. Therefore, it was the drawing/painting programs that tended to have support for the Koala Pad, with KoalaPainter being the best known of those.
The Commodore engineers who designed the C64 seemed to think the Light Pen would be the pointing device of choice for drawing/painting programs. So, this hardware is readily supported by the C64 (VIC-II lightpen interface) and its controller port. Many of these Light Pen devices were manufactured, but they failed to catch on with developers and users. This is most likely due to the awkward ergonomics of using a light pen on a vertical CRT display.
Note: While the 1351 and Amiga mouse look nearly identical, they work completely different and aren't compatible. However, recent efforts have been made to create an Amiga mouse driver for GEOS. This opens another very convenient pointing device up for C64/C128 use.
Comment: There was also 1350 mouse before 1351. It was called as "directional mouse" because internally it was working like joystick rather than mouse and compatible with software that using joystick as pointing device.

Additionally the was also paddle device support to compete with pong devices . But afaik they were not so popular.
Answer: You're looking at the wrong page. :) The C64-Wiki page on Input Devices lists mice (digital joystick-like mice, and analogue free movement mice), touchpads, graphics tablets such as the Koala Pad with Koala Painter, light pens and light guns as typical C64 pointing devices.
Answer: The Amiga mouses also worked, but they took a lot of raster time for the mouse cursor to move fast enough.


No audio after updating to 15.04

Question: Missing sound after updating form 14.10 to 15.04, installing "Ubuntu restricted extras" doesn't help. Is there a way fix this or easy way to rollback to 14.10?
Comment: So, I've managed to shift my problem by adding the line `options snd-hda-intel model=xxxx enable=1 index=0` to `/etc/modprobe.d/alsa-base.conf`, where `xxxx` is my soundcard from [here](http://www.mjmwired.net/kernel/Documentation/sound/alsa/HD-Audio-Models.txt). Now there is a headphones and line-out options in sound setting and it works after restart. But now there is sound from both speakers and headphones and i have to manually mute speakers when i plug headphones in.
Answer: Try this: go to the terminal (Ctrl + Alt + T) and type sudo alsa force-reload, press ENTER. A password prompt is going to show up. Insert your password, and press ENTER. Wait for the process to end, reset all your programs and sound should be OK.
Comment: I tried everything, reinstalling alsa and pulse,  M buttons :) but this force-reload did the work. Thank you very much :)
Comment: Nope.  The problem seems to be that it doesn't detect that there is headphones plugged in and i have to manually switch to headphones every time after restart.
Answer: Fixing that is simple, just install those two packages : alsa-base and pulseaudio
You can do it with this command :
sudo apt-get install alsa-base
sudo apt-get install pulseaudio

If this doesn't work, please make sure you selected the right audio device in
System Settings > Sound

Comment: Ok, i have alsa-base and pulseaudio. In sound settings there is only "digital output(S/PDIF)" option (i dont have s/pdif, just regular headphones). Switching from "Digital stereo output" to "Analog stereo output" in pulseaudio solves the problem, but i have to do it each time after restart. Is there a way to change default output device?
Comment: I believe the behavior is to default to S/PDIF if you are plugged in with HDMI on boot.  The idea is that if you have an external digital audio receiver, you probably want to use it, but if you're on the go, you don't want it selected by default.
Answer: I also had the same issue after install 15.04. But managed to fix it by reinstalling Alsa and Pulse Audio. Also, I had to increase volume with Alsamixer.
This article explain everything nicely.
Comment: Nope, made things worse for me.  Sound volume icon disappeared from the menu bar and system settings window is now transparent.
Answer: locate the .pulse folder in your home folder. Most probably its going to be under .config. Remove the .pulse folder. Logout and login. That should do the trick.
Answer: I've seen this happen in two ways:

check in pulseaudio if you have multiple output sources that are not plugged in, and the wrong one is selected as primary. (go to configuration and turn everything you're not using off)
an application already binded to a specific sound source. Restart that application after doing the above
Comment: I just had this solution fix my problem. Any ideas why it chooses the wrong profile?
Comment: well, I would guess something simple, like the motherboard giving the list of audio devices and listing out the undesired one first/with a lower device number.

No audio after updating to 15.04


12.04 dell 14z inspiron 5423 ultrabook sound (noise)

Question: I've just installed 12.04 on my new inspiron 14z and since the systems starts loading a white noise begin to sound. When i play any song or music from internet, it works fine, but the noise continues. I've tried turning off all the volume controls but it continues..Could any one help me or give me a clue to find a solution? THANKS
Comment: If the question has been solved, you mark the answer as accepted by clicking the tick button next to the answer.
Answer: The problem probably lies in the fact that the sound card is currently not supported by the ALSA Intel HDA module (as of v1.0.24). You can retrieve the model of your card using the command
$ cat /proc/asound/card0/codec* | grep Codec

which in my case returns
Codec: IDT92HD91BXX
Codec: Intel PantherPoint HDMI

(the first being the interesting one). The list of supported cards can be found at [www.kernel.org/doc/Documentation/sound/alsa/HD-Audio-Models.txt], and it appears that the latest are 92HD83*.
However, after some investigation done with the excellent HDA Analyzer tool, I discovered that the problem can be solved by setting one of the GPIOs:
(I would have posted an image here, but I do not have enough reputation for it).
The tool can be used to export a python script which reproduces the modifications done through the GUI. Here are the script contents (slightly modified by me):
#!/usr/bin/env python

# This scripts eliminates the noise produced on resume
# by Intel IDT 92HD91BXX cards controlled by the hda-intel driver
# (ALSA v1.0.24)

import os
import struct
from fcntl import ioctl
from time import sleep

def __ioctl_val(val):
  # workaround for OverFlow bug in python 2.4
  if val & 0x80000000:
    return -((val^0xffffffff)+1)
  return val

IOCTL_INFO = __ioctl_val(0x80dc4801)
IOCTL_PVERSION = __ioctl_val(0x80044810)
IOCTL_VERB_WRITE = __ioctl_val(0xc0084811)

def set(nid, verb, param):
  verb = (nid << 24) | (verb << 8) | param
  res = ioctl(FD, IOCTL_VERB_WRITE, struct.pack('II', verb, 0))

attempts = 0
while((not os.path.exists("/dev/snd/hwC0D0")) and attempts < 50):
  attempts += 1
  sleep(0.1)

FD = os.open("/dev/snd/hwC0D0", os.O_RDONLY)
info = struct.pack('Ii64s80si64s', 0, 0, '', '', 0, '')
res = ioctl(FD, IOCTL_INFO, info)
name = struct.unpack('Ii64s80si64s', res)[3]
if not name.startswith('HDA Codec'):
  raise IOError, "unknown HDA hwdep interface"
res = ioctl(FD, IOCTL_PVERSION, struct.pack('I', 0))
version = struct.unpack('I', res)
if version < 0x00010000:        # 1.0.0
  raise IOError, "unknown HDA hwdep version"

# initialization sequence starts here...

set(0x01, 0x716,   0x02) # 0x01071602 (SET_GPIO_MASK)

os.close(FD)

In order to execute the script at boot time, first save it to /usr/local/sbin/fix-idt-codec and then create the init script /etc/init/fix-idt-codec.conf:
# fix-idt-codec - Fixes issues with snd-hda-intel
#
# This scripts eliminates the noise produced on resume
# by Intel IDT 92HD91BXX cards controlled by the hda-intel driver
# (ALSA v1.0.24)

description     "Fix Intel HDA IDT Codec issues"

start on runlevel [2345]

task

exec /usr/local/sbin/fix-idt-codec

Now reboot, and the problem should be fixed.
For the sake of completeness, there is an additional issue some people documented in this thread: the white noise reappears after a suspend/resume cycle (and, curiously, disappears when you plug in earphones). To fix it you can add a file named 20_fix-idt-codec to /etc/pm/sleep.d with the following contents:
#!/bin/sh

# This scripts eliminates the noise produced on resume
# by Intel IDT 92HD91BXX cards controlled by the hda-intel driver
# (ALSA v1.0.24)
#

PATH=/sbin:/usr/sbin:/bin:/usr/bin
HELPER=/usr/local/sbin/fix-idt-codec

if [ ! -f $CODEC ]; then
        exit 0
fi

case "${1}" in
        resume|thaw)
                if [ -f $HELPER ]; then
                    python $HELPER
                fi
                ;;
esac

I hope this helps. I found the following links quite useful during the debugging:

Help to debug Intel HDA - [www.alsa-project.org/main/index.php/Help_To_Debug_Intel_HDA]
Matrix:Module-hda-intel - [www.alsa-project.org/main/index.php/Matrix:Module-hda-intel]
Audio debugging techniques - [voices.canonical.com/david.henningsson/2011/12/08/audio-debugging-techniques/]
HdaIntelSoundHowto - [help.ubuntu.com/community/HdaIntelSoundHowto]


Story about a lonely alien inhabiting a planet that communicates telepathically

Question: I read a book/short story in the 1980s about a lonely alien inhabiting a planet that communicates telepathically with people in a spaceship passing nearby.  I think it was a yellow-jacket VGSF (Victor Gollancz Science Fiction) book.
Comment: Is it the alien or the planet that communicates telepathically?
Comment: Does the alien or the planet do the communicating?
Comment: This is awfully vague. Are there no other plot points you can remember? Any names of characters in the story? Or names of spaceships? What happened as a result of the communication? You say _book/short story_ but the plot sounds very thin for a book.
Comment: Apologies for being so vague: the alien does the communicating.  I can't recall any names but I think the alien tries to stop them leaving the planet's orbit because it is desperate for some mental "companionship".
Answer: Sounds like Time is the simplest thing by Clifford Simak.
Not quite the same (no traditional space travel is involved), but ticks the lonely alien, making ESP contact with "passerbys".
Short story, good read.


Scripting access to a website using different ips

Question: I would like to test automatically my website from different locations in order to localize content's presentation. I think I have to write a bash script to access the website with wget program, using an ip from a list. There is somewhere an established solution to this kind of problem ?
Comment: Search for IP spoofing, or try anonymous proxy servers...
Comment: Wait, so if I'm from, say, Argentina, and I fly to, say, France, I will get stuff served in French? You can pick any two locations with different localisation options. It doesn't seem good - what if a German lives in Italy but still has "German" in his localisation preferences? You should be basing the localisation on that instead of the IP which is really unreliable to begin with. And using the locale the user has set is (I can't believe I'd have to write that) is the proper way to give them the locale specific information. Moreover, it's easier to test.
Comment: @Vld Your point is truly valid but it is weak compared to my client main requirement - ip-based personalization :)
Answer: There is many solutions. I think to these ones :

IP spoofing. But it's not easy. In particular if you want orchestrate these tests to automate them...
Another solution is to use a reverse-proxy. An example: your application is hosted by Tomcat and you use Apache as reverse proxy. In this case you can easily configure several end-points in Apache where you lie about XFF
Another solution, you can rent VM in the cloud. This is a good approach if you want to perform real performance tests from a remote client, or check the behavior of Internet cache...
Some compagnies sells services to check availability of your web-stuff from different sites.


Why "D'ouest en est" instead of "De l'ouest à l'est"

Question: Why do we say "D'ouest en est" but also "Ceci est situé à l'ouest, et cela est situé à l'est". Can someone please explain when to use "à l'est" and "en est"?
Comment: related : [Does "ouest" take a different preposition than the other directions?](http://french.stackexchange.com/questions/2993/does-ouest-take-a-different-preposition-than-the-other-directions/)
Comment: Usage of "en" this way is not very common... Saying "de l'ouest à l'est" is correct. The only structure I can find with this "en" is "Je [déménage/bouge/vais] de France en Russie". Kinda hard to explain...
Comment: @Random : Not sure if "de l'Ouest à l'Est" is correct. I would say : "de l'Ouest vers l'Est".
Comment: "De père en fils," "de fil en aiguille," "d'homme à femme." There are lots of examples like these, but I don't think there is an actual rule for all of them.
Answer: To start, please read this to understand difference between "ouest" and "Ouest".
You can see there is an ambiguity between the East as a region and the east as a direction. In French you would say "en Est" in the first case and "à l'est" in the second case.
Actually "en Est" is less and less used in French, to the point you don't really hear it outside of expressions like "d'Ouest en Est" or in tabletop games terminology. People uses "dans l'Est" instead when referring to the eastern region.
"D'Ouest en Est" suggests a movement from the West to the East, something like a migration or a weather phenomenon. The phenomenon is observed with a global point of view. Strangely enough "De Nord en Sud" is not used often at all ("Du Nord vers le Sud" is used instead)
"De l'ouest à l'est" suggests a change in the orientation, like the movement of a radar trying to get a signal from a wide angle. The phenomenon is observed from a local point of view.
To state the location of something, you can say:

Ceci est situé à l'ouest.

It means from where you are, walking toward the west, you will eventually get to it. But you can say, too:

Ceci est situé dans l'Ouest:

It means it is in a western region. Not particularly from where you are, just considered as objectively western. Of course it is silly because nothing in the Earth is more western than something else, but due to francocentrism that can be used to speak about the America, or the "Far West".
You can also say about someone "il est à l'ouest", which means he is disconnected from reality, but that is not very relevant here.
Comment: "De nord en sud" is not really idiomatic (it seems to be a staple of proper names, it isn't used in normal writing). The idiomatic expression corresponding to "d'est en ouest" is "du nord au sud".
Comment: This does not answer the question.
Comment: It does, at least it answers the question as I understand it.


Does an irregular rigid body can only rotate in three directions?

Question: Suppose that at a certain instant the angular momentum with respect to the center of mass is not parallel to the angular velocity. Does this necessarily imply that the angular momentum is rotating around the axis of rotation? If so, then an isolated body must necessarily have angular momentum with respect to the center of mass parallel angular velocity (otherwise the angular momentum varies and the system is not isolated).  However, this gives me a perplexity: an irregular rigid body has only 3 axes such that $ \vec{L}_{cm} $ and $ \vec{\omega} $ are parallel. Does this mean that the irregular rigid body can only rotate in three directions? It seems completely absurd to me, but where is the mistake?
Answer: A general rigid body has 3 principal axis. Suppose $I_1<I_2<I_3$. If it rotates around $I_1$ or $I_3$ without external torques, the angular velocity doesn't change and is parallel to the angular momentum. Theoretically the same happens with rotation around $I_2$, but in a unstable mode. Any deviation and it starts to wobble (tennis racket effect).
The angular momentum is conserved if there is no applied torques, but the angular velocity can varies chaotically. https://www.youtube.com/watch?v=WvrbejgDL3A
Comment: So the answer to my question is that the non-parallelism does not create problems because, if the system is not free, the two vectors can rotate in many ways, if the system is "free" from forces (like "free faling" asteroids) it can only rotate the angular velocity. However a free body can have a simple rotation (I mean in turn to a specific axis without the rotation axis changing) only if rotating around a principal axis of inertia. Right?
Comment: Yes, I think you are correct for a free body (no torques) with $\vec \omega$ along a principal axis.  Note: A rigid body can be forced (by applying torque) to rotate about a fixed axis that is not a principal axis. In this case $\vec \omega$ is fixed in direction, but $\vec L$ is not fixed in direction. The body is not dynamically balanced.
Answer: You state "an irregular rigid body has only 3 axes such that $ \vec{L}_{cm} $ and $ \vec{\omega} $ are parallel." I presume you mean the principal axes?
In terms of the Cartesian principal axes, the angular momentum is $\vec L = I_1\omega_1\hat i + I_2\omega_2\hat j + I_3\omega_3\hat k$ where the I's are the moments of inertia and $\hat i$, etc. are axis unit vectors.  The angular velocity is $\vec \omega = \omega_1\hat i + \omega_2\hat j + \omega_3\hat k$. $\vec L$ and $\vec \omega$ are not necessarily parallel using the principal axes.
If the axis of rotation is any principal axis, say axes 3, then $\vec L = I_3\omega \hat k$ where $\vec \omega = \omega_3\hat k$, then $\vec L$ and $\vec \omega$ are parallel, but this is a special case.  It is not required that $\vec \omega$ lie along a principal axis.
Comment: Yes I mean principal axes


How to get hold of intermediate certs programatically?


Could we code in Natural language once we pass the Turing test?

Question: Technically speaking, could we code in natural language once we pass the Turing test? Would passing the Turing test at least simplify programming languages' syntax?
Comment: Looking for a quantitative answer..
Answer: Controlled Natural Language (of the second type) can be used for programming, with no need to pass the Turing test.
Answer: No.  Humans pass the Turing Test but cannot express themselves with enough precision and little enough ambiguity to code well in English (natural language).  No machine will improve on that until it can greatly improve on human-level clarity in expressing their purpose when programming.
Is it possible to program in natural language?  Yes, I think so.  But it would require superhuman intelligence to anticipate all the possible confusions that might arise when a word is not sufficiently precise or accurate to represent an software activity or mechanism.  This probably would require adopting a rigorous convention in choosing a subset of unambiguous words to form a "natural" programming language (a kind of creole).  Coding consistently using only those words would require discipline that exceeds the ability of most humans, methinks.
Comment: Follow up: Given its precise syntactic grammar, is Sanskrit the best candidate for natural language coding\ passing the Turing test? If not, which  language is?
Comment: I like this answer, but I think the the final sentence needs some clarification.  "Most humans" may be correct, but is ambiguous and hard to substantiate.  It's probably a safe assumption that programmers, technicians, engineers, scientists, etc., would be able to master this "nlp programming language".
Comment: The kind of help development environments provide, showing alternatives at the current context, might be a great help to guide humans, in a way that extreme discipline would not be required.
Answer: I think this is a very interesting question.  It's highly hypothetical, so my simple answer will also, necessarily, be hypothetical.

If the AI can pass the Turing Test, it can be assumed it has a command of the human language(s) used in that process

Self-awareness in this context would seem to be irrelevant, as would the question of whether the AI actually "understands" the content, or is merely imitating natural language.

If the AI has a command of the human language(s), it would be a reasonable assumption that it could translate natural language instructions into machine code

It might be best to think of the problem in the simplest terms.  If you asked this hypothetical AI to "draw a red square on the screen", it's hard to see that task as impossible, or even difficult.
Obviously, as the instructions became more complicated, there would be a greater margin for error, and it would be useful to integrate precise, formal terms related to functions, as Randy points out.
Comment: @Bobs it depends on what the AI is being asked to do.  It might not necessarily have to code in machine language proper, for instance Python or JS or any computer code would work.  But unless it's using a computer language based on natural language, it would still have to code in code.
Comment: @Bobs I suppose you could have the low-level function be autonomic, even where they had the intelligence to translate natural language into machine code, but classical computing will always be based on 1's and 0's, and even quantum computing on qbits, so there's no way to get around the the fact that any instructions are ultimately reduced to a sting, mostly likely in base-2.  On top of that, natural language is inefficient for coding, but even if it were used, it's getting translated into machine language and a binary string.
Comment: @Bobs haha.  that would be awesome if someone could find a way to harness it!  Wouldn't hold my breath though
Answer: Yes, we can program in natural language.
Specifications in natural language are normally neither precise nor complete. But when using a large language model like GPT-4, that is not a problem:
The model makes assumptions for parts you did not specify.
Sometimes that is good enough, but in general, you need to refine your specification until it is complete and precise enough to fit the requirements you try to express in natural language.
Note that you do not need to fully understand your actual requirements from the start, you can incrementally refine them too.
To illustrate it, I will give a example using GPT-4:
(All prompts are shown, there is no further prompt engineering, it is zero-shot. Prompt: is what the programmer writes, GPT-4:, Output: is the output from the current version of the program executed as python.)

Prompt:
Write a python function that can concatenate some strings, and print the result with 10 characters per line.

GPT-4:
def concat_and_print(strings):
    concatenated = "".join(strings)
    for i in range(0, len(concatenated), 10):
        print(concatenated[i:i+10])

# Example usage
strings = ["hello", "world", "this", "is", "a", "test"]
concat_and_print(strings)

Output:
helloworld
thisisates
t

Prompt:
I want to give the strings as args.

GPT-4:
def concat_and_print(*strings):
    concatenated = "".join(strings)
    for i in range(0, len(concatenated), 10):
        print(concatenated[i:i+10])

# Example usage
concat_and_print("hello", "world", "this", "is", "a", "test")

Output:
helloworld
thisisates
t

Prompt:
add spaces

GPT-4:
def concat_and_print(*strings):
    concatenated = " ".join(strings)
    for i in range(0, len(concatenated), 10):
        print(concatenated[i:i+10])

# Example usage
concat_and_print("hello", "world", "this", "is", "a", "test")

Output:
hello worl
d this is
a test

Note how the specification is not only incomplete, but also imprecise. Much less exact than natural langue could be. The specification add spaces does not say where the spaces should be added. Not even that they should be added to the output. It is not specified that they should be between the words, but the interpretation of it is what I meant.
(This is a real chat session with GPT-4, not cherry picked or edited.)


My elementary os is freezing very often, how can I identify and solve this problem?

Question: This mis my first attempt to use Elementary OS.
I am using a GIGABYTE GB-BXBT-1900 with 8GB of memory, as well as, a 240 GB solid state hard disk. It has frozen twice within the first hour of use. Once while browsing the internet and the second while familiarizing myself with the OS. Any help will be greatly appreciated
Comment: Did you run updates first thing after the install? If not, please do. Open AppCenter and go to the updates tab. If offered there, also install "intel-microcode". Reboot.
Comment: Having the same freezing situation and it is so frustrating. I realized that is happening since kernels are .112 and .113, I had changed to .112 and looks a little more stable compared to .113 but freezes the same. It was really fast and snappy and now is all buggy and frezzes, I can not have more that three tabs of browsers without having to reboot the system. Even though that would be Chrome but it is happening even with Epiphany.
Answer: sorry for the harsh "welcome" from the EOS. Anyway I would suggest to watch the system log for errors close to the seconds of the freeze (yes you need to write down the exact time when system freezes). Then try to search for the error. Maybe it will be descriptive enough to understand without search.
In my case the freezing was caused by faulty open source NVidia driver.
Comment: I'm using "System Logs", "Logs" or just "cat /var/log/syslog" (least favorite)
Answer: It may do to the intel processor. I had similar experience with a laptop with intel processor. What I did was open the terminal:
sudo nano /etc/default/grub

Change GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
with GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_idle.max_cstate=1"
Save it (CTRL+O)
Exit (CTRL+X)
sudo update-grub
sudo reboot

Hope it helps.
Comment: Please include the why, what does this do?
Answer: I also encountered this problem right after switching from windows.
Turns out that my laptop didn't have enough ram to run my stuff and Elementary OS only had ~1GB of swap allocated. This caused freezing problems.
So the solution was to increase swap size. Here are the commands I used:

create a size 16G file called swapfile in /
sudo fallocate -l 16G /swapfile

set the file as swap space
sudo mkswap /swapfile

set the swap file as permanent (or it will disappear after reboot)
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

After this we can use commands like htop to see if swap is increased.


How to break in a pitchers glove?

Question: When I look at mlb pitchers their gloves seem to have a specific breakpoint compared to infielders/outfielders.
Any ideas on their breakpoints?
Comment: Where is the evidence that pitcher's gloves are broken in differently?
Answer: I have played Division 1 baseball, and I was recruited to play both infield (SS) and pitch, so I have a little experience for this question.
Frankly speaking, the glove is all about preference by the player.  Personally, I hated breaking a glove in.  I felt as though breaking it in (even though it makes catching a lot easier) really broke down the fabric that makes the glove as special as it is.  I loved having a stiff glove because it didn't make the glove feel flimsy, but again that's personal preference.
Another thing to think about is the size of the player's glove.  As I am sure you know. Outfielder's gloves are supposed to be bigger than infielder's and pitchers due to them wanting to increase their range.  Same with infielder's and pitchers.  When I played infield I used 11 3/4 size glove but when I pitched I used a 11.5 and even 11.25 glove.  So in reference to your question, their breakpoint could be different due to the actual size of the glove, or the make of the glove, or the way they break it in (heat and oil, a lot of catch, etc).
So really to answer your question, the way a glove is broke in is totally dependent on user preference.
Answer: There can be many different methods that can be used to "break-in" a baseball glove. I came an ESPN article that asked then current MLB players how they "break-in" their new glove. The responses range from using the microwave/oven to bake the gloves, others hit and pound on the gloves by various means and objects, with some just use it during practice and workouts or have others use it to get some wear on it.
Comment: I found that their are probably many different way that professionals and alike have found to "break in" their gloves
Answer: Heat and oil and then lots of practice!

How to break in a pitchers glove?


Can't login ORA-28031: maximum of 148 enabled roles exceeded

Question: I can't login - and receive the error code above. How do I fix this?
Comment: Offtopic. not a programming question. This is db/server administration. Try the DBA site.
Comment: Cheers - sorry about that. ps. I was solving a programming problem - my automated tests wouldn't work because I had this error. I came to stackoverflow first. Hopefully others will find the migrated post.
Answer: to let the user connect you need revoke some roles from the user
see discussion about here: AskTom
https://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1565923300346644029
the discussion about parameter MAX_ENABLED_ROLES that used to limit max count of roles to 150 roles. the parameter is marked as deprecated but as the discussion says it still had some value for limit

It is deprecated because they are currently maxing it out (just like
  maxtrans is deprecated - but still "exists", it is 255 no matter what
  you set it to)
  MAX_ENABLED_ROLES

Range of values 0 to 148

deprecated
MAX_ENABLED_ROLES specifies the maximum number of database roles that
  users can enable, including roles contained within other roles. The
  actual number of roles that users can enable is 2 plus the value of
  MAX_ENABLED_ROLES, because each user has two additional roles, PUBLIC
  and the user's own role.
Answer: First, login as
SYSTEM@databasename AS SYSDBA

Then
SELECT * FROM DBA_ROLES;

Then for each role you don't want...
DROP ROLE <rolename>;

To drop roles.
If you have some pattern to the offending roles, you can use the following anonymous loop to clean those up. Imagine you had 50 roles with the word GILES in them which were generated from some erroneous SQL routine:
BEGIN
  FOR c IN ( SELECT ROLE FROM DBA_ROLES WHERE ROLE LIKE '%GILES%' )
  LOOP
    EXECUTE IMMEDIATE 'DROP ROLE ' || c.ROLE;
  END LOOP;
END;
/

Don't ask me how to re-architect your roles, I'm no expert. I just had the same issue where some automated tests were creating roles but not dropping them.
I believe you can't alter the limit so discussions about the limit are pointless.
As Justin_Cave mentions, you can also revoke roles from users to deactivate them or make the role 'non default' which effectively reduces the active role count, and allows you to retain the role for future use.
Comment: This works if you happen to have a script that creates roles, that doesn't clean up after itself, and where you don't need the roles any longer.  In the general case, though, you'd want to revoke the role from the user (or make the role non-default).  That lets you keep the role (which is generally still useful).
Comment: Useful addition. Yes - you're right - if the roles are still useful, it's more about which roles are active.
Comment: -1, That is really a bad advice to drop roles to resolve this error. revoke the roles form the user that has the problem. If you have roles that where created erroneoulsy thatn drop them, even if you don't get a maximum-enabled-roles error. Besides that, initially SYSTEM does not has SYSDAB privileges and I don't think it is reasonable to grant this to it. If SYSTEM does not have SYSDBA privileges then your login will not work.
Comment: Miracle173 - I had just installed oracle server 11gr2 for this test and my SYSTEM user had SYSDBA privs by default. I don't think this is bad advice at all - if you have roles you do not use or need, the DBA should be dropping them, that's what I've said to do, and that fixed this particular problem in this scenario. I'm not saying there aren't other solutions.


Intellimouse Optical-side buttons for Catalina

Question:
My ~20 year old Intellimouse Optical optical functions in Catalina.  I would like to be able to use the side-buttons to "go-back" in Safari.  I believe (please tell me if this not correct) that intellipoint will unlock this feature.
The instruction's step-1 calls for:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null ; brew install caskroom/cask/brew-cask 2> /dev/null

Step-1 seems to install brew, however, I am reluctant to execute this command because brew cask has already been used to install applications such as sublime-text.
brew cask install microsoft-office

returns the error:

Error: Cask 'microsoft-intellipoint' is unavailable: No Cask with this
name exists.

Per the comments I tried:
brew cask install caskroom/drivers/microsoft-intellipoint

Which returned:

Error: caskroom/drivers was moved. Tap homebrew/cask-drivers instead.

Is there a method to determine the cause of the error without performing Step-1?  I am concerned that Step-1 may cause problems as brew is already installed per https://brew.sh  If the fix is to perform Step-1 because it somehow adds the equivalent of a repository, I would appreciate an ELI5
Based on this thread I would like to avoid disabling the System Integrity Protection for the very old Microsoft Drivers.
I suspect the side-buttons are sending a signal and it may be possible to configure OS X per the goal.
Answer: SensibleSideButtons might help with your problem, but keep in mind it is a third-party solution, so there is a chance it won't work properly.


Does every homogeneous space allow a group structure?

Question: Let $(X,\tau)$ be a homogeneous space, that is for all $x,y \in X$ there is a homeomorphism $\varphi:X\to X$ such that $\varphi(x) = y$. Is there a group operation $*:X\times X\to X$ such that $(X,*,\tau)$ is a topological group?
Comment: Note that homogeneous space often means that there exists a transitive continuous action of a *connected Lie group*, which is much more restrictive than your definition: for instance all connected topological manifolds are homogeneous in your sense, but for instance closed surfaces of genus $\ge 2$ are not homogeneous in the stronger sense. Anyway the answers provide counterexamples that are homogeneous in the stronger sense, such as the 2-sphere.
Answer: Not necessarily.
It can be shown that every connected topological group has Euler characteristic $0$. Now take the $2$-sphere, for example. It is connected, and the Euler characteristic $\neq0$. It is homogeneous, of course.
Answer: Another way to get negative answers: a topological group does not have the fixed point property (every map from $X$ to itself has a fixed point), as a translation $x \rightarrow a\ast x$ with $a \neq 1$ does not have a fixed point.
But there are homogeneous compact metric space with the fixed point property, e.g. the Hilbert cube $[0,1]^\mathbb{N}$, see this question for reasons why this is so.
Comment: And a complete proof that the Hilbert cube is homogeneous can be found [here](http://arxiv.org/abs/1211.1363), with explicit homeomorphisms.
Answer: $S^2$ is a classical counter-example. See Corollary 9.59(iv) on p. 486 in

K.H. Hofmann and S.A. Morris, The Structure of Compact Groups, Berlin, 1998.

Let me give you a method of producing non-separable examples. By Tkachenko's theorem, any $\sigma$-compact group is ccc. So consider homogeneous $\sigma$-compact spaces which are not ccc. You can construct such spaces by taking countable unions of certain (open) long lines.


Force Exerted by Container on a Gas

Question: If there is a gas in a container with pressure P, then it will exert a force on the walls of the container. By Newton's third law, there should be a reaction force where the container exerts an equal but opposite force on the gas. Does this force exists, and if so, how does it manifest? What does a force exerted on a gas by walls of a container even look like?
Answer: The force does exist, and it manifests itself by stopping the molecules, which are in rapid translational motion, from escaping out of the container. When they try to escape (that is when they hit the container wall) the wall knocks them back in. The very fact that the gas stays in the container demonstrates the existence of the force.
Answer: You are talking about the "normal force" ( https://en.wikipedia.org/wiki/Normal_force ). The gas pushes against the container and the contai9ner pushes against the gas because two masses cannot occupy the same space. This is similar to you standing on the floor, you do not fall into the floor because of the normal forces between your shoes and the floor.
Answer: On the microscopic scale, the force of the container on the gas is a result of coulombic repulsion of the gas molecules/atoms striking the molecules/atoms in the wall, as the electrons in gas molecules/atoms move close to the electrons in the wall molecules/atoms.  The same coulombic repulsion keeps an object stationary on a horizontal surface in the presence of gravity.

Force Exerted by Container on a Gas


After the on-site interview

Question: I visited the campus for an in-person interview 2 weeks ago.
They supported my flight and hotel.
I thought I was good at the interview and the director stated that she will be in touch after several weeks.
Is it okay if I send follow-up email?
I am so nervous and cannot focus on my work.
Any comments will be appreciated.
Answer: Unless they gave you a specific time frame, then yes, it is fine to ask them about the current state of your application.
If you have other options, then keep them open until things are definite, but don't bring them up when asking for an update.
Don't become a pest, but a couple of weeks is a pretty good interval.
Answer: I would say that if no time frame is specified, two weeks is enough to warrant an email. I've actually had cases where I had been accepted to a position, they just hadn't informed me yet. It is likely that they may still be interviewing other candidates or have not made a decision so it will do you well to keep your email straight and to the point, IE

Dear interviewer,
Thank you for taking time to interview with me, I was wondering if
  there were any updates on the position.
Thank you,
OP

You could maybe add a thank you to their hospitality but I find most people in academia don't like emails, so besides adding the standard niceties, I try to get in and out quick.
Note: my field is CS, so small talk is usually at a minimum. Some people find this type of communication a little too impersonal.
Comment: It's not unspoken, though perhaps not spoken about all that often outside of high school English classes anymore. To combine two complete sentences into one, one either needs a linking conjunction or a semicolon. So "Thank you for taking time to interview with me; I was wondering if there were any updates on the position" is valid, but simply writing two sentences is probably better here. The comma in the middle indicates that one clause should be subordinate to the other, as in "While we like you, we won't hire you" or "We won't hire you, though we like you."
Comment: Seems like good advice, except that I would not suggest including a comma splice in a professional email.
Comment: I've not heard that before, is that an unspoken rule or guideline that I have missed? I assumed it would be okay to combine the two statements because of their shortness.

After the on-site interview


Which currency is used when investing in ETFs for foreign indices?

Question: If for example, I invest in an ETF for the S&P 500 or USD Treasury Bond ETF, from the UK with £1000, will this automatically be converted into USD? Then if USD grows stronger against GBP, will this mean my investment appears to grow stronger to me (since I'll always be viewing my investments in GBP), even if the S&P 500 hasn't grown in USD?
Answer: It depends on what you buy:

if you buy an USD ETF, you pay in USD, and when you sell, you get USD. Either you have to convert your money, or your broker does it for you. Any gains or losses at the currency exchange are yours.

if you buy a derived asset provided by your broker, it could be traded in your currency. Typically, any exchange rate changes would reflect in the assets price, and your broker will take some fee for providing the derivate service.

The former is much more common.
Answer: It doesn't matter.
You buy ETF shares. You own a fraction of whatever the ETF is worth. You can measure that worth in dollars or pounds or lira or whatever.
Since it's a US ETF it owns shares in US companies. All of those US companies have assets in USD, liabilities in USD, pay taxes in USD, and they physically exist in the US so if they are liquidated they are most likely to sell their stuff to other US residents or companies in exchange for USD. For these reasons it makes most sense to use USD to measure the value of the companies. But you don't actually own any USD - you own (indirectly) the companies.
If a company owns a USD 50,000 truck, and the USD appreciates to 25% more, and the truck is still worth USD 50,000, then the truck is now worth 25% more, and its value measured in GBP goes up 25%. If the truck is only worth USD 40,000 now, that's actually the same value, and its value measured in GBP is the same.


Is MVC a golden hammer for web apps?

Question: The more I look around I see MVC. Except Drupal most of the good PHP CMS systems now rely on MVC. In fact the last 2 projects I worked on were based on MVC and they were not web sites but were web front end for communication infrastructure. So is it safe to assume that MVC is a golden hammer for, if not all then, most web apps?
Answer: It is a good idea for medium to large sized web applications.
But simply following the MVC paradigm does not guarantee good code.
Comment: Oh god, please don't ever write Hello World with an MVC pattern.
Comment: lolz, +1 to your sense of humor, btw, if a customer pays me enough $$$s I may write "Hello World!" in biggest or most bloated implementation of MVC ;-)
Answer: Considering the MVC paradigm was pioneered in the early days of Smalltalk, and now finally being adopted by web applications, I would have to say yes. Until they come up with a better wheel that is.
Answer: It reminds me of using
 for all web page layout, not just specifically tabular data. The proper alternatives need to become more fashionable and step up their marketing.
Answer: Well, it is not MVC, but rather modularity and separation of concerns which are the golden hammers for any complex application (whether web or otherwise). Since web applications usually involve client-server communications, interactive user interfaces, and need to provide provisions for routing and caching, developing web applications in modular fashion with loosely coupled layers invariably boils down to separating the presentational layer from actual logic, separating out the actual urls followed from buisness logic and abstracting away the domain logic in separate model classes. Following the MVC architecture simply feels natural from organizational and management point of view because it fits well with the way web applications behave and are understood.
So yes, MVC is a golden hammer for web apps.
It is particularly so since MVC is not very strictly defined organizational system and can be very well moulded as per convenience in different contexts.
As far as PHP implementations are concerned most of them are more or less most of them are derived (to varied extents) from rails and therefore are similar in many aspects.
Konstruct ( http://konstrukt.dk ) is a framework that you might be interested in which does not follow this architecture.

Is MVC a golden hammer for web apps?


how to render a better startchart graph on umple?

Question: The umple is a very good to design UML statecharts, with rich set of semantic attributes in text mode. However, the embedded mechanism to draw correspondent statechart has scarce resources to show important informations (e.g. guards, exit, entry, conditions).
Is there a safe interface to export/import on other tool, preserving all semantic of statechart?
Answer: You make some good points.
Two parts of the answer is this
Issue 1863 is to have popups on state machines elements so the guards, exit, entry and other conditions. https://github.com/umple/umple/issues/1867
This is being worked on and is a high priority.
I just raided issue 1898 to add some more features https://github.com/umple/umple/issues/1898
As for exporting ... there is an NUSMV model generator. There is an experimental prototype scxml generator that needs more work too. The Papyrus generator also exports state machines, but also needs more work. These generators can be triggered by the GENERATE menu in Umpleonline or the -g command line argument
Core features of Umple are robust (e.g. Java code generation, and diagram generation, but your question delves into territory where more contributions would be welcome.


online free tutorial in Introduction to GIS

Question: Do any one knows online free tutorial in Introduction to GIS, where i can find the below topics.
1.Coordinate sysem
2.Georelational Vector Data model
3.Raster Model
4.Data Input
5.Geometric transformation
6.Spatial Data Editing
Answer: Coursera offers a free GIS class from Penn State called Maps and the Geospatial Revolution. You can sign up and take the class. In addition to the content there is a component of interacting with other students and commenting on critical thinking type discussion boards. However, this class begins on April 30, 2014.
In the interim, you can take a look at the free class calendar and select any classes with a blue link. Once you click the links, take a look at the contents on the left hand side of the webpage.
You may be interested in:
GEOG 482: Nature of Geographic Information - This course explores the nature of geographic information. To study the nature of something is to investigate its essential characteristics and qualities. To understand the nature of the energy produced in a coal-fired power plant, you would need to study the properties, morphology, and geographic distribution of coal. By the same reasoning I believe that a good approach to understanding the information produced by GIS is to investigate the properties of geographic data and the technologies, professions and institutions that produce it.
Here is an example of the GEOG 482 landing page. If you click Chapter 1: Data and Information, there will be an onslaught of begining GIS content.
Answer: Updated Tutorials:

http://qgis.org/en/docs/user_manual/index.html
A Gentle
Introduction to GIS from QGIS
Docs
http://manual.linfiniti.com/

Old, but still relevant:

http://linfiniti.com/dla/
http://maps.cga.harvard.edu/qgis/ <- has a promise to be updated anytime now

I am recommending these because you have the QGIS tag.
Comment: The second item @SaultDon lists (A Gentle Intro...) is an excellent resource for beginners and it provides both theory and practical examples in QGIS. It's an open document and I've used it to aid in teaching beginner workshops in the past.
Comment: Thanks for reply, I have Introduction to GIS in Semester and will be doing it in matlab is the above link valid, since i don't know which tag to put so i have used qgis


Expected length of projection of vector

Question: How can be the expected length of projection of vector of length $l$ is $l/\sqrt d$ where d is dimension of underlying vector space. I am using $l_2^2$ norm
Comment: For d=2 the expected length of the projection of a unit vector on any axis is 2/pi, not 1/sqrt(2). Please explain why you suggest 1/sqrt(d).
Comment: i am talking about $l_2^2$ norm. I edited my post please check it
Answer: Let $x_i$ denote the $i$th coordinate of a vector uniformly distributed on the sphere of radius $\ell$, then $E(x_i^2)$ does not depend on $i$ and $\sum\limits_{i=1}^dx_i^2=\ell^2$ with full probability hence $E(x_i^2)=\ell^2/d$ for every $i$, that is, $\|x_i\|_2=E(x_i^2)^{1/2}=\ell/\sqrt{d}$. Note that $\|x_i\|_2$ is not the expected length of the projection on the $i$th axis (this would be $\|x_i\|_1=E(|x_i|)$).

Expected length of projection of vector


Learning PLC programming

Question: How do I learn PLC programming? Would it differ greatly for different brands of PLCs? Is ladder programming the same as PLC programming?
Answer: I did a lot of PLC programming, and now do quite a bit of .NET programming.  It's very dangerous to make the switch either way, because a lot of the skills that you think should be transferrable (patterns and such) lead you very far astray.
The biggest difference that I tell people is that PC program code should be written as if other programmers are the audience, but PLC programs (ladder logic) must be written as if maintenance people are the audience.  Maintainance in most facilities (particularly manufacturing) frequently connect directly to PLCs and in online mode they can watch the code execute graphically to figure out what's wrong.
For instance, if an output isn't turning on, they'll type the output electrical device ID into the find function of the programming software, find that output coil, and start tracing back from there looking for issues.  One of the frequent mistakes that some PLC programmers make is to "map" their I/O into a structure (in PLCs, these are called user-defined types), and they use a copy instruction to move all the inputs or outputs over to the structure at once.  Makes sense from a PC programming perspective, but it makes the maintenance person want to kill you.  Typically the programming software provides a cross reference feature where they can specify that output coil, and it will tell them everywhere in the program that it's used.  If you use a copy instruction to move 10 words of I/O into a 10 word data structure, he's got to sit there and count bits to figure out which bit in the source of the copy maps to which bit on the destination side of the copy.  True, comments can help, but there's a problem with that too... PLCs store the whole program and allow you to upload the program from it in an emergency if you need to troubleshoot and you don't have a copy of the original program.  The problem is that for space reasons, the PLC doesn't store the comments.  So if the line is down, it's costing $5000 per minute in downtime, and a guy runs out there with a laptop, he might have to do a quick upload without comments and try to troubleshoot it.  Having those copy instructions in there, wasting 10 minutes of his time, just cost the company $50,000 in downtime.  These are the things you have to be aware of when writing PLC programs.
Some other tips: some PLCs have support for FOR loops.  Never use them.  For the same reason above, they make the code very difficult to troubleshoot for a maintenance person.  This is because if you have one piece of code in the PLC that gets scanned more than once per scan (like the contents of a loop), then when you go into online debugging mode, the software can't show you the values for each of 10 loops that executed this scan, so you really have no idea what value you're looking at.  Then you have to write all this tricky code to pull the loop values for a specific loop index out into some other tags (variables) that you can monitor.  That's just one more impedance to fixing the problem in an emergency.  Using a subroutine more than once per scan suffers from the same problem.
Indirect addressing (what we would call Arrays) are very difficult for maintenance people to understand.  It's generally OK to use them when you're dealing with recipe management (storing and retrieving values for how to build your part) but you should try to stay away from it in the control part of the program.
In PC programming, of course we seek to re-use code as much as possible. However, in PLCs and control systems, downtime is extremely expensive, and hardware is expensive.  Memory is cheap, and actually PLC programmers are cheap.  Therefore, it's expected that if you have 10 identical things on your machine (like conveyor drives or something) that you will have 10 different files (subroutines), one for each drive, and each drive will have its own variables associated with them: e.g. Drive1_Run, Drive2_Run, Drive3_Run, etc.  This is going to feel very "wrong" to you when you come from a PC programming background, but this is all because of the points I've made above.  When you're in a downtime situation, and someone says that Drive 3 isn't working, you crack open the laptop, go to the file for Drive 3 and you look at the Run output rung.  You start troubleshooting from there, while the program is executing.  There's no breakpoints (the program never stops).
Good luck on your endeavors.  I wrote up some more insights from my years of programming PLCs, if you want to check them out.
Comment: Scott, I have been the maintenance guy, and the guy writing the PLC programs (still am!), and now I have dabbled a bit in writing some .NET with C#, and I can tell you that you are bang on the money with all that you have said above! Great answer.
Comment: Helpful side note: the part on comments not being stored in PLC memory might not be as much of an issue 8 years after this answer was posted...Many newer PLC's now store program and tag comments in memory with the project file.
Answer: You can learn PLC programming from various sources on the internet, one of which is this(wikibooks) or this
The program that you write will be pretty much the same across different brands of PLCs for LLDs (Ladder Logic Diagrams) unless you use PLC specific functions. But there will be much more differences if you use some language like IL (Instruction List). But once you have written the program, the format of storage and execution differs widely across brands
Ladder logic is one of the 5 programming languages for PLC, the others being FBD (Function block diagram),  ST (Structured text, similar to the Pascal programming language), IL (Instruction list, similar to assembly language) and SFC (Sequential function chart). These are just various representations of the programming language, various flavours if you will. But usually, a given brand supports only one of these. In USA, LLDs are widely used, while in Europe, ILs are more popular.
Answer: Ladder, often call LD is one of several language styles defined in ISO 61131 automation programming standard. Others are SFC (sequential flow chart), FBD (functional block diagram), ST (structured text), and IL (instruction list). IL is similar to assembler and very few people use it. ST is a text based programming much like early versions of BASIC. It is not often used either. LD is designed to resemble relay contacts off an electrical control panel (which many PLC replaced). FBD looks more like a circuit diagram. SFC is basically a flow chart.
Some PLC support all, other only some, or even one. While LD is the most common, FBD and SFC are gain popularity.
Different brands do use slightly different programming languages. They are usually similar enough that once you understand one brand, you can work with any of them, but you cannot directly take code from one PLC and using on another brand.
Comment: LD is actually very common in North America, but in my experience is rarely used, and often looked down on, by people in, say, Europe.  I believe this is because in Europe a maintenance person doesn't go online with a PLC - they call the engineering department for that, but in North America maintenance will go online for troubleshooting, will make changes, and in some cases do a lot of the programming work.  The circuit-like LD is just better suited to this culture.
Comment: @Scott: "I believe this is because in Europe a maintenance person doesn't go online with a PLC" - I would disagree with that. I spent years doing precisely that, even writing programs from scratch, all in my role as electrical maintenance.
Answer: The answers given so far are pretty on target. One thing I found that PLCs have a split personality when it comes to their langauges and setup. Their core design is to give the electrical guys a flexible means of setting up control logic for their overall design. PLCs are basically a bunch of input and a bunch of outputs and how they are connected is controlled by the software you load into the device.
One of the emphasis of the languages that are used for PLCs is that they are accessible to people coming from an electrical background. So the idioms and structures seem counter intuitive for a person used to high level languages or even assembly languages. Ladder Logic for example is very accessible for electrical folks.
However in recent years PLCs have been supporting a multitude of languages for maximum flexibility. However in my opinion the handful of PLCs I worked are very lacking in terms of being a programming environment. Simple things like assigning variable names to memory location are often not designed into the language being used. The ones that are easy to work are often not the most cost effective for the job.
Despite these handicaps they are excellent for simplifying complex electrical systems. If you are working with others on a project, you will find that your knowledge of programming will help the project solve thorny programs. I was able to take a 100 rung ladder logic program and rewrite it into a third of the rungs. Once I was able to learn the ladder logic language I was able implement various optimizations that reduced the complexity of the program.
One tip is that you will need to learn about latching. Sometimes you will need to store or hold some output and unless you have a latch it the result will disappear the next cycle. Once you understand the issue it become clear but at first it was a great source of frustration for me.
Answer: PLC programming should be viewed as implementation activity of PLC software engineering output, unless you are using PLC as purely part of alternative components to mechanical or electrical solutions.
With this as basis, PLC programming environment is typically IEC61131 driven, gauranteed cycle time, "pre-emptive" realtime, no need to handle realtime OS related issues, continuous code scanning, non-program-pointer, different concept from typical computer task spawning kind of multi-tasking. Code execution is naturally atomic, no need to use monitors between tasks.
Each of the languages has its closeness to how conceivable is your code to the logic model you want to implement.

Ladder has its basic concept on electrical power flow interlocking style. Code resolution within single network is either horizontal or vertical scanning (your can find resource on this topic from manufacturer or other sites). If your code has single scan resolution nature and is within one network, some unconceivable behavior can be due to scanning type (important to remember that ladder is only emulation of electrical circuit, it is still sequential in execution).
FBD or function block diagram was electronic signal flow but today can be data flow depending on type of PLC. FBD shows clearer execution sequence quite similar to horizontal scanning ladder in scanning sequence. Today, FBD is typically used as container for object function blocks, although dependency implementation and visual similarity to process model is dependent on PLC type.
Literal is very similar to BASIC, but syntax only; execution is still scan-through. Literal language is good for mathematical calculation. For high level implementation, methods or derivation of attributes within object can be easier using Literal. State machine programming using English-like state representation or constants makes program very readable.
Statement list looks similar to assembly mnemonics but again execution is still scan-through and not program pointer. It is strong in bit operation and parenthesis-styled discrete logics. It can be a very efficient language to use with proper structuring and commenting.
SFC or sequential flow chart is a complementary language for sequence implementation. SFC has inherent rules on action block activation, state transitions, parellel sequence activation and merging. However, complex exception branching or concurrent action management can make implementation complicated and flow chart difficult to read.

PLC system management on IO handling, communication, hot-standby is hardware configuration effort, and is product dependent. Generally, can be treated separately from software engineering. However, data related to PLC system management are of "located" (independent data addressing area) type, good data modeling approach in software engineering can help in manageability of system data.
Comment: I am afraid this is my second downvote for this user, but the description given obfuscates and complicates the task. Software engineering principles used for "regular" software does not really apply to PLC/PAC programming in general. Think of the difference between writing a client application for a desktop and writing a hard realtime system to control a cars engine. Totally different approaches are used, techniques appropriate to the application.
Answer: The Online PLC Simulator may be useful.
Answer: You can use Structured Text (ST) which consists of a series of instructions which, as determined in high level languages, ("IF..THEN..ELSE") or in loops (WHILE..DO) can be executed.
I find it better than Ladder as it is close to standard programming language.
Answer: I had a little of PLC programming on University. It seemed to me, to be a one level lower than assembly, but device we were using wasn't the newest one.
I belive you need to have a PLC driver, but I would first look for simulators and read more about it before buying.
Comment: I disagree with your "one level lower than assembly" idea.  If you look at the OPcodes generated by the ladder logic, that looks exactly like Assembly language (XIC, etc.).  In IEC-61131-3 lingo, that's "Instruction List" (IL).  Ladder logic is a visual language with similarities to Function Block Diagram, which is definitely a higher level than Assembly (specifically because it's more declarative than imperative).
Answer: Allen-Bradley has a free dos based software PLC, specifically for training.  You can probably find it if you go to their site, or Google it.   It's used to teach PLC programming in schools.
Answer: For a beginner trying to learn ladder logic, the best way is to attend free online training at http://plcs.net
Answer: PLC is the term used for the devices that use ladder logic.  The devices that are programmed in more typical programming languages are generally called microcontrollers.  However, there are some of us that on occasion lump them all under the PLC name.  :-)  Not sure how much ladder logic varies, but microcontroller code can vary significantly.

Learning PLC programming


Is Mac OS X's two finger scrolling damaging to your hand?

Question: I've noticed an unusual feeling associated with Mac OS X's two fingering scrolling.  Any chance this might indicate a repetitive stress injury in the making?  I've been trying to rotate the fingers I use for scrolling somewhat, but not terribly successfully.  Anyone else found solutions to this potential issue?  (related)
Comment: Impossible to answer. Define "unusual" feeling. Any motion can prove hazard, provided it is repeated frequently or the motion itself proves to put undue strain on a muscle, tendon, joint, or other bodily thing. If you finger scroll eight hours a day, then it might be cause for concern. If you finger scroll for a few hours spread out over the course of the day, unlikely. It may also be your posture and not the device. RSIs are serious and ultimately it boils down to if you feel uncomfortable doing it, stop. But from what I know about RSIs, they do require a lot prolonged repetition.
Comment: Is this with a trackpad on a laptop or magic mouse?  I've noticed when I use my laptop a lot for work/websurfing, my wrist can feel "unusual."  This is, however, probably due to the ergonomics of how I'm lazying on the couch with the machine.  While using my magic mouse at my desk at work, I don't feel "unusual."
Answer: Out of all the Mac users I've ever heard of/seen, none of them have ever said anything like this. I swift touch of a trackpad of mouse certainly doesn't seem to be any sort of damaging movements. If you end up having problems with it more you could ask a more 'medical' associated person. I've personally never heard anything like it, but muscle pains can be worsened from certain movements causing stress. Good luck!
Comment: It hasn't reached the "it hurts when I do this" "well don't to that" phase yet, just a vague concern.  I'm trying to very usage though.
Answer: I have been experiencing a strong inflammation on the middle finger articulation, which I think it might be caused by the macbook mouse and repetitive movements of scrolling and clicking. I have a ultrasound tomorrow.
My doctor doesn't think this is from the mouse, but probably she doesn't know this type of mouse.
Comment: Was it related to your mouse? I'm having the same problem and have been using Apple trackpad extensively for a few weeks now.
Comment: Hi, Was it related to your mouse?
Comment: Was it related to your mouse? facing same issue
Answer: In the past I have noticed a clear correlation between discomfort in my index finger, middle finger and wrist and the use of a magic mouse/trackpad.
I really love the functionality, but I am confident that the use of my magic mouse was the source of discomfort. It wasn't exactly pain, but more the feeling my fingers were not aligned properly any more or touched each other differently and sometimes a strange tension. There was no clear visual difference between my right and left hand.
As a teenager I had a wake up call with regards to RSI when my neck got stuck/blocked when I tried to reach for a shirt on the top shelf of my closet. It took two days before the muscles relaxed. Since then I have been extra careful to listen to my bodies signals. For me trackballs work well.  I use a Logitech M570 trackball.
My hand still acts up when I use my MacBook on the couch a couple of nights in a row.
Answer: I have only ever experienced the opposite - I have frequently ended up with sore fingers from ONE finger scrolling on traditional mice. I've been a cross-platform developer for decades, including the one-button Apple mouse era so I'm a good data point for comparing both.
Currently, my desktop has a Bamboo touchpad and scroll-wheel mouse on my PC then an Apple Magic Mouse on the left of my Mac keyboard with a Magic Pad on the right of my keyboard. I use two-fingers for scrolling on both Mac and PC on the pads and prefer it to using the scroll wheel on my PC mouse.
In particular, with the pads, you can scroll with a hand gesture that is more of a swipe, unlike the single-finger on the traditional mouse.
Answer: I've noticed an obvious correlation btw recent work involving internet searching and posting- my hand is very swollen on the back and extremely sore- hurts even to wash my hands, and getting worse. I use a track pad with 2 finger scroll, but even typing hurts now. Have tried to switch to traditional mouse, but I'm not familiar enough- too many things I can't seem to do. And typing left handed doesn't really work anyway.


How to traverse through the files in a directory?

Question: I have a directory logfiles. I want to process each file inside this directory using a Python script.
for file in directory:
      # do something

How do I do this?
Answer: With os.listdir() or os.walk(), depending on whether you want to do it recursively.
Answer: In Python 2, you can try something like:
import os.path

def print_it(x, dir_name, files):
    print dir_name
    print files

os.path.walk(your_dir, print_it, 0)

Note: the 3rd argument of os.path.walk is whatever you want. You'll get it as the 1st arg of the callback.
In Python 3 os.path.walk has been removed; use os.walk instead. Instead of taking a callback, you just pass it a directory and it yields (dirpath, dirnames, filenames) triples. So a rough equivalent of the above becomes
import os

for dirpath, dirnames, filenames in os.walk(your_dir):
    print dirpath
    print dirnames
    print filenames

Comment: @Ignacio Vazquez-Abrams: `os` is a module (not a package). `import os` works on Python 2.4-3.2, jython, pypy. Why do you need to `import os.path` ?
Comment: @J.F.: Although `os` is currently not a package the documentation refers to `os.path`, and should it ever change so that `os` *is* a package with `path` as an actual module, code (and habit) that only imports `os` but uses `os.path` will break.
Comment: Although this will work due to how `os` handles `path`, you *should* always import `os.path` explicitly.
Answer: You can list every file from a directory recursively like this.
from os import listdir
from os.path import isfile, join, isdir

def getAllFilesRecursive(root):
    files = [ join(root,f) for f in listdir(root) if isfile(join(root,f))]
    dirs = [ d for d in listdir(root) if isdir(join(root,d))]
    for d in dirs:
        files_in_d = getAllFilesRecursive(join(root,d))
        if files_in_d:
            for f in files_in_d:
                files.append(join(root,f))
    return files

Answer: import os
# location of directory you want to scan
loc = '/home/sahil/Documents'
# global dictonary element used to store all results
global k1
k1 = {}

# scan function recursively scans through all the diretories in loc and return a dictonary
def scan(element,loc):

    le = len(element)

    for i in range(le):
        try:

            second_list = os.listdir(loc+'/'+element[i])
            temp = loc+'/'+element[i]
            print "....."
            print "Directory %s " %(temp)
            print " "
            print second_list
            k1[temp] = second_list
            scan(second_list,temp)

        except OSError:
            pass

    return k1 # return the dictonary element

# initial steps
try:
    initial_list = os.listdir(loc)
    print initial_list
except OSError:
    print "error"

k =scan(initial_list,loc)
print " ..................................................................................."
print k

I made this code as a directory scanner to make a playlist feature for my audio player and it will recursively scan all the sub directories present in directory.
Answer: You could try glob:
import glob

for file in glob.glob('log-*-*.txt'):
  # Etc.

But glob doesn't work recursively (as far as I know), so if your logs are in folders inside of that directory, you'd be better off looking at what Ignacio Vazquez-Abrams posted.
Answer: If you need to check for multiple file types, use
glob.glob("*.jpg") + glob.glob("*.png")

Glob doesn't care about the ordering of the files in the list. If you need files sorted by filename, use
sorted(glob.glob("*.jpg"))

Answer: import os
rootDir = '.'
for dirName, subdirList, fileList in os.walk(rootDir):
    print('Found directory: %s' % dirName)
    for fname in fileList:
        print('\t%s' % fname)
    # Remove the first entry in the list of sub-directories
    # if there are any sub-directories present
    if len(subdirList) > 0:
        del subdirList[0]

Answer: Here's my version of the recursive file walker based on the answer of Matheus Araujo, that can take optional exclusion list arguments, which happens to be very helpful when dealing with tree copies where some directores / files / file extensions aren't wanted.
import os

def get_files_recursive(root, d_exclude_list=[], f_exclude_list=[], ext_exclude_list=[], primary_root=None):
"""
Walk a path to recursively find files
Modified version of https://stackoverflow.com/a/24771959/2635443 that includes exclusion lists
:param root: path to explore
:param d_exclude_list: list of root relative directories paths to exclude
:param f_exclude_list: list of filenames without paths to exclude
:param ext_exclude_list: list of file extensions to exclude, ex: ['.log', '.bak']
:param primary_root: Only used for internal recursive exclusion lookup, don't pass an argument here
:return: list of files found in path
"""

# Make sure we use a valid os separator for exclusion lists, this is done recursively :(
d_exclude_list = [os.path.normpath(d) for d in d_exclude_list]

files = [os.path.join(root, f) for f in os.listdir(root) if os.path.isfile(os.path.join(root, f))
         and f not in f_exclude_list and os.path.splitext(f)[1] not in ext_exclude_list]
dirs = [d for d in os.listdir(root) if os.path.isdir(os.path.join(root, d))]
for d in dirs:
    p_root = os.path.join(primary_root, d) if primary_root is not None else d
    if p_root not in d_exclude_list:
        files_in_d = get_files_recursive(os.path.join(root, d), d_exclude_list, f_exclude_list, ext_exclude_list, primary_root=p_root)
        if files_in_d:
            for f in files_in_d:
                files.append(os.path.join(root, f))
return files

Answer: This is an update of my last version that accepts glob style wildcards in exclude lists.
The function basically walks into every subdirectory of the given path and returns the list of all files from those directories, as relative paths.
Function works like Matheus' answer, and may use optional exclude lists.
Eg:
files = get_files_recursive('/some/path')
files = get_files_recursive('/some/path', f_exclude_list=['.cache', '*.bak'])
files = get_files_recursive('C:\\Users', d_exclude_list=['AppData', 'Temp'])
files = get_files_recursive('/some/path', ext_exclude_list=['.log', '.db'])

Hope this helps someone like the initial answer of this thread helped me :)
import os
from fnmatch import fnmatch

def glob_path_match(path, pattern_list):
    """
    Checks if path is in a list of glob style wildcard paths
    :param path: path of file / directory
    :param pattern_list: list of wildcard patterns to check for
    :return: Boolean
    """
    return any(fnmatch(path, pattern) for pattern in pattern_list)

def get_files_recursive(root, d_exclude_list=None, f_exclude_list=None, ext_exclude_list=None, primary_root=None):
    """
    Walk a path to recursively find files
    Modified version of https://stackoverflow.com/a/24771959/2635443 that includes exclusion lists
    and accepts glob style wildcards on files and directories
    :param root: path to explore
    :param d_exclude_list: list of root relative directories paths to exclude
    :param f_exclude_list: list of filenames without paths to exclude
    :param ext_exclude_list: list of file extensions to exclude, ex: ['.log', '.bak']
    :param primary_root: Only used for internal recursive exclusion lookup, don't pass an argument here
    :return: list of files found in path
    """

    if d_exclude_list is not None:
        # Make sure we use a valid os separator for exclusion lists, this is done recursively :(
        d_exclude_list = [os.path.normpath(d) for d in d_exclude_list]
    else:
        d_exclude_list = []
    if f_exclude_list is None:
        f_exclude_list = []
    if ext_exclude_list is None:
        ext_exclude_list = []

    files = [os.path.join(root, f) for f in os.listdir(root) if os.path.isfile(os.path.join(root, f))
             and not glob_path_match(f, f_exclude_list) and os.path.splitext(f)[1] not in ext_exclude_list]
    dirs = [d for d in os.listdir(root) if os.path.isdir(os.path.join(root, d))]
    for d in dirs:
        p_root = os.path.join(primary_root, d) if primary_root is not None else d
        if not glob_path_match(p_root, d_exclude_list):
            files_in_d = get_files_recursive(os.path.join(root, d), d_exclude_list, f_exclude_list, ext_exclude_list,
                                             primary_root=p_root)
            if files_in_d:
                for f in files_in_d:
                    files.append(os.path.join(root, f))
    return files


Does Two-Weapon Fighting help Flurry of Blows?

Question: The Two-Weapon Fighting feat by base definition gives bonuses to negate the usual penalties of dual wielding.  Does this have any effect on a monk's Flurry of Blows ability, where the penalties disappear completely after two levels?
Answer: Two-Weapon Fighting does not reduce the penalties from Flurry of Blows, since Flurry is not the same thing as fighting with two weapons:

Two-Weapon Fighting: If you wield a second weapon in your off hand, you can get one extra attack per round with that weapon.
Unarmed Strike: A monk's attacks may be with either fist interchangeably or even from elbows, knees, and feet. This means that a monk may even make unarmed strikes with her hands full. There is no such thing as an off-hand attack for a monk striking unarmed. A monk may thus apply her full Strength bonus on damage rolls for all her unarmed strikes.
Flurry of Blows: When unarmored, a monk may strike with a flurry of blows at the expense of accuracy. When doing so, she may make one extra attack in a round at her highest base attack bonus, but this attack takes a -2 penalty, as does each other attack made that round.

The only thing Two-Weapon Fighting and Flurry have in common are that they grant an extra attack. The Two-Weapon Fighting feat only reduces the -6/-10 penalties for fighting with a second weapon in your off-hand, but even with flurry a monk using unarmed strikes has no off-hand. All his unarmed strikes are considered on-hand.
Interestingly, according to the D&D 3.5 FAQ, a monk can use Two-Weapon Fighting to make an extra off-hand attack, even on top of Flurry, but the penalties from Two-Weapon Fighting stack the penalties from Flurry:

Can a monk fight with two weapons? Can she combine
  a two-weapon attack with a flurry of blows? What are her
  penalties on attack rolls?
A monk can fight with two weapons just like any other
  character, but she must accept the normal penalties on her
  attack rolls to do so. She can use an unarmed strike as an offhand weapon. She can even combine two-weapon fighting with
  a flurry of blows to gain an extra attack with her off hand (but
  remember that she can use only unarmed strikes or special
  monk weapons as part of the flurry). The penalties for twoweapon fighting stack with the penalties for flurry of blows.

In other words, a first-level monk with the Two-Weapon Fighting feat has four options: make one attack at +0, Flurry for two attacks at -2/-2, TWF for two attacks at -2/-2 (but one of those is off-hand and applies only half Strength modifier), or combine Flurry and TWF for three attacks at -4/-4/-4 with one of those an off-hand attack. You can't use the Two-Weapon Fighting feat on its own to reduce Flurry's penalties.
Comment: This answer is sort of confusing.  Your answer sounds like it's saying "Monks can't use two-weapon fighting", but then you provide an FAQ quote that says unequivocally "monks can use two-weapon fighting".  Could you try to clarify this answer a bit better?
Comment: @DuckTapeal Edited to clarify: A monk _can_ take Two-Weapon Fighting, but it won't reduce the penalties on his Flurry.
Answer: No, no feat of the TWF tree helps negate the bonuses from monks flurry of blows. However, remember that Two Weapon Fighting can be used together with the flurry, although one has to be careful not to stack too many penalties.
Also, saying that the TWF feat gives bonuses is a rather liberal interpretation:
Two-Weapon Fighting [General]
Your penalties on attack rolls for fighting with two weapons are reduced. The penalty for your primary hand lessens by 2 and the one for your off hand lessens by 6. See the Two-Weapon Fighting special attack.
This doesn't in any way suggest bonuses that counterweight the penalties -- it simply reduces the penalties, "modifying the penalty rules", you could say, in your case.
Comment: @filkin http://www.wizards.com/default.asp?x=dnd/rg/20070403a  The flurry of blows here states **a monk using the full attack action can make one extra attack when attacking without a weapon or when using a special monk weapon**. It does not say flurry replaces a full-round attack, thus it is stack-able with TWF
Comment: @ColinD The FAQ isn't a part of the rules, and unfortunately is frequently wrong (though not here). It would be more relevant to refer to the rule in Flurry of Blows itself, which states that not only does a Flurry not replace a Full Attack, but that making a Full Attack is *necessary* to use Flurry of Blows.
Comment: @dlras2 There is nothing to suggest otherwise. TWF says add extra attack, Flurry says add extra attack, but there is nothing to stop them applying at the same time. A 1st lvl monk can strike 3 times a round, albeit at a -4/-4/-4 routine.
Comment: Can you back up your claim that Two Weapon Fighting can be used with Flurry of Blows? I would have thought otherwise.


Is there any way to interface 4x4 matrix keypad using 2 IO lines

Question: I have two IO lines and wants to interface 4x4 matrix keypad. Using MUX ICs I need 4 IO lines. Is there any method to achieve it using 2 IOs?
Answer: I have done it by using an I2C GPIO expander chip. I used the Microchip MCP23017, but there are others out there as well.
Comment: This would be the most straightfoward solution.  These particular chips come in 8 bit and 16 bit versions, and the pins can be configured individually as inputs or outputs so you can easily scan an entire 4x4 keypad with one chip.
Answer: A serial interface could do the trick. An I2C-like interface could operate on only two I/O lines (Data and Clock). Utilizing shift registers would be possible using three I/O lines (Data-in, Data-out and Clock) in an SPI like mode (assuming to skip any chip select lines).
Comment: How would you do that without second shift register for column excitation?
Comment: Sorry, I was mistaken. Obviously you'd need three line data out, data in (MOSI/MISO) and clock in an SPI like mode. Two or more shift regs could be cascaded to do the column selection. However I2C should provide a two IO solution.
Comment: I thought about it more and it is actually possible with two shift registers. One for column excitation has data_in connected to IO pin directly, the other one for row read has data_out is connected to the same IO through a series resistor. At leading edge of clk the pin is set as output, otherwise it is an input.
Answer: Use one GPIO as an Output and toggle it while timing the rise and fall times of the other GPIO set to input.  Choose resistor values to separate the timings for each key as much as possible while accounting for component variations and uController logic input threshold variation with temperature.


How to visualize the ECM?

Question: Specifically, I'd like to look at changes in HA (hyaluronic acid) production. Most often you only see people staining the cell surface or removing cells from culture for fixation and then imaging. Does anyone know how to analyze the ECM (extracellular matrix) and proteoglycans that surround a cell if you're looking to see if a condition may be changing the way a cell remodels it's ECM? Is it even possible with some fluorescent tags?
Comment: Can you define some of those acronyms? I'm assuming ECM is extracellular matrix, and HA is hyalauronic acid, but I could be wrong, and I could have spelled hyalauronic wrong.
Comment: Yes, sorry---ECM = extracellular matrix, HA = hyaluronic acid.  I know that a typical hematoxylin and eosin stain (H & E) will pick up things that are negatively charged, such as HA, but how can you fix cells without disrupting the ECM?  Also, I was wondering if methods exist to analyze cell ECM production via fluorescence or some other method that utilizes a probe that I could observe with a microscope.
Comment: Interesting question. Afaik ECM is much more than just HA, it contains chondoitin and other glucoseamine related stuff as well. Some of them is capable to regulate immune reaction, for example chondroitin-sulfate can reduce TNFa production and so inflammation by arthritis.
Comment: http://www.naturebiotech.com.tw/Fluorescent%20ECM%20Proteins.pdf
I guess this study uses the same stuff: http://figshare.com/articles/_Degradation_of_fluorescent_ECM_networks_by_SPARC_/404676 it is probably possible, but I never worked with ECM.
Comment: There have got to be some antibodies against ECM components you could use for immunohistochemical labeling.
Answer: Different components of the ECM can be stained differently but since you asked about hyaluronic acid (HA) I'll limit my answer to its staining.
See this paper. They use Hyaluran Binding Protein (HABP) as a specific probe for HA.

Because HA has a very simple, conserved composition and is
  ubiquitously expressed in all animals that have a developed immune
  response, HA is not immunogenic. Therefore, there are no antibodies
  that specifically recognize HA, and traditional immunohistochemical
  methods of detection of HA are not possible. Fortunately, a very
  specific and tightly binding protein, the hyaluronan binding protein
  (HABP), which is composed of the HA binding domain with the link
  module from aggrecan, was isolated (Hascall and Heinegård 1974;
  Tengblad 1979) and adapted as an HA probe (Ripellino et al. 1985).
  HABP is now widely employed for specific detection of HA.

Biotin tagged HABP can be used for IHC based visualization procedures.
Answer: The book "Basic Histology" by Junqueira and Carneiro acknowledge the problem in histologic fixation of ground substance. They recommend freeze drying in liquid nitrogen and  then removing water by high vacuum at a temperature of -30 celcius, which will cause sublimation (ice-->vapor). Then fixing the sample with a nonpolar solvent. Afterwards you can use stains like PAS technic.
I've never done this, I'm just copying from the book. If you already happen to have liquid nitrogen, high vacuum, and PAS in your lab this might be cheaper than HABP.

How to visualize the ECM?


Inverse of a matrix in a Path Integral

Question: Good morning! I can't make sense of an inverse of a matrix appearing in a calculation for a Wiener Path Integral. In discretized form:
$$\int \prod_{i=1}^N \frac{dx_i}{\sqrt{\pi \epsilon}} e^{-\frac{1}{\epsilon} \sum_{i=1}^N \left( x_i-x_{i-1} \right)^2-\sum_{i=1}^N p_i x^2_i} \delta(x_N-x)$$ where $p_j=p(j\epsilon)$ and $p(\tau)$ is a real function. Now i wrote the delta function as an integral and in the end I have a gaussian integral where i need the determinant of the matrix
$$
a = \begin{bmatrix}
a_1       & -\frac{1}{\epsilon} & 0 & \dots & \dots & 0 \\
-\frac{1}{\epsilon}  & a_2 & \frac{-1}{\epsilon} & \dots & \dots & 0 \\
0 & -\frac{1}{\epsilon} & a_3 & -\frac{1}{\epsilon} & \cdots & 0 \\
\vdots & \dots & -\frac{1}{\epsilon} & \dots & \dots & \vdots \\
\vdots & & & & & -\frac{1}{\epsilon} \\
0 & \dots & \dots & 0 & -\frac{1}{\epsilon} & a_N
\end{bmatrix}$$
where $a_i=p_i \epsilon + \frac{2}{\epsilon} \quad j \neq N$ and $a_N=p_N \epsilon + \frac{1}{\epsilon}$. I made sense of the determinant thanks to the Gelfand Yaglom method but I have no idea how to compute the inverse matrix element $a^{-1}_{N,N}$. Any clue?
Comment: Related: https://physics.stackexchange.com/q/328439/2451
Comment: Quick hint : Matrix elements of inverse matrix, i.e, $\left[a_{}^{-1}\right]_{ij}^{}$ is related to the determinant of the $\left(N-1\right)\times\left(N-1\right)$, obtained from matrix $a$ by removing element of $i_{}^{th}$ column and  $j_{}^{th}$ row.
Answer: It's a tridagonal matrix, so the inverse is found as the Green function of the associated three-term recurrence relation. There is no closed-form solution for general $p_i$, but  a detailed description of the related math is in the excercises starting on page 86 of my lecture notes at https://courses.physics.illinois.edu/phys508/fa2018/amaster.pdf.
Note in particular problem 2.16. This writes the matrix element that you want as a continued fraction, and also comments on the  connection to Haydock recusion.

Inverse of a matrix in a Path Integral


Delphi - loging all HTTP request

Question: I need loging all  HTTP request (from any application).
I have Delphi 7.0.
Anybody know how do that?
Answer: I looked into whether the Indy components could do this but found an old newsgroup response from Remy Lebeau that said:

If...you want to look at the traffic
  that other applications are
  generating, then no, you cannot use
  Indy for that. That is outside the
  scope of what Indy is designed for.
  You would have to write your own NDIS
  driver for that kind of capturing.  Or
  use a third-party sniffer API, such as
  WinPCap.
Comment: There is even a Delphi wrapper for WinPcap: http://www.magsys.co.uk/delphi/magmonsock.asp
Answer: What about WireShark?
There is also a product called Fiddler.  I have found this extremely useful to track down exactly what the Indy components are sending/receiving.  The one drawback is you have to utilize a proxy.  This isn't a problem with Indy components and browsers such as Firefox.  But if you need to capture for all applications you would need to be able to set a proxy for those apps.
Comment: WireShark is successor of Ethereal, and uses WinPcap. So these answers all point to the same...
Answer: if you want to go deeper and want pure delphi thing, there is winsock logger program floating around, google might help you ( it hooks winsock apis though).
Answer: Do you have to write a Delphi app to do it?  Could you use an application like ethereal?

Delphi - loging all HTTP request


Pruning October Glory Maple

Question: How to prune a October Glory Maple  to have shorter hight and wider width.
Comment: Sounds like you've planted the wrong tree if you wanted that kind of shape over time....
Comment: Pictures please!
Answer: You do not want to prune the leader at all.  You will get a bush on a stick.  this is a wonderful, glorious tree.  Why do you need to keep it short?
The only way this tree should be pruned is by thinning.  Thinning versus heading.  Heading is what we do to hedges and shrubs.  Makes them thicker.  Thinning preserves the structure of the tree, the unique branching pattern of a species of tree.  Thinning allows for air flow through the tree so that a big wind won't bring it down.  Air flow also helps with insects and disease.  Thinning displays the beauty of your tree's trunk, branching and definitely aids energy.
When we pruners prune a tree we are doing what the tree would do over time anyway.  We get rid of branches that hold photosynthetic factories (leaves and chlorophyll) where those factories will never be able to get enough light to do the tree any good.
We prune branches that somehow got turned around (nursery) and want to grow towards the center of the tree not the outside where the light can be found and always will find other branches to rub against enhancing chances of disease.
Branches from the main trunk that are considerably different in diameter tell us that that branch is not working well for the tree and the tree is already working on getting rid of that branch.
We decide as pruners which of several 'leaders' to chose to be THE leader.  Not all trees get extra leaders, we need to chose one.  To cut off a leader is like cutting off the head of your tree.  That tree will never achieve its natural form.  Did you know that some people can ID a tree just by it's winter branching?  Its overall form?
Now, there is a way to Pollard a tree.  Ugh.  Lots of work to do correctly.  Akin to pruning a Bonsai.  They do this with fruit trees so that they stay short enough for picking the fruit.  This type of pruning is up there in skill within  the professional pruner world.
pollarding technique
Comment: @Sandy, this is a wonderful tree as it is. Please try to not prune it.
Comment: @ Stormy - I agree with everything you wrote, which is why I was always exasperated by the trend in the nursery trade to cut the leader of every tree sold. WE wouldn't cut the leader, of course - they came that way from Bailey's and Bachmann's, with a new leader tied to the remains of the old. And then of course three more leader-wanna-bes often developed. Argh. Of  course, they did this to make the tree fuller and more "saleable", but every branch on those little trees was going to get cut off anyway as the tree aged.. And then the buyers wouldn't cut the old leader off, either...
Comment: I have seen this trend as well, Jurp.  An educated clientele would stop this crazy marketing scam.  Healthy plants as well as healthy people do not make money.

Pruning October Glory Maple


Why didn't Vader do anything since he knew that he was becoming redundant?

Question: Inspired by this question. This answer pointed that Vader expected that he would be betrayed by Palpatine. Since Vader knew that he was becoming redundant, why didn't he do anything about it?
Comment: Don't get too choked up about the rule of two, if a pair gets split by a third, a fourth could be found too.  How else could they expand ranks
Answer: Vader spent a fair amount of effort trying to turn Luke to his side. If he succeeded Luke would have sided with Vader when Darth Sidious makes them fight over who will be his apprentice. Together, they would murder the Emperor and take his place, "ruling the galaxy as father and son".
That seems like a reasonable plan. Both Vader and Luke are capable warriors and this would be a time when they would both be present and Sidious would be relatively unlikely to have additional guards because this was private Sith business. Had Luke accepted the initial offer, Vader would also have had plenty of time to train him to become a better duelist which would have increased their odds of success.
Comment: In addition to this I would point out Anakin's hubris in Episode II where he expresses to Padme his clear desire and belief that he alone could make better decisions and lead the Republic/Empire by forcing everyone to acquiesce to his ideas about how they all should live. The premise of the question is that Vader was working for Palpatine to survive or because he had to, and not because he chose to or because he liked Palaptines ideas, in order to get one step closer to his ideas for a perfect galaxy and how he would bring them about.
Answer: Spoilers for Marvel's Star Wars: Darth Vader below.
In the canon comic series Darth Vader, we see Vader take on and kill various rivals for his apprenticeship.
Tulon Voidgazer:

Aiolin Astarte:

Morit Astarte:

Karbin:

As Forrest Venable discusses in his answer, he also went to considerable lengths to convince Luke to join him against Palpatine.

Vader: There is no escape! Don't make me destroy you. Luke, you do not yet realize your importance. You've only begun to discover your power! Join me, and I will complete your training! With our combined strength, we can end this destructive conflict, and bring order to the galaxy.
Comment: What about Cylo himself?
Comment: @Adamant He was the main scientist of the replacement apprentice initiative, but I don't think he himself was considered a rival.
Comment: Yes, but surely killing him was also "doing something."


Copy a table from excel to word, keeping the word table formatting

Question: I have a word document with a table designed to be printed to make name cards - rows and columns are different sizes and the font size varies also. I want to copy various tables with students' names and numbers into the word table, preserving the word (target) formatting for cell size, font size etc. However whenever I paste a table from excel, it resets to the original font formatting and changes column widths etc.
I have tried all the different types of paste, and also the "Paste from other programs" setting, but none of them allow me to keep the word table formatting and just change the text values. Using Office standard 2010.
Answer: Have you tried these two paste options: "Keep Source Formatting" and "Link & Keep Source Formatting"?

If pasting can't keep the table's formatting, you can try to embed the Excel workbook as object into the document. You can insert an Excel Spreedsheet in the document and then paste the table. See more:Insert an Excel Worksheet into a Word Doc
Answer: In order to get your intended result, you can copy and paste formatting from a duplicate of the table. (Use Ctrl+Shift+V to paste formatting only)
If you don't know what I mean, try these steps

Create a duplicate of the word document.
Copy and paste from excel to your intended word document. As you were suggesting, the formatting will be messed up.
Copy (Ctrl+C) the table with the correct formatting from the duplicate document.
Highlight over the table in the intended document. Press Ctrl+Shift+V to paste the formatting alone.

The result should be the new data with the original formatting.


Why isn't my WTArchitectView being released under Obj-C + ARC?

Question: The second time I try to present a view controller with a WRArchitectView it fails with a large error stating that a second architect view is attempting to be allocated before the first has been deallocated. I've checked up an down, have ARC enabled, the view controller is completely deallocated. I even have a branch which is working with an identical view controller, so what could be retaining the WTArchitectView?
Answer: I was writing JSON in a Swift Utility class while the view controller was instantiated which wasn't being handled well. I was getting an error along the lines of *** WebKit discarded an uncaught exception. Somehow, parsing malformed JSON with NSJSONSerialization and not handling the exception halts some Wikitude internals, which means something internal was retaining the view. Fixing my JSON allowed Wikitude to dealloc properly.