The Achilles Paradox

Question: I know that it is a very old question but still I don't find any satisfactory solution for Achilles Paradox. Please explain me the fundamentals of Achilles paradox in terms of stage wise distance covered. Note that it is easily solvable in terms of time, but if you start analysing this event in terms of time, then there is not at all any paradox. So please explain in terms of stage wise distances only.
Comment: More on Zeno's paradox: http://physics.stackexchange.com/search?q=is%3Aq+zeno%27s and http://en.wikipedia.org/wiki/Zeno%27s_paradoxes
Comment: I'm not sure I understand the question...
Comment: What is a "stage-wise distance"?
Comment: @Dvji The figures in the wiki-link by QMechanic explains more than most extensive explanations would.
Comment: Watch the video [Achilles and the Tortoise](https://www.youtube.com/watch?v=skM37PcZmWE).
Answer: This is quite straightforward as long as you break it up into steps.
Let the tortoise travel with speed $v_t$ and Archilles with speed $v$. We split up the steps Archilles takes as
\begin{equation}
d_A = d_0 + d _1 + ...
\end{equation}
where $d_i $ is the distance travelled in a single step. The initial distance $d_0 $ is then just the initial separation between Archilles and the tortoise. We denote $\Delta t _i $ as the time of step $i $. The distance $d_1 $ is just how far the tortoise managed to step while Archilles was catching up to the tortoise's initial position. It is given by
\begin{equation}
d_1=v_t \Delta t_1 =v_t \frac{d_0}{v}
\end{equation}
Similarly, the distance $d_2 $ is given by
\begin{equation}
d_2=v_t \Delta t_2 = v_t \frac{d_1 }{v} = \left(\frac{v_t}{v} \right)^2 d_0
\end{equation}
Its easy to see that this trend will continue:
\begin{align}
d_A &= d_0 + \frac{v _t }{v} d_0 +\left(\frac{v_t}{v} \right)^2 d_0 + ... \\
&= d _0 \left( 1 + \frac{ v _t }{ v} + \left( \frac{ v _t }{ v } \right) ^2 + ...\right)
\end{align}
In the brackets we have a geometric series. If $v_t\le v$ then,
\begin{align}
d _ A & = d_0\frac{1}{ 1 - v _t / v }
\end{align}
This is finite (and hence Archilles can catch up with the tortoise) as long as $v_t <v $. The apparent paradox is that Archilles needs to take an infinite number of steps. However, having to take an infinite number of steps doesn't mean it would take an infinite distance (or infinite time). An infinite series can either converge, as this one does, or diverge.

I think it's also interesting to solve this problem the simple way, avoiding splitting it up into steps. For Archilles and the tortoise representatively we have,
\begin{equation}
d_A=\frac{v}{t}\, , \quad d_t= \frac{v_t}{t}+d_0
\end{equation}
Setting $d_A = d_t $ and solving these equations gives,
\begin{equation}
d_A=d_0 \frac{1}{1-v_t/v}
\end{equation}
as required.
Comment: *Mathematicians* can make arbitrary definitions (and seem to have a lot of fun doing it), but physicists are constrained to use the ones that generate results in a agreement with the way the world works. (I.e. the second panel of [*Every Major's Terrible*](http://xkcd.com/1052/).)
Comment: This answer doesn't convince me. $1+\frac{1}{2}+\frac{1}{4}+...$ doesn't have to be equal to $2$, because the proof uses that if a number is infinitely near another number, they are the same (archimedian property). If you use other axioms, you will get different results.
Comment: No, but solving Zeno's paradox is basically trying to prove the Archimedian property, which is a mathematical axiom. Since it's an axiom, you can't prove it. In p-adic numbers, $1+2+4+..=-1$, which of course, would give you incorrect predictions.
Comment: With a little tweaking this argument can be used to _prove_ that the series converges: you use your second expression: "speed difference gives time until they meet", then conclude that "ergo, this infinite series must converge to this number".
Comment: @jinawee, I'm confused. Are disputing the well-known result of a geometric series:http://en.wikipedia.org/wiki/Geometric_series ?
Comment: As I said, we are assuming $v_t/v <1 $ and hence a convergent series... I'm not sure what is the issue here.
Comment: The issue is the definition of convergence, after all, you can make arbitrary definitions.
Answer: I don't know if I'll answer what you want, but is impossible not to talk about time; the point of the paradox is that both the Achilles will never reach the turtle, right? now, in the way the paradox is stated, it is said that at each "step" the turtle advances "x" space and Achilles will advance only a fraction of "x" space. The fallacy of the paradox lies in that the statement displaces the concept of time from real time to "step-time".
So, Achilles in deed will reach the turtle only in infinity, but this doesn't happen in the real time, just in the mathematical steps, which are increasingly small. The place where they will meet can be solved as the result of a geometric series (see answer by JeffDror).
Answer: It's just a paradox, it's using weakness of human logic about infinite calculation in limited time. It convinces you think that you have to cover  half of the distance between Achilles and turtle every passing instant of time. If you think deeper, you will notice that most of the concepts such as time, motion, distance, instant, speed lose meaning, their definitions are relative to each other indeed.
Answer: Not Newtonian, but still relevant:
Zeno's Paradox is based on the premise that the distance between Achilles and the tortoise is infinitely divisible.  In theory, the Planck length is a lower limit on measurable distances.  If this is true, eventually Achilles must move more than half the distance to an arbitrary point between himself and the tortoise if he moves at all.
Comment: This isn't the resolution to the paradox.  There is no evidence that time or length is quantized.
Comment: True.  I've edited my post to reflect this better.  The other answers thus far have all been purely mathematical arguments, so I thought it would be helpful to the discussion to offer one based on physical principles.  To my understanding (which is limited; I only have a B.Sc.) distances shorter than the Planck length have no physical meaning anyway.

The Achilles Paradox


Sybase Unwired Platform Hybrid Web Container IPHONE BLACKBERRY

Question: I am developing a application in Sybase Unwired Platform ,Hybrid Web Container. When I deploy it on Android it is working fine but when I deploy it on Iphone or blackberry I can see the menu items like back,next displayed on menubar and some on toolbar as it is in Iphone native application and the buttons on the screens are not working. I think its because of JQuery but is there any workaround to remove this menubar and toolbar and make it run properly.Thanks in advance.
Answer: I haven't tried it yet, but if you are in the last SUP version, it's supposed that you can have buttons on the screen to call SUP requests and operations without the need to add them as menuItems.
The problem with menu items is that they work different in each platform, and it's not recommended to use them anymore (even google said that), and it makes the HTML5 app less multi platform.
In my SUP apps, I hid the menuItem dynamically after the workflow initialization, and created a custom html button (using Custom.js) that calls the menuItem javascript function.


My youngs pale ipa came out flat and quite dark

Question: Any insight is really appreciated as I'm quite confused. There was plenty of bubbling and fermentation appeared fine but when i opened the lid it came out very dark and flat. I know carbonation might get better after a few weeks in the bottles but I'm worried why it came out so pale. I have tasted one and it seems fine, just like a dark lager which is a shame.
Comment: would you mind including your brew day process you used on this kit, and include a recipe?

i suspect either it was boiled longer then needed, or it oxidized at some point.
Comment: Do you know if it was dark going into the bucket?
Comment: You mentioned that when you opened the lid to your fermenter you noticed that it was "very dark and flat". So I can't speak to the darkness as I don't know what it was like when it went in to the fermenter but unless you fermented under pressure (with a spunding valve) and kept it at the needed pressure for the temperature of your beer it will always be flat. I may be missing it entirely, but with the little information you've given us there is really no way to tell what your issues might be. Please give us some more information and perhaps we can help.  Good luck & cheers!
Answer: There's two issues at play here, the first is carbonation, the second is colour.
Beer always tends to look a bit darker in the fermenter, simply because there's so much of it compared to a glass.  Even light coloured batches can seem overly-dark while still fermenting.  Obviously here it's quite dark in the glass too.
You don't specify how you made this beer.  So speaking generally: Extra colour comes from maillard reactions during the boil.  If you boil for longer, this definitely occurs.  One common mistake for new extract brewers is to not correctly mix-up the malt added to water before boiling, so there's a big pool of malt on the bottom of the pot.  This can brown and scorch.
If this is an all-grain batch - was the batch put through the mill before yours a dark beer?  Maybe it's a little extra dark malt getting into your grist by mistake?
Carbonation problems can come from a range of minor issues, here's some of the more common ones:

Did you add enough priming sugar?
Were the bottles left long enough for the carbonation to occur?
Were the bottles warm enough while carbonating for the yeast to work? (> 16C)
If you bulk primed, was the sugar/dextrose/... evenly mixed through the beer?
Did you wait long enough for the yeast to work before opening?
Was the cap on correctly?

The higher gravity the beer, generally carbonation takes longer, because the yeast has a tough time with the extra ethanol.  If it's cold, the yeast works more slowly.
Do any of these sound like what might have happened?


is there an illustrator "components | block"

Question: Is there any way to create some sort of component or a "smart" group in illustrator? One that when duplicated can be cahanged and all its other copies will change as well?
Answer: Yes.
Look at Symbols in Illustrator

A symbol is an art object that you can reuse in a document. For example, if you create a symbol from a flower, you can then add instances of that symbol multiple times to your artwork without actually adding the complex art multiple times. Each symbol instance is linked to the symbol in the Symbols panel or to a symbols library. Using symbols can save you time and greatly reduce file size.
Symbols also provide excellent support for SWF and SVG export. When you export to Flash, you can set the symbol type to MovieClip. Once in Flash, you can choose another type if necessary. You can also specify 9‑slice scaling in Illustrator so that the symbols scale appropriately when used for user interface components.
Comment: A little additional info: The basic instructions are to drag your artwork "block" to the symbols panel (this creates the symbol), and then drag it out of the panel or copy/paste it for all additional instances of the symbol. To edit all instances, just double-click any of the instances of the symbol.


MsgBox with multiple 'past due' items

Question: I am building an LOP (List of Open Points) in Excel 2016 for a manufacturing project. Each action item will have a 'target date' for completion. My intention is every time the document is opened, a macro will run that will scan the document and every item that is past due, comparing the 'target date' to today's date, will trigger a MsgBox popup that states "There are past due items in the following row(s): X, Y, and Z." I have ran into two issues that I'm trying to resolve:

The range of cells for the 'target date' column (J) will not yield a result. It will display the MsgBox if I enter a single cell. For example, if I only put the range as J4, and J4 is past due, the MsgBox will display as intended. But, if I set the range as "J4:J999" with multiple entries past due in the J column and run it, it does nothing, not even give me an error.
I cannot figure out how to integrate the date comparison code into a multiple-output MsgBox code. Maybe once the range issue is resolved, it will help.

Below is the code I'm using to identify the past due cells in the J column and yield the MsgBox:
Private Sub Workbook_Open()
Dim cl As Range
Set cl = ThisWorkbook.Sheets("OPEN ITEMS").Range("J4:J999")
If IsDate(cl) Then
    If Now >= cl Then
        MsgBox "There are past due items in the following row(s):" & "" & cl.Address, vbExclamation, "ACTION REQUIRED"
    End If
End If
End Sub

Any help would be greatly appreciated.
Comment: You need a loop. Using `IsDate` on a multi-cell `Range` will always return `False`.
Comment: Thanks for the reply BigBen, I will give that a shot.
Answer: Try this code:
EDIT: As per BigBen's comment, added control if no rows met the condition. (Thnx @BigBen)
Private Sub Workbook_Open()
    Dim evalRange As Range
    Dim evalCell As Range
    Dim resultRows As String

    Set evalRange = ThisWorkbook.Sheets("OPEN ITEMS").Range("J4:J999")
    For Each evalCell In evalRange
        If IsDate(evalCell) Then
            If Now >= evalCell Then
                resultRows = resultRows & evalCell.Row & ","
            End If
        End If
    Next evalCell

    If resultRows <> vbNullString Then
        ' Remove last comma
        resultRows = Left$(resultRows, Len(resultRows) - 1)

        MsgBox "There are past due items in the following row(s):" & resultRows, vbExclamation, "ACTION REQUIRED"

    End If

End Sub

Comment: Maybe add a check that `resultRows` is not a blank string after the loop, but otherwise a good approach. Presumably the `MsgBox` should only occur if there are in fact past due items.
Comment: Works perfect. Thank you all for your help!
Answer: One way is to create a loop over an array (probably prefered) but let me show you a way without any iteration:
Private Sub Workbook_Open()

Dim lr As Long
Dim arr As Variant
Dim rng As Range

With ThisWorkbook.Sheets("OPEN ITEMS")

    'Get last used row and create a range object
    lr = .Cells(.Rows.Count, 10).End(xlUp).Row
    Set rng = .Range("J4:J" & lr)

    'Get data into array
    arr = Filter(.Evaluate("TRANSPOSE(IF(" & rng.Address & ">=NOW(),ROW(" & rng.Address & "),""|""))"), "|", False)

    'Use array in any message you like
    MsgBox "There are past due items in the following row(s): " & Join(arr, ",")

End With

End Sub

Allthough this bypasses the need for any iteration, it does however make use of an array formula which on large data does slow things down (a 1000 rows isn't that much though).

Note: Keep in mind that the max amount of characters in a Msgbox prompt is approximately 1024.

I just tried this code on about 1000 lines all past due data, and allthough it was still fast, about half of them won't show in the messagebox!

MsgBox with multiple 'past due' items


have any idea how can create or import product in magento-2?

Question: I want to be a insert or import product in magento-2 ? Please if you have any thought share with me.
Thanks
Comment: Do you have any problem with this functionality?
Answer: You can find sample of csv file for import product on System -> Import -> Choose Products and "Download Sample CSV file". Detailed description of each column in our The Complete Guide to Magento 2 Product Import

Please note that since Magento 2 still in development, some bugs on import process still exist, but in general it works good with all new out of box features like import custom options, images from external URL etc.
Sample CSV files for Magento 2 - https://github.com/firebearstudio/magento2-import-export-sample-files
Answer: Importing product with images in Magento 2 :
Add new Product if no existing product is there in existing Magento store.
Go to System > Data Transfer > Export
Select entity type as product and click on on continue button that is in the bottom of the page. Once you click on continue button you can download the csv file of exported products . Use the exported sheet for reference to fill the values and then fill yours values accordingly , fill image name with file extension as .jpg or .png etc as mentioned in this screenshot:

then go to var folder create one folder having name ( import ) and place the image having same name as mentioned in the import csv file and then
Go to System > Data Transfer > Import
and select entity type as an product select import behavior as per yours need and then browse for file from Select File to Import browse option after this enter the path of import folder in our case it  is var/import in the  Images File Directory text box as mentioned in the following screenshot :

Then click on check data button on top right corner. If you did everything correct you will get this screen

Click import button and then do reindexing using CMD:
php bin/magento indexer:reindex

and then flush the cache:
php bin/magento cache:flush

and then check yours frontend it will show imported products with images.
Comment: any thoughts on this question - https://magento.stackexchange.com/questions/337077/magento-2-prevent-stopping-import-execution-magento-2 ?
Answer: Uploading of a single product in Magento 2 is not an issue, but it would take more time to upload the product in bulk by this method. Through default Magento 2 import export method, you can do it for bulk by saving your precious time.
Let's go through default Magento 2 import method

Login to your Magento 2 admin panel and navigate to System > Import

In the Import section select what kind of data you want to import through Entity Type
Through Import Behavior you can define the action of your imported file whether to you want to Add/Update the product or Replace and Delete the selected import products
During the import, if an error occurs you can select to Stop on Error or Skip error entries of your Magento 2 import export file
In Allowed Errors Count you can define no of errors on which Magento import export process would be halted
Through Field separator, you will define symbol through which system would separate the fields from Magento 2 import export file
In Multiple value separator, you will define symbol through which system would separate the values from your Imported file
In Select File to Import choose the file from which you want to import data

Suggestion: The imported CSV file should be in UTF-8 format, you can create your own such format file but I would recommend you to Download Sample File and make necessary changes in the downloaded file or make your own such file.
Comment: any thoughts on this question - https://magento.stackexchange.com/questions/337077/magento-2-prevent-stopping-import-execution-magento-2


Are there any exceptions to Newton's laws?

Question: So I am studying the laws of Newton and I'm wondering, are there any deficiencies related to the laws?  I mean, somewhere where I can't use them or anything?
Answer: For examples of where the laws of Newton are no longer sufficient to describe reality, see the wikipage here. But we don't have to go to extremes like near-$c$ velocities or strong gravitational fields to see that there are some situations where the laws of Newton seem to fail.
Consider an airplane taking off. You can feel yourself being pushed back into your seat, so you are experiencing a force (that is not gravity). However, you remain at rest w.r.t. the coordinate system fixed to the airplane. So the first law of Newton seems to fail: we are at rest, so there is no acceleration and yet a force is exerted on us. When the airplane is traveling at a constant speed on a constant height, however, we feel no force (except for gravity) and the first law seems OK again.
A simpler example still is that of a carousel. When we stand on the carousel we are at rest w.r.t. a coordinate system fixed to the carousel, but we do experience a force trying to push us outward. This again seems to contradict the first law of Newton.
Note that both coordinate systems where the laws seemed to fail in these examples were systems that had a non-zero acceleration themselves. The conclusion is that Newton's laws only seem to work when considered in a non-accelerating reference frames, which we call inertial frames of reference. The forces we feel when we consider a non-inertial frame of reference are called fictitious forces (because they do not arise due to a physical interaction but due to the fact that the reference frame has a finite acceleration) and the wikipage on those has the same example of the carousel that I mentioned, only worked out in more detail (here).
Inertial frames of reference have to be carefully defined. Take, for example, the frame of reference fixed to a lab on earth. When considering most everyday motions, we can use this frame as a good approximation of an inertial frame, despite the fact that the earth is rotating and therefore giving the lab a finite acceleration. However, if we want to describe motions that are a direct consequence of this finite acceleration (such as the deviation to the east of falling objects), we need to find a better frame of reference.
A good question to ask is then: do inertial frames even exist? And the answer is: yes, at least in Newtonian dynamics. I believe this still holds in special relativity but things change when we go to general relativity, though I haven't had any courses on GR yet so I can't be 100% sure.
Comment: Just about your last paragraph: the "general" of GR refers to being able to do calculations in *any* frame whatsoever, inertial or not. In some sense free-falling frames are "inertial," but the concept of inertial frame doesn't mean much anymore in GR.
Comment: @ChrisWhite Just to debunk the popular misconception: you *can* do accelerating frames perfectly well in SR. (You're no doubt aware of this, but others might not be.) You can use any accelerating frame and any coordinate system you like in SR, no obstruction. The difference between SR and GR is that in SR the curvature vanishes: $R_{\mu\nu\rho\sigma}=0$. In GR the inertial (free-fall) observers are those whose curvature components are as small as possible (second order), so they feel no accelerations, only small tidal forces. In a way they are as close to inertial in the SR sense as possible.
Answer: Newton's second laws are no longer a good approximation to reality for very small systems (like atoms) where quantum mechanical effects become significant, and for certain very large systems where the effects of general relativity become significant.  They are no longer a good approximation for at least two reasons:

The mathematical model of the physical world in which every system is considered a system of particles that move along well-defined trajectories in three-dimensional space itself breaks down (like in quantum mechanics where the state of a system is described by a vector in a certain space called a Hilbert space).
The predictions of Newton's second law no longer hold to sufficient precision in some systems.  A famous example is that Newton's law of gravitation coupled with Newton's laws incorrectly predicts the amount which the perihelion of Mercury precesses.
Comment: @joshphysics Chris White is probably talking about this http://ajp.aapt.org/resource/1/ajpias/v56/i5/p413_s1
Comment: +1, but two minor points: galactic dynamics are actually done entirely with Newtonian physics, since gravity isn't overwhelming there and nothing is going too fast; also, you *can* predict a deflection of Newtonian photons with certain assumptions, and this was done, but it turns out to be off by a factor of exactly 2 from the actual GR result.
Comment: @ChrisWhite Thanks.  When I was writing galaxies, the thought that galactic dynamics might actually be well-described by Newtonian physics occurred to me; I'm certainly no astrophysics/cosmology expert.  I took out the parenthetical comparison.  I also took out the remark about photon motion since I'm completely unfamiliar with the Newtonian calculation you refer to.


backup strategy

Question: We have got a project about restaurant service equipment. We are asked to provide online backup strategy for our restaurant's web page. Could you give us any references? Thanks in advance
Comment: You need to provide more information about the server you are using for the web pages and how much access you have to it e.g. what is it's operation system, do you have admin access to the server ...
Comment: To help you out you first need to define your goals more clearly: What is the structure of your site (flat HTML, database-backed, etc.)? What do you want to be able to restore? How fast do you want to be able to restore it? How far back in time do you want to be able to go? Are you looking for "redundancy", actual "backups", or both?  --- Answering lain's questions above will also be helpful in getting more specific / applicable answers...
Answer: you can make automated backup for a remote server.
If you use any type of control panel (CPanel, plesk, ...etc) you will find an option to make backups using APIs.
If you don't, you can just rsync (or tar and ftp) the /home and /mysql/data folders to another remote server.
Answer: I would recommend Syncback. It is an easy to set up program and it can be used for multiple situations.

backup strategy


LiftMaster Formula 1 intermittent remote control problems

Question: We own four of the LiftMaster Formula 1 openers and none of the remotes are battery-powered. (we use the remotes build into the vehicles)
All of the bulbs in the openers are incandescent and the ones in the garage are CFL and the openers have worked flawlessly for years. Of late mine has been really intermittent. I can be parked underneath the opener and open/close the door using  the remote without issue but when I back out it's impossible to close the door even from one foot outside the garage. Then if I leave it open, run an errand and come back X minutes later and accidentally push the remote (on autopilot) it will close the door but then I cannot reopen from the door. Conversely, if I get out of my car, go into the garage and close the door using the hardwired  control then come back X minutes later - my remote will open the door. It's very frustrating and confusing.
I might add that it's been exceptionally hot and humid so  this problem may be moisture related.
Regardless, this same thing happened several years ago and I called our local dealer - they sold me a hard CB radio-like antenna to replace the wire with. Of course as soon as I had it in hand the problem went away so I haven't installed it yet but after reading these posts I don't think it's going to resolve my problems.
Any ideas?  Thanks!
Comment: The programming issue is probably related to the interference issue. Did you remove the CFLs? (literally unscrew them). Do you have any other electrical devices running off of the same AC circuit as the opener, e.g., a motor driven item like a freezer, or even a computer power supply? Do you have any OLD cordless phones, intercoms, baby monitor, or even an older wifi router? Does the unit have a battery backup - if so, does it work flawlessly off of battery? (unplug AC)
Comment: It sounds like you have already read the numerous things people have noted. They could all be factors. As far as CFL... do a simple test, remove them. Literally unscrew. Repeat your testing. Any Changes? Also, When this happens, Does the other vehicle remote have an issue? How about the battery remote? I presume you have one. Try it just for sanity sake. Also, YOUR vehicle, try programming a different button for the door as well. Just to rule out a button issue. All that said, you could have an issue with your unit in your car, but do those other tests first.
Comment: I'll give it a whirl. I installed the CB like antenna yesterday with no improvement.  I believe it is installed correctly as it worked one time. The brass core is attached to the antenna for the opener and the grounding strap is attached to the rail...
Comment: My wife's car also has intermittent problems but not nearly as severe as mine. I've also tried programming a different button on my car's remote. Oddly, I was unable to successfully do so.
Comment: why not try installing the new antenna? It might not work, but you won't know until you try.
Comment: You should try using the antenna.  Why would you disregard what an expert has told you in favor of strangers on the web ?  It is obviously RF interference.  An antenna may well fix it.  So, will tracking the source of the noise and removing it.
Answer: Your system may be experiencing intermittent radio frequency interference from a nearby transmitter or remote control device.
Answer: If you have an LED light bulb it will interfere with the remote and keyless entry frequency
Comment: I would go more with "can" interfere than "will" interfere, but I'd agree.
Comment: Note that the OP specifically indicated he has CFL & incandescent bulbs in the garage, _NOT_ LED.


Set custom DPI for different apps?

Question: I own a rooted Nexus 7 16GB running on 4.2.1. The default interface (stock ROM) is the phone UI. I have read mods and a certain app that changes the DPI to enable the tablet UI.

I would like to have the phone UI primarily but I want certain apps to run in the tablet UI mode. Is this possible? If so, how?
Answer: Maybe you should look into this ROM, however I cannot guarantee if there is an availability for the Nexus 7.
To quote:

This rom lets you scale and project every app, every widget, even
systemcomponents individually.
Remember, android is modular, everything is an app: Lockscreen,
navigationbar, dialogs, popups, keyboards, widgets, and your regular
apps of course.
Apps have the capability to switch into various designs or layouts
according to the device they run on.

It is hybrid, meaning, that individual apps can change from tablet mode to phone layout mode on the fly. It is open sourced and is available on github.
Edit:
Thanks to eldarerathis for supplying the linky to the N7 Version found on XDA.
Comment: I think this is the N7 version: http://forum.xda-developers.com/showthread.php?t=1800268

Set custom DPI for different apps?


How to add "popup edit control"

Question: I am working on an MFC aplication and i need to make following thing: Add a new popup edit control with three choises - "Red", "Green" and "Blue". I am working on VS 2005 and in the Toolbox i have only "Edit Control" to drop. How can i make the options of it so it became popup edit control and i can write my three choises? I know how to make it with ListBox but it is not the task description.
Answer: You are looking for a combo box (CComboBox MFC class).

How to add "popup edit control"


XmlSerialization problems on compact framework 3.5

Question: I am doing a finger exercise and trying to write a application that lets my computer and windows mobile phone communicate over bluetooth trough serial port.
Now I have ran into a snag with the serialization of objects. Binary seralization is not supported by .Net Compact Framework so I am opting for XmlSerialization. I have written a library with two classes. A ObjectCarrier that should be able to contain other classes so I can have a generic way of sending and receiving. And have a costume class MusicAlbum.
The entire setup works perfectly on the pc side. The mobile site keeps giving me the following error:
System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidOperationException: The type TransferObject.MusicAlbum was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically.
The strange thing is that if I use the ObjectCarrier and put something like a string or datetime object in the Payload it works on the mobile.
What am I doing wrong with my MusicAlbum class?
---| MusicListing.cs |-------------
using System;
using System.Collections.Generic;
using System.Text;

namespace TransferObject
{
    public class MusicAlbum
    {
        public string AlbumName { get; set; }
        public string ArtistName { get; set; }
    }

}

---| TransferObject.cs |-----------
using System;
using System.Xml.Serialization;

namespace TransferObject
{
    [XmlInclude(typeof(MusicAlbum))]
    public class ObjectCarrier
    {
        public Object PayloadObject { get; set; }
    }

}

Thank you for you suggetion. This helped me along to reveice how I am doing it. By using the abstract class I don't need a carrier anymore.
The reason it wasn't working was my own fault it was a windows library instead of a mobile library. After changing that your code worked perfectly. On both sides as far as I have tested now. If anything changes about I will update this.
Answer: As far as I understand it, XmlInclude is used for subclasses; i.e. if MusicAlbum inherited from ObjectCarrier, and you were serializing a MusicAlbum instance as an ObjectCarrier.
IMO, the best approach here would be to use messages per-type; however, if you want to go the [XmlInclude] route you could define a common base-class to all your supported payloads, and have, for example:
[XmlInclude(typeof(MusicAlbum))] // etc other types...
public abstract class PayloadBase {}

public class MusicAlbum : PayloadBase
{
    public string AlbumName { get; set; }
    public string ArtistName { get; set; }
}

public class ObjectCarrier
{
    public PayloadBase PayloadObject { get; set; }
}

And btw, there are some APIs that support binary on CF; protobuf-net being just one (I'm biased as the author - but hey, it is free...).


What reacts to nitrogen by showing signs of color?

Question: I was watching a video about nitrogen and started to think what would make nitrogen react by showing signs of color on the physical side of things without being harmful to surroundings. And this would be in a world that doesn't have nitrogen in the atmosphere. What are some chemicals that can achieve this when combined with nitrogen?
Comment: Just clarifying, you envision an atmosphere without nitrogen and want a way to have a visual indicator when nitrogen is present?
Comment: This might be better asked on the [Chemistry SE](http://chemistry.stackexchange.com/)
Comment: You can notify a user using the @ syntax (instead of +).
Answer: Microbial Biochemical Assay
One way might be using organisms like nitrogen-fixing bacteria grown and isolated in a nitrogen-free environment, and analyzing their morphological characteristics and pigment production. For example, you might have an inoculated Ashby-Benzoate agar plate that does nothing and appears plain until nitrogen is introduced into the environment (through the air, titration into agar, etc) and those nitrogen-fixing bacteria spring to life, producing easily detectable morphological and biochemical markers. The plate may suddenly start producing a multitude of small, white/cream, round, 2-3mm, glistening colonies or the agar substrate reacts by changing color.
Another possibly with another chemical like Benzoate that reacts with specific pigmentation produced by the bacteria to visually show the presence of nitrogen through the inference that the nitrogen-fixing bacteria could not be present producing the pigments to react with the Benzoate if there were not nitrogen present for them to fix non-symbiotically.
Answer: Unless your world has very different temperatures and pressures from Earth's, there's not much you can do.  From Wikipedia:

In general, nitrogen is unreactive at standard temperature and pressure. N2 reacts spontaneously with few reagents, being resilient to acids and bases as well as oxidants and most reductants.
Comment: Dang that N-N triple bond!
Answer: Possible forms of Nitrogen
If there is no nitrogen in the atmosphere, then there will be very little nitrogen present as N$_2$ (otherwise it would be in the atmosphere). Therefore we need to take a look at other potential forms of nitrogen and how we would detect them. The detection method would be different for different forms of nitrogen. In a biologically active world, the three main nitrogen compounds (using Earth-based life) will be ammonia, nitrates, and nitrites. They are associated with each other through the Nitrogen cycle. I will go over them, and some other relatively common nitrogen compounds.
Ammonia (NH$_3$)
One of the most common forms of nitrogen, especially in the outer solar system. Ammonia is a gas down to -33C, and a liquid to -78C. A simple ammonia test uses Nessler's reagent, which is 0.09 molar potassium tetraiodomercurate(II) in 2.5 molar potassium hydroxide, which will turn yellow in the presence of ammonia.
Nitrate (NO$_3^-$)
A common anion that forms many salts. Tested for with the nitrate test, where iron(II) sulfate and sulfuric acid added. If nitrates are present, they will be suspended in a 'brown ring' between the layers of aqueous iron(II) sulfate and sulfuric acid, indicating nitrate presence in a test tube.
Nitrite (NO$_2^-$)
Another common anion. Tested for with the nitrite test. This is very similar to the nitrate test, except that the test solution has 4M (less concentrated than in the nitrate test) added to it until acidic, then iron(II) sulfate. If nitrite is presence, the whole solution will turn dark brown
Amines
Amines are ammonia molucules with one or more hydrogen atoms replaced with a substituent, such as an alkyl (a hydrocarbon chain like methyl, CH$_3^-$) or and aryl (a hydrocarbon ring like phenyl C$_6$H$_5$). Amines are of course important as amino acids, but there are a great variety of possible forms. Amines are detected through the Hinsberg test; where the test solution is mixed with sodium hydroxide and benzenesulfonyl choride. The amine will form a sulfoamide salt which will precipiate out of solution and indicate amine presence.
Azides (N$_3^-$)
Toxic and reactive compounds, used in things such as airbag inflators. Not commonly tested for, though there are some papers detailing detection methods
Oxides (N$_2$0, NO, NO$_2$)
N$_2$0 is nitrous oxide, or laughing gas. NO is nitric oxide. It is poisonous in large quantities by is used in the body for signaling, most importantly by causing erection. This is the 'active ingredient' in Viagra. NO$_2$ is nitrogen dioxide, which is a major air pollutant (this is what Volkswagon just got in trouble for with their diesel engines cheating on emissions tests). It is a precursor to nitric acid and a major component of acid rain.
These oxides are all gases and cannot be detected as easily using the liquid-type tests for the previous compounds. I would guess gas spectroscopy would be the easiest way to identify the presence of these compounds.


What is a Proof Assistant?

Question: How would you explain to a beginner in simple terms, what a Proof Assistant is?
Comment: I would recommend to only ask the first question so that no one casts any close votes under the "needs more focus" option. Most sites I frequent on this network have a policy of "one question per post" so that the answers are well organized (among other reasons too).
Comment: Proof assistants are tantalizing collaborative multiplayer games captivating us by the insights they unlock :-)
Comment: @NikeDattani I added the others to get a general overview answer :)
Answer: Let us clarify some jargon. Usually we call proof assistants systems which can really help us finding proofs, i.e. they should have a tactic language. Systems which lack this feature (tactics) are usually called type checkers or just type systems. On the other hand, in modular systems, kernels in proof assistants could also be called just type checkers. All of them could be called theorem provers as long as they have at least the hole inference and hole finding features.
Comment: I feel this answer, to some extent, just shifts the question from "what is a proof assistant?" to "what is a tactic?".
Comment: Tactics in the sense of interactive theorem-proving date back to at least Edinburgh LCF (1970s).  They were implemented there on top of a kernel that provided primitive inference rules for doing what you might call forward proof.  The system without tactics was still a capable proof assistant, and was certainly _not_ just a type checker or type system.
Answer: The term "proof assistant" is usually used to describe a computer software that assists humans with developing formal proofs. A formal proof is a finite sequence of declarative sentences which are either:

an axiom,
an assumption,
a sentence that follows from one or more of the previous sentences;

and the sequence of sentences must end with no more assumptions remaining.
This formal structure makes it easier for computers to parse and verify the proofs. An example of an alternative to a formal proof would be a natural language deduction.
This Stack Exchange site has some good resources to learn more about the basics of proof assistants:

What's the "Hello, World!" for proof assistants?
What are some examples of proof assistants doing something useful?
What was the 1st Proof Assistant?
Comment: Are you saying that software that works on 'natural deduction' (in your link) is -not- a proof assistant? (since you hint at that using the term 'alternative')
Comment: This definition of *formal proof* seems antiquated, such that it's an inaccurate description of what proof assistants actually do.
Answer: A proof assistant is a system that translates user input into a formal proof. Ideally, this formal proof should be verifiable by a third party.
For example,

the user designates a theorem they would like to prove
the user writes some commands in the proof assistant's proof language
using proof search and other automated techniques, the proof assistant interactively uses these commands to construct a formal proof (ie. sequent calculus, natural deduction, etc)
a third party algorithm should be able to take this formal proof and verify that it is indeed a proof of the designated theorem

Personally, I think of a proof assistant as an approximation of what a mathematician does, in the sense that mathematicians will write down informal arguments in such a way as to convey to anyone else that the proof is correct.

What is a Proof Assistant?


Bollinger Bands and TRENDING market

Question: I have a small question regarding Bollinger Bands: If upper and bollinger bands either converge (both bands are getting more and more close together) or diverge (both bands are getting more and more away from each other), does that mean the market is TRENDING? Or is market trending only in case if both bands, upper and lower, are parallel and at the same time NOT horizontal? Thank you.
Answer:
If upper and Bollinger bands either converge ... or diverge ..., does that mean the market is TRENDING?

No - Bollinger bands measure volatility, which is an measure of how much variation there is in the price of the instrument. It does not indicate a trend which means that the instrument tends to move in a consistent direction.  When Bollinger bands are close together, that means volatility is relatively low, and vice-versa.
They can  be interpreted as signals that a stock might move in one direction or the other, but they are not a measure of directional movement.
Answer:
If upper and bollinger bands either converge (both bands are getting more and more close together) or diverge (both bands are getting more and more away from each other), does that mean the market is TRENDING?

The answer is no. The divergence or convergence of BB-upper & lower band does not indicate if the market is trending or not. It only indicated if volatility is increasing or decreasing.

Or is market trending only in case if both bands, upper and lower, are parallel and at the same time NOT horizontal?

The answer is yes. To understand the reason consider that BB is constructed from a central Moving Average along with standard deviation. Upper Band=MA+2*SD, Lower Band=MA-2*SD. A moving average is a trend following indicator and volatility has nothing to do with trend (as SD only measures the price movement around the mean). Which essentially means BB has trend following qualities. The upper and lower bands remain more or less parallel in between band contraction and expansion.
Refer below:

You shall see distinctly phases when BB bands are not parallel and are parallel and not horizontal. As mentioned above, when BB bands are expanding or contracting they do not give indication of the trend direction. When they are parallel, close or apart and not horizontal, they provide a good directional bias through the general slope. Though a more effective method to determine trend and its direction is the central MA of BB.
Again, refer below:

Here you can see that some portion of the bands are parallel and more or less horizontal. The price action would tell you that the stock is now range-bound as opposed to trending.
The primary use of the BB bands are to gauge volatility as @misantroop stated. The primary trend direction is usually derived from the central MA.
Answer: Bollinger Bands are placed standard deviations away from the moving average. Therefore if the price is volatile, the bands diverge from the mean. During consolidation the bands would converge. They do not provide a clear indication of whether the price is trending or not.
Comment: "trending" is quite different to "volatility". Trending means direction, volatility is spread or variation.
Comment: That's true however markets rarely become more volatile while consolidating. Funny how you downvoted me despite the fact I said "could say the market is trending". I'm strictly speaking from a practical trading standpoint.
Comment: I didnt downvote you. Someone else. Wanted to start a discussion and to give you the opportunity to change things if you wanted after the discussion ....

Bollinger Bands and TRENDING market


How can I upload files to django from within AS3 Flash?

Question: I need to build a file uploader in AS3 that is capable of uploading files into an authenticated django view which contains a form with a file upload input.
I have been working on this for an entire 7 days, all day.
After much digging, I have discovered that Adobe, in their infinite wisdom has disabled cookie headers from being sent from flash.  By default, django only accepts sessionid's via cookie, so I added a custom middleware that allows authentication via a sessionid POST var.  This has been tested, and is functional.
However, I still cannot upload, even with the sessionid in the POST.  When I do attempt an upload, the bytes seem to go up, and then for some reason, the upload fails.  Here is said response.
flash says selectHandler: name=douchetop.png URL=http://dev.citizengroove.com/upload/
progressHandler: name=douchetop.png bytesLoaded=32768 bytesTotal=139082
progressHandler: name=douchetop.png bytesLoaded=65536 bytesTotal=139082
progressHandler: name=douchetop.png bytesLoaded=98304 bytesTotal=139082
progressHandler: name=douchetop.png bytesLoaded=131072 bytesTotal=139082
progressHandler: name=douchetop.png bytesLoaded=139082 bytesTotal=139082
httpResponseStatusHandler: [HTTPStatusEvent type="httpStatus" bubbles=false cancelable=false eventPhase=2 status=500]
httpStatusHandler: [HTTPStatusEvent type="httpStatus" bubbles=false cancelable=false eventPhase=2 status=500]
flash says: ioErrorHandler: Error #2038: File I/O Error. URL: http://dev.citizengroove.com/upload/

Please, please, please help me!
Answer: I'm not sure what the problem is, but I might be able to give you some advice to help you work through this.
Have you tried uploading the file via curl?
curl http://dev.citizengroove.com/upload/ -d <Post Data> -T douchetop.png

Then, based on what that hands back to you, you might be able to debug this easier assuming that the problem is within django and not flash. If nothing else you will know which half of this is having the problem.
Answer: I'm also not sure what the problem is, but I hope I can fling some helpful details your way. From what I can figure, your sending the data, but cannot reconstruct it on Django's end.
For HttpRequest.FILES, the Django docs say: "Note that FILES will only contain data if the request method was POST and the <form> that posted to the request had enctype="multipart/form-data". Otherwise, FILES will be a blank dictionary-like object."
If your not posting the form with enctype="multipart/form-data", you'll have to reconstruct the file from request.raw_post_data. This is explained by @theivviax here.
He initially wrote this comment when using Pluploads, which does have support for a flash backend for uploading large files over HTTP. It's licensed under GPLv2, perhaps you can take a peek at their docs or sources.


Why do LEGO sets have a minium age rating?

Question: Many LEGO sets have minimum age ratings, such as 7-12, 9-14, and 16+. Why is this? Are the models really that different in terms of complexity? Also, why does LEGO often indicate that sets are not recommended for children under 3 separately?
Comment: Welcome to Stack Exchange! Looks like part of your question got cut off - can you edit and complete it?
Comment: Related: http://bricks.stackexchange.com/questions/682/why-does-lego-have-a-maximum-age-limit
Comment: The "three and under" warning is related to laws regarding selling toys that contain choking hazards. There is (supposed to be) more strict laws regarding those toys sold for the three-and-under set, and LEGO is both indemnifying themselves if your toddler chokes on a brick for the "wrong age", and lowering the testing and certification costs associated with toys for younger children. Once your kid understands not to try and eat toys, regular LEGO bricks are perfectly safe. Though, if they accidentally take out their eye whilst playing, you will not be able to _easily_ make a legal claim.
Answer: With children 3 and under, small parts may be a choking hazard. The sets that Lego markets to the parents of small children contain larger pieces that are easier to handle and harder to swallow (i.e. Duplo).
When a Lego set recommends "ages 10 and up", it refers more to building ability and patience than safety. These sets are generally more complex and larger than, say, sets an average 8-year-old would be comfortable (or capable) of building. These are only recommendations of course, not rules!
Answer: Indeed.
My 8 year old sister is incapable of completing more difficult lego sets but when i was this age, I was already building (and making my own) difficult sets. I would say it depends on many factors.


Windows Azure is currently performing an operation on the related affinity group that requires exclusive access

Question: When uploading packages through Azure Management Portal (manage.windowsazure.com), I've been getting this error (see title) more and more frequently in the past few days.
What I am uploading
I upload 4 packages to Azure every time we have a release:

consumer site
administration site
WCF
sub-admin site

Usage History
A year ago, I used to be able to upload all 4 asynchronously.
6 months ago, something (bug?) occurred where if I upload more than 1 file without refreshing the portal page, it would completely ignore successive file uploads.
The last few days, however, I have been receiving "Windows Azure is currently performing an operation on the related affinity group that requires exclusive access" if any of my applications are still becoming Ready/Running.
Current Problem
For me to upload all 4 packages, I must upload one package, wait for it to reach the "Running" state, and then repeat for the remaining packages.
It takes 5-10 minutes for each package uploaded to reach the "Running" state for all instances (ranging from 1-4 instances).
Right now it doesn't seem like there is any articles or blogs acknowledging this issue. If anyone has any advice, please share.
Comment: Been having the same issue. I haven't found a solution yet though.
Answer: It appears that this issue was temporary, and has gone away as of a week or so ago.
I haven't run into the issue , nor have I seen any blog posts or anything similar acknowledging that this was an issue.
The issue regarding "upload more than 1 file without refreshing the portal page" also seems to be fixed.


Does the rejection tag cover candidates rejecting a job offer?

Question: We have a rejection tag with 20-odd questions which for the most part seems to cover the typical scenario of a hiring manager rejecting a candidate for a job. But should this tag also include questions from the other side, i.e. a job candidate replying to the hiring manager to reject a job offer?
Comment: "But should this tag also include questions from the other side," - sure. No reason to create yet another tag.
Comment: Unless we have a specific case where that is causing a problem, and/or a better tag suggestion.
Comment: @keshlam That's pretty much what I thought. Mind adding that as an answer?
Comment: I have to admit that I'm not wild about the judgemental tone of "rejection", though, and it's begging to be used by someone heartbroken by a workplace relationship... So I'd actually rather fix the tag for clarity. I don't have a good suggestion , though.
Comment: You could turn it into "offer-rejection" to avoid that but I'm not a fan of lengthening tags when there's no real need to do so. If someone abuses the tag in the scenario you give it's just up to the community to fix the tags. I actually expected we'd have an 'office-romance' tag but apparently we don't.
Answer: Sure, why not?  Any rejection involves a rejector and a rejectee, so unless the concerns are so different that they demand separate tags, let's just use one.
We should create a tag when a category of question has its own cohesion (this grouping matters) and when it would be lost in the larger tag that would otherwise be used.  It doesn't sound like we're there yet with this tag; if that changes later, we can retag some questions.


Aerogel insulation viable?

Question: I have read that new aerogel-type insulation offers potentially better efficiency than ordinary fiberglass, albeit with greater cost. Is this true at a practical level? Should I look at replacing some of my old fiberglass insulation with aerogel, or is it just hype?
Comment: To my knowledge about the best you can currently get for commercial insulation are VIP panels, but they are costly
Answer: It's not hype, but it's not a commercial viability for home insulation at this time.
I was just looking at the prices for aerogel and it's really expensive. It seems that the current use in house insulation is as a wrap. And from the prices I saw, it was $26 per square foot for 2mm thick material. Premium fiberglass is about $0.50 per square foot (2"x6" walls) and premium house wrap is about $0.14 per square foot.
Some interesting related reads:
Insulated living room
Some retail products
Price drop?
Comment: It is extremely light, extremely thin, and an incredible insulator. It makes it an almost perfect material for space shuttles. Here is a more comprehensive list: https://en.wikipedia.org/wiki/Aerogel
Comment: That does seem kind of astronomical. Is there a specific benefit why a person would want it over the cheaper alternatives?
Answer: Most (any?) foam insulation will be better than fiberglass. But also more expensive. Regardless, there's no need to go with aerogel unless you are building something that needs to be ultra-lightweight, which houses don't usually need to be. Replacing fiberglass with standard spray foam insulation will be a giant improvement. Not sure you'd be able to justify the cost of the aerogel, though that would depend entirely on other factors (climate, your budget, design of the house, etc.)
All that said, retrofitting fiberglass is a huge project as you need to replace the fiberglass, so you're talking about removing sheetrock and the like to accomplish it.

Aerogel insulation viable?


Do accidentals override key signature and previous accidentals?

Question: I am wondering how the accidental in the first chord (see what is circled) is played?  Does any accidental simply move the note up or down a half-step from what the note is supposed to be based on the key signature or does it override the key signature all together?  Specifically, is the accidental G# played as a natural G (since G is already a flat in the key signature - thus a half step up) or actually as a G#?
Comment: Out of curiosity, what piece is this? I'm assuming 20th century, and there are some fairly strange enharmonic choices being made.
Comment: Notice that you also have natural accidentals in the first chord (A-natural, rather than A-flat).  If the accidentals were cumulative (e.g., a sharp sign meant "half step up from what this would be otherwise", then the A-natural would have been denoted with a sharp sign on the A-flat.  If you're playing that triad as A-C#-E, then the only consistent interpretation is that the sharp sign on G means G#, not "half a step above Gb, thus G-natural."
Answer: The chord played is Amaj7, made up with A C# E and G#.The key sig. is Db/Bbm.I guess that the G# is shown instead of a possible Ab, which is technically correct for that chord.
All accidentals over-ride the key sig., for the rest of the bar they're marked in.Sometimes the author will be helpful and remind the player that a particular accidental is not needed in the next bar by using another accidental,which can get confusing !
Any accidental will show the actual note to be played, not just sharpening a flat, for example. In that key sig.,the Gb is changed to a G# with an accidental. It doesn't 'sharpen the flat' to make it a G natural.
Comment: I find that almost every time I'm confused by a courtesy accidental, it's because I missed an earlier accidental (or, in some cases, a key change)--so even then, they're helpful.
Comment: Definitely paranthesise them! But definitely include them in such cases, too.
Comment: @KyleStrand, agreed, but Tim's right, it's unnecessarily confusing. This is why I think composers should use parentheses around courtesy accidentals, much like in the OP's example.
Answer: Accidentals override key signatures and previous accidentals. The circled chord has two G# and and one C# note. Having "additive" accidentals would make it very hard to read music. In this excerpt, the next octave chords in the top staff would then be B-flat, then B-doubleflat, and then either G natural (if adding to the previous accidental) or or G double flat (if adding to the key signature)...
Comment: @Tim - nonpop is pointing out how confusing it would be if accidentals were additive. Putting naturals on the B's on beat two of the RH would have to mean Bb as in the key signature, the flats on the Bs on beat 3 would mean double-flat since B is already flat in the key signature. The fact that you got lost by it proves the point!
Answer: As has been mentioned in other answers, alterations are not relative, they're absolute. So a sharp makes the note sharp, regardless of the alteration it had due to the key you're playing in; so if the key states Ab and you suddenly see an accidental sharp on an A, you play A#. Same goes for the inverse case.
So I just wanted to add that there is a sign to remove an alteration: the natural. Your example includes the natural sign in the second chord on the treble clef; that one is used to "neutralize" a sharp or flat, so you play B natural there (which is what you were thinking the sharps did in the first chord).
Comment: Because alterations are not additive, it is possible in some rare cases for a sharp sign to actually lower a note's pitch (if the note was double-sharped earlier in the measure) or for a flat sign to raise it (if the note was double-flatted).
Answer: Accidentals take precedence to any alteration from the signature. Moreover, they apply until the end of the bar for every pitch. If there is a G# in a bar, then, until a new accidental or the end of the bar, all the following Gs on the same octave should be played sharp.
Comment: But since that last rule is not always followed in practice, I recommend anyone generating sheet music to explicitly mark the accidental (or lack thereof) in each octave within the measure.
Comment: @CarlWitthoft: I would suggest that the biggest reason for adding "cautionary accidentals" in other octaves would be to make it clear that a lack of an accidental was deliberate; they should not be included in cases where the lack of an accidental would be "obvious" [e.g. in D major, if an E7 chord is followed by an A7 whose G is in a different octave from the preceding G#, I would see no need for a natural sign on the G.]
Answer: The key signature is always secondary to any accidentals next to the note. In the chord you circled you would play a G#, C#, and another G# instead of a Gb, C, and another Gb. They never cancel each other out just play what is written.
Answer: While the existing answers are correct for modern music, there was a time before the invention of the natural sign in the middle of the seventeenth century, when music was less chromatic and harmonies rarely strayed very far from the tonic.  In those days, the sharp sign was used to cancel the flat sign.
An example may be found at the end of the first Kyrie of Byrd's Mass for 4 voices, the last note of the second staff in the image.
Comment: Related: [Why does this tonal scale from 1737 have both F and E♯?](https://music.stackexchange.com/q/74254/21766)
Comment: @Richard nice.  I didn't realize this practice persisted so late.  I found naturals in a movable-type print (similar to this but much later) from 1660, as well as in a print using a different style of movable type that I didn't find a date for, but it was music of Dieterich Buxtehude.
Answer: The key signature is not overridden. This is just a chord borrowed from a different key and the accidentals continue until the end of the measure unless otherwise noted.
Answer: As noted in the other replies, accidentals are "absolute", with the meaning unfazed by preceding material or key signature.  There is one exception: when "weakening" a previous double accidental (key signature or previous in the bar), the resulting single accidental is often printed combined with an immediately preceding natural sign.
Answer: No.The key signature prevails and must have it key rules respected ie the various types of scales, like Major, Melodic Minor, Harmonic Minor and numerous other exotic etc scales on could get adventurous composing music in eg Phrygian etc modes, pentatonic scales etc, like some rock musicians, Flamenco, Middle Eastern, indian etc music sometimes experiments with, to create unique sounds (that will give joy to some listeners, annoy others...).your accidental tells you to shift the note one or two half tones up or down but only for that bar, or until you hit the "natural" accidental sign, telling you stop playing alter notes of the basic key signatures time pattern, just play what the key signature says to play. So, if the key signature involved an F#, as the Popular D major guitar key does and an accidental told you to play this F# as a flatted F#, you'd simply play a plain F note for that bar. But as soon as the "natural" sign cancels that, in the next bar, usually, then you just go back to obeying the instructions of the Key signature for D major, which requires all F notes to be played as F#. Takes a while to get one's head around all this music theory stuff. But worth knowing it.
Comment: this is not how accidentals work, you need to make sure this stuff is clear in your own head before trying to teach others! Accidentals are NOT additive, they are absolute. A natural does NOT mean go back to the key signature, it means play the indicated note as a natural, ignoring key signature.


Byte size of Packet

Question: I am trying to implement this protocol (http://developer.valvesoftware.com/wiki/Source_RCON_Protocol) from a C# NET application. The part applicable there to the code I am implementing is under heading "Receiving". However, I am not positive I have the byte sizes correct when constructing the packet.
Here is my function to construct a packet...
    private static byte[] ConstructPacket(int request_id, int cmdtype, string cmd)
    {
        MemoryStream stream = new MemoryStream();
        using (BinaryWriter writer = new BinaryWriter(stream))
        {
            byte[] cmdBytes = ConvertStringToByteArray(cmd);
            int packetSize = 12 + cmdBytes.Length;

            // Packet Contents
            writer.Write((int)packetSize); // Byte size of Packet not including This
            writer.Write((int)request_id);  // 4 Bytes
            writer.Write((int)cmdtype);     // 4 Bytes
            writer.Write(cmdBytes);         // 8 Bytes ??

            // NULL String 1
            writer.Write((byte)0x00);
            writer.Write((byte)0x00);

            // NULL String 2
            writer.Write((byte)0x00);
            writer.Write((byte)0x00);

            // Memory Stream to Byte Array
            byte[] buffer = stream.ToArray();

            return buffer;
        }
    }

According to the Protocol specifications, packetSize is the byte size of the packet not including itself.
The first 2 (int) would make it 8 bytes...
The "cmdBytes", which in this paticular instance is "testpass" would be 8 bytes I believe...
Then the final 2 null delimited strings (If I set these up right) would be 4 bytes.
So by my calculations, the packet should be 20 bytes big, but it doesn't seem to be working properly. Are the values I am thinking these should all be correct and am I setting the NULL delmited strings properly for C# .NET?
Answer: You write two zeros too many.  Pretty easy to see in the examples, they all end with two zeros, not four.
Comment: What do you mean? Like this? // NULL String 1
            writer.Write((byte)0);
            writer.Write((byte)0);
Answer: You should probably call writer.Flush() after the last writer.Write(). Otherwise you run the risk of disposing the writer before it's finished writing everything to the stream.

Byte size of Packet


Epson Artisan 725 scanner - does not work over 600dpi

Question: Epson Artisan 725 scanner works fine up to and including 600 dpi. Scans over 600 dpi (1200 etc) fail with 'communication error' from scanner.
Works fine at all resolutions with Windows 7 (Virtualbox)
The printer is networked (ethernet)
Answer: Not sure if this is a particular solution but 1200PDI is a lot my only thought could be sending that size of packet across an Ethernet network. In one continuous block. Have you tested it to make sure if works locally? Are there many devices in your LAN?


Steam will not run games (OpenGL Error)

Question: Every time I go to play a game on Steam it won't run, and gives me this error:
Could not find required OpenGL entry point 'glGetError'! either your video card is unsupported, or OpenGL driver needs to be updated. However I know for a fact that my graphics card has been updated, and I have tried countless answerers, but none of them have worked. (I have a Nvidia GTX 970)
Comment: possible duplicate of [Could not find required OpenGL entry point 'glGetError'](http://askubuntu.com/questions/475756/could-not-find-required-opengl-entry-point-glgeterror)
Answer: run these commands:
sudo apt-get update
sudo apt-get install ia32-libs

if you get an error, run this command instead:
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0

then, run the following commands and reboot:
sudo sh -c 'echo "/usr/lib32\n/usr/lib/i386-linux-gnu/mesa\n" >> /etc/ld.so.conf.d/steam.conf' && sudo ldconfig

source

Steam will not run games (OpenGL Error)


What is the usual form of "Please do the needful"?

Question: I was browsing the internet, and found that "Please do the needful" is not an appropriate sentence to use or write.
According to this link, this sentence used to get used in South Asia. What would be an alternative phrasing to use?
Answer: From my experience of receiving such requests from colleagues in India, I would say that the idiomatic equivalent is either Please help, or Thank you. There really isn't a literal equivalent that anybody would write in the UK, in the same way that there isn't a British English equivalent of bon appétit.
Answer: Close equivalents might be "please do the required" or "please do what is needed" or "please do the necessary"; all imply a certain background knowledge of the situation, i.e. that you know what do to and don't need it spelled out.
I'm not sure that "do the needful" isn't entirely inappropriate, though (I'm in the UK). In that way that certain archaic phrases are used in a slightly jocular ways, e.g. using beverage instead of drink, it does sound lighter and less formal and probably something to be spoken, not written.
Answer: As @Mitch has pointed out in his comment to the question, there is considerable discussion about the expression Please do the needful here.
The answers there, however, discuss two - what I consider to be different - meanings for that expression:

Do the necessary or Do what is needed.
I consider this to mean Take the appropriate action to achieve the required result.
For example (quoting @ManishSinha, the author of the linked question):

"Please do what we expect you to do in this situation without being provided a detailed explanation"
  "For example, a project manager gets a mail from marketing or quality assurance about something missing or incomplete, then he/she sends a mail to the subordinate with the body "Please do the needful". The subordinate is usually more well-versed with the work which has to be done. It might be his/her expertise so the manager might not tell what exactly needs to be done as is left upon him/her to figure out."

Do what's right or Do the right thing.
The expressions in the line above are also quoted from the author of the linked question, but (to me) those expressions mean something different from my first meaning.
I always considered these expressions to refer more to 'etiquette' or 'politeness'. This is not a case of 'taking the appropriate action to achieve the desired end', but a case of responding in the socially accepted 'polite' manner.

So, in my view, the answer to your question actually depends on its usage is India. Can it mean both of the above, or only one of the above?


Storing images in windows phone 8

Question: I have been really cracking my head trying to write and read png files into a folder in Windows Phone 8. From few blogs sites and codeplex i found that the there is an extension to the WritableBitmap Class which provides few extra functionalities. ImageTools has PNG encoder and decoder. But I really cant find examples to use them.
What Im trying to achieve here is to create a folder called page and then in it a file called Ink File. I want to convert the bitmap to a PNG and store it there. The bitmap is created from the strokes drawn on a canvas. The class ImageTools provides a function called ToImage to convert the strokes from the canvas to image.
For storing
<code>        ExtendedImage myImage = InkCanvas.ToImage();

        var encoder = new PngEncoder();

        var dataFolder = await local.CreateFolderAsync("Page", CreationCollisionOption.OpenIfExists);

        StorageFile Ink_File = await dataFolder.CreateFileAsync("InkFile", CreationCollisionOption.ReplaceExisting);

        using (var stream = await Ink_File.OpenAsync(Windows.Storage.FileAccessMode.ReadWrite))
        {
            using (var s = await Ink_File.OpenStreamForWriteAsync())
            {
                encoder.Encode(myImage, s);
                await s.FlushAsync();
                s.Close();
            }

        }
</code>
Is this a correct method? I receive some null exceptions for this. How do i find if the image is saved as png. How is this image saved? Is it encoded and saved in a file or is it saved as a png itsef. And how do we read this back?
I have checked out this, this , this and lot more like this.
I'm developing app for WP8
Answer: I have used the PNG Writer Library found in ToolStack and it works :)

Storing images in windows phone 8


Can I do a phd in germany after an Online master's degree in the uk?

Question: I am currently working in Germany and I will do my master's degree remotely from England. When I asked those at the university where I will do my master's degree, he said that the diploma is equal to the master's degree at the campus. However, what kind of problems do I have in the online master, will it be a problem for me to do a phd or MBA after this master?
Comment: Short comment: When wishing to pursue a PhD in Germany, the primary concern is typically *funding*, and acceptance into the PhD program normally follows from that. While Stephan Kolassa's answer is spot-on regarding the latter, for the former, it may be different. In particular, most PhD students hold "scientific employee" positions while pursuing their doctoral studies, and the first concern should be whether the degree counts for the hiring process of such a position. Check "https://anabin.kmk.org/" for a first estimate.
Answer: This will probably depend hugely on just what university you are doing your master's at.
In any case, whether a given foreign degree is accepted as a prerequisite for a Ph.D. or other program is up to the receiving university:

Für die Anerkennung zum Zweck des Hochschulzugangs, des Zugangs zu weiterführenden Studien wie auch für die Anrechnung von Studien- und Prüfungsleistungen sind die Hochschulen zuständig.

Universities (Hochschulen, so also universities of applied science, formerly known as Fachhochschulen) are in charge of acceptance [of foreign degrees or diplomas] for purposes of acceptance to study or postgraduate programs, as well as of crediting of foreign studies or examinations.

So your best course of action is likely to talk about this directly with any university you are interested in applying to.
It's a good idea to start this process as early as possible. First, because German bureaucracy can be glacially slow. Second, because they might be asking for additional information. Third, because they might answer with something like "no problem, as long as X", and you might still be able to address any preconditions X right now, rather than finishing your master's and having to do X afterwards, potentially losing time.
Comment: I want to add that master's degrees obtained in the EU are recognised within the EU. If you are not hung up on doing it in the UK, there are other EU universities offering remote courses. Consider, I would consider Ireland too ;).
Comment: thanks for your informativ explanation :)


Timing belt replacement

Question: We picked up a 2006 Volvo s60 from a friends mother.  It only had 22k miles when we got it.  It had sat idle outside for 3 years prior to us getting it.  We changed all fluids, brakes and tires.  It's running great, now approaching 30k miles.  I know timing belts usually go to 100k or so.  Since it is older, should we think about replacing the timing belt now?  Any way to tell if it needs replacing?
Comment: Welcome to Motor Vehicle Maintenance & Repair!
Comment: Yes; Volvo service documentation lists either 10 or 15 years as the time limit.
Answer: Yes. Volvo service documentation lists either 10 or 15 years as the time limit.
Probably not. Unless the belt is obviously cut or abraded or shredding, there are no visual clues. Because this motor is an interference design, belt failure will result in the pistons bouncing off and destroying the valves. At the very least, this would be an expensive repair, and replacing the entire cylinder head or the motor might then be sensible.
Remember to also change the tensioner and idle pulley.

Timing belt replacement


Is it possible to toggle a monostable 555 circuit?

Question: I've got a typical monostable 555 circuit, with a long pulse, set up pretty much exactly like this:

However, I want to be able to use this circuit in a way that the trigger switch can also shut off the output immediately, before the pulse would normally end, and preferably using the same button for initiating the pulse as well as ending it. I know that it's possible to use a 555 to make a toggle button, is it also possible to easily combine these functionalities?
Comment: What power supply are you working off of here, and what sort of access to parts do you have?
Comment: @nickanallen Pls define  duration and also if switch has debounce or not otherwise bounce will cutout your output
Answer: One sneaky solution using an ADG419 2-1 analog mux (also called a SPDT analog switch by some) to route the button press to the correct pin (TRIGGER or RESET) on the 555 is depicted below:

simulate this circuit – Schematic created using CircuitLab
This works as follows: when the 555 output is in its normal LOW state, the ADG419 connects D to S1 as its control (IN) terminal is driven by the 555's output, connecting SW1 to the 555's TRIG terminal.  When SW1 is pushed, the 555 monostable is triggered and drives its output HIGH, causing the ADG419 to connect D to S2, which connects SW1 to the RESET pin on the 555 instead.  Pushing the button again pulls the 555's RESET pin low, which causes the 555's output to get pulled low, switching the ADG419 back to connecting SW1 to TRIGGER and starting the process over again.  The same logic holds if the 555 times out -- its output again goes low, causing the ADG419 to connect SW1 to TRIGGER.
(The original DG419 is available as well, and somewhat cheaper, if you can't get your paws on an ADG419.)
Answer:

simulate this circuit – Schematic created using CircuitLab
How about this schematic?. I think it should reset by the switch while the output is high. A small correction.
Comment: I think racing problem may arise. I will post an improved version in a few mins.
Answer:

simulate this circuit – Schematic created using CircuitLab
This also has a retrigger wait time equal to the One shot time but cuts the time short with the switch. It also has 10ms debounce filtering.

R2C2 = 10ms debounce time filter shown
Adjust T=1/(R3)C1 [s] for time constant while pressed (e.g. 10 s shown)
R2C1= retriggerable wait time to avoid repeat triggers (e.g 10s shown)

user must define all 3 values


What topics (software) can I ask questions about

Question: Can I ask questions in regards to software that's not necessarily main stream. I'm a developer of a ERP/inventory system and my clients wants to know if they can ask questions on stack overflow?
Comment: Are you looking to outsource your support questions to Stack Overflow, instead of hosting them yourself?
Comment: I think as long as they are programming related questions that would be fine. If it's how do I do this and that using GUI I think those would be off topic.
Comment: We have a support website but it came up in a discussion with a client, the client is also very technical and they use stack extensively. They wanted to know if they can ask question in regards to our software on stack. The only people that will be able to answer the questions will be clients and the us the developers of the product. The reason they want it in stack is because sometimes our problems relate to environment (windows IIS ect.) so when they search in stack its a one stop shop.
Answer: If you are asking your users to write code for you (for example through a proprietary scripting language), then you could probably make a tag here (reputation notwithstanding) and that would go over well. That's what after-effects is for, after all. You'd want to have a pretty substantial user-base under you, of course, but if it became a respected language in the community, I'd see no problem with that. You'd probably want to start off with your own forums first to build up to a point where a tag here wouldn't just generate unnecessary and unbeneficial noise. But I'll leave that explanation for another question.
However, if you're asking us whether it's acceptable to let your users post their tech support questions on Stack Overflow, that's an overwhelming no. Just as we would very quickly close the question "How can I change the margins of my Word document on a single page without affecting the others?" we will close your general, not-programming-related questions.
Seeing your comment now about wanting only clients and developers able to answer questions, that definitely won't fly. Not only is the system simply not built for that, but it also goes against the philosophy of the Stack Exchange network as a whole.
See: Why we're not customer support for [your favorite company]
And: What can I ask about?
Comment: Thx the answer is no, " However, if you're asking us whether it's acceptable to let users post their tech support questions on Stack Overflow, that's an overwhelming no "
Comment: @FrancoisTaljaard yep, unfortunately it sounds like you're looking for a self-hosted forum. I'm sure there are other frameworks that are built specifically for things like that which you could look into if need be.


Sodium Azide for Bullet Propellant?

Question: I'm considering alternatives to current gunpower or smokeless powders for bullet propellant.
I ran across Sodium Azide, used for airbags mainly.
If it is ignited, it starts a decomposition reactions which produces large quantities of N2 gas, fairly rapidly.
Would this be any use for bullet propellant, in any capacity(even for niche uses)? Would it be a drop in replacement for smokeless powder, or would additional chemicals need to be added to catalyze the reaction?
Answer: Sodium azide has some shortcomings

an electronic controller detonates this mixture during an automobile crash:
$2 NaN_3 → 2 Na + 3 N_2$.
The same reaction occurs upon heating the salt to approximately 300 °C. The sodium that is formed is a potential hazard alone and, in automobile airbags, it is converted by reaction with other ingredients, such as potassium nitrate and silica. In the latter case, innocuous sodium silicates are generated.

About its safety

Sodium azide has caused deaths for decades. It is a severe poison. It possesses the NFPA 704's highest rating of 4 on the health scale. It may be fatal in contact with skin or if swallowed. Even minute amounts can cause symptoms. The toxicity of this compound is comparable to that of soluble alkali cyanides. No toxicity has been reported from spent airbags.
Sodium azide solutions react with metallic ions to precipitate metal azides, which can be shock sensitive and explosive. This should be considered for choosing a non-metallic transport container for sodium azide solutions in the laboratory.

It would create a lot of hassle to handle and fire the ammos, and if you go for the sodium silicate path, it will give a nice white puff when firing.
Comment: Thank you for your detailed response! I mean given the toxicity, I would imagine shooting it out of a gun repeatedly would not be good for the person holding the weapon. Any less toxic chemical reactions similar to Sodium azide that create large amounts of gas without going the gunpowder/smokeless powder route?

Sodium Azide for Bullet Propellant?


How to debug a database connection in Visual Studio?

Question: Lets say someone gives you code that connects to the database. You are required to find which technology is used to connect to database (ADO, LINQ, etc) and the username and password of the database user.  How about will you debug it, where will you place your breakpoints?
Answer: To set a breakpoint, you'll need to find the code and your job will already be done. ;)
I'd start with checking any .config files for database connection information.  If that doesn't turn up anything, you don't need to debug the code necessarily. If it is written in any close-to-comprehensible fashion, you'll just need to look through the project structure for the "Model" code.  Perhaps do a Find in Visual Studio for using statements like "System.Linq" to find the classes that are using LINQ?  Or other connection technologies the developer might have used.


Can I prevent/restrict standard users from installing/uninstalling software?

Question: Can i prevent/restrict standard user from installing/uninstalling software in Ubuntu 12.04 desktop?
Answer: You have asked a lot of similar questions.
To install software you either need to be root a special account which is locked by default or an administrator.
In 12.04 and later administrators are part of the group sudo in previous versions it was admin.
You can check what groups a user belongs to by typing id in a terminal when logged on as that user or id username replacing username with the name of that user.  On my machine I see
warren@vb:~$ id
uid=1000(warren) gid=1000(warren) groups=1000(warren),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),108(lpadmin),124(sambashare),125(vboxsf)
warren@vb:~$ id joe
uid=1001(joe) gid=1001(joe) groups=1001(joe)
warren@vb:~$

Which shows I warren is an administrator and joe is not.
By default the first user created on the computer is an administrator; all others are not.  To stop someone being an administrator just make sure they are not in the sudo or admin group.  To make someone an administrator add them to the sudo group.
Answer: Can you?  Anything's possible when you put enough resources at it.  You can make the partition the users launch from a read-only partition.  Pretty restrictive, but that would solve that problem.
Also, there are application whitelisting solutions for Linux.  Those will block installations.
I think that the biggest question here is what you mean.  Do you mean "Using the OS, is it possible to..." or do you mean "using whatever means exists, how do I..."


How to use "theme"?

Question: When you want to ask for the theme to someone who is dressing up as something, which is the correct English? "what's the theme?","what's the theme of?" or anything else more natural expressions??
Comment: I've never seen *theme* used this way (but maybe that's because it means something, several somethings, else in my worlds). Do you mean "Who you / Whatchu dressed as?"
Comment: Do you mean *formal* vs *informal* attire? Or, like a Halloween party?
Comment: What is the **occasion**?
Comment: This is a facebook occasion.. my friend put on her photo that she dressed up as a baby(maybe). so, I just wanted to ask her about it. Sorry to my question here was not very clear..
Answer: I have certainly heard and used "theme" in this way (ie, a theme party, aka a costume party). A Google search brings up many hits for this.
The correct way if you are asking about a party that has already been would be "What was the theme"? Or, for an upcoming party, "What's the theme?" is fine.
Of course, not all parties are theme parties, so then "Is there a theme?" is best.
Using "costume party" is a little different -- you would still say "What is the theme?" and not "What is the costume?" (unless you mean to ask who/what someone is dressed up as) but "Is/was it a costume party?" is fine.

How to use "theme"?


Working on original calculations versus reading papers

Question: I am a beginning phD student in theoretical physics trying to understand how the research process works. I have been wondering how top physicists/scientists actually do research. I would like to work on specific problems and original calculations. However, I find that I would also want to understand how other physicists think about problems/ what the core ideas in my field are by trying to read the original papers in the subject. I am struggling with this process. How to find the balance between reading important papers in my field (older papers with a large number of citations), recent papers, and working on my own calculations. How can I find a problem to work on? I wonder if experienced researchers can give advice on this.
Comment: This is the sort of question that is far better directed towards your thesis advisor; the balance will depend a lot on *you* and your project and where you're at.
Comment: If you're a *beginning* graduate student in theoretical physics, you probably still have a lot to learn from reading before you can produce original calculations.
Comment: Too many questions.  I tell my students only to go into the in the literature when they have a specific question in mind.  Otherwise, it is not practical to read everything under the sun.   Also your supervisor is also a good source of questions; e.g., has anybody done X?
Comment: This is an extremely broad question.  Are you doing experiment?
Answer: This is only a partial answer to your question perhaps, but I'm two years into my PhD and this is a question I've asked myself for a long time. I guess part of the answer is to go get to work on specific problems, read what you need to solve those, and over time you'll get a sense of what is relevant more generally in the context of your PhD. You'll find that the amount of literature — both published in the past and published every day right now — is astronomical, so one of the caveats will be to really narrow down what you want to read. This is only possible once you really get a sense of what is relevant for your PhD ; over time you'll realize some "general" stuff (e.g. reading generalist manuals for field X and/or theory A) will be essential to your success — while other "general" stuff still related to your field won't be. For instance, I'm in astrophysics, and I can't even imagine how much time reading everything about astrophysics (both published in the past and published right now) would take. You have to focus on your subspecialty, then go broader as you feel the broader stuff is still essential for your research.
Hope that helps a bit!
Answer: You will not earn a PhD in sciences for work done in a vacuum. Alternatively said, no one will care about your original calculations unless they contribute to the existing body of knowledge in a way that advances our scientific understanding or solves a problem. Alternatively said, how will you know that your calculations are original unless you know the body of calculations that have already been done and can acceptably demonstrate that you are truly filling the holes that exist in the already-existing calculations?
As paraphrased from somewhere ... "This PhD defense presents much new and interesting work. Unfortunately, what is new is not interesting, and what is interesting is not new".
In summary, directed to your title, you must not only read literature in your chosen field but also comprehend and put its results in fullest context before you can discover something "original" to do, let alone before you should define how to work on that original idea successfully to earn a PhD.
As to your broader question about how the research process "works", I would close with a synopsis paragraph.
The research process to earn a PhD is not linear or amenable to a consistent, directed road map going from point A (stepping in to it) to point B (ending it successfully). If it was as such, anyone might simply propose to buy a recipe book and get a PhD by completing the steps in its pages. The research process to earn a PhD can include starts, stops, dead ends, and breakthroughs. The process can include short or long bursts of studied literature review, construction or formulation of ideas, and experiments or analysis. The process can encompass ideas gleaned both from the most recent publications in the field as well as from those considered classics in the field. The various stages in PhD research (literature review, idea/hypothesis formulation, experiments or analysis, reporting) can be done sequentially, in purposeful isolation, or in parallel depending on the resources available, time commitments possible, or skills/training at hand. The sequence (review, formulate, experiment/analyze, report) and the path (sequential/parallel) can change at any moment in time, again depending on what currently might be limiting progress for the final work that is needed. Finally, the process can be intimately personal and unique. However it must not be done in a vacuum, especially not in one that purposefully excludes mentors, colleagues, and peers.


sever/kill tcp connection in windows

Question: I would like to see how a program responds when it's connection is severed.  Aside from disabling the network card, is there a way to sever a tcp connection in Windows without killing the process, or the thread that owns the connections?
Answer: The closest thing that I've found to generating an OS error is to use something like TcpView to look at what sockets are open and sever them. I'm not sure exactly what it does to sever the connection, but it does close it in a way that an application can see.
Answer: TCPView by SysInternals lets you close a connection (and see all open connections).
Answer: One thing I've seen done is to have the network code written in such a way that a connection can be severed remotely. A product I once worked on was written that way. We even had a set of torture tests that would randomly break the connections. The product was meant to be transactional, and it was instructive to see how it behaved.
Of course, we then found a customer whose network was actually breaking connections all the time, and were very glad we'd tested so hard.
Answer: Why not just unplug the network cable?

sever/kill tcp connection in windows


Multiple accounts and "cross-pollination" detection?

Question: Multiple accounts on SO are merged if they share the same IP/OpenID/etc. However, is there a way to analyze upvotes statistics to detect "cross-pollination" of some accounts which regularly upvote each other? I.e. some new user spends most of the upvotes upvoting the answers of the other for some long period of time. Is there a tool do detect it?
Comment: Cross pollination? Do you mean voting rings?
Comment: @FrédéricHamidi - I can see a comment thread starting here, finding more poetic versions... If someone can figure out one with Unicorns and rainbows ;)
Comment: *Multiple accounts on SO are merged if they share the same IP.* Err, no, they're merged if and only if "cross-pollination" is detected between the accounts. In other words, we already do what you're looking for.
Comment: @Oded, every time I read this I think of some hack-n-eyed gangsters meeting in a shady bar to discuss how many votes they will fix that day. "Cross-pollination" has a more poetic feel to it ;)
Answer: Multiple accounts are not necessarily merged, and certainly not automatically. You are allowed to have multiple accounts as long as you do so responsibly and follow some basic ground rules.
Moderators will only manually merge user accounts if there is evidence that they are violating those ground rules, for example conspiring to commit vote fraud.
So yes, these "cross-pollenation" tools that you describe do exist, but they are only available to ♦ moderators because they are based on statistical information about voting and other patterns that we don't want to fall into the wrong hands.
And not all of them even require moderator intervention. For example, there is a process that runs every 24 hours to detect and automatically reverse instances of vote fraud.
Comment: @Bart Moderators can't merge accounts anymore, they can only request SE to do so on behalf of a user. But for sock puppets we generally just nuke the accounts now instead of merging.
Comment: Do moderators still merge accounts? I was somehow under the impression they would no longer do so?
Comment: Ah thanks @MadScientist. I knew I read something along those lines before.


Melted ground wires together

Question: 4 can lights not working.  Found (with a voltage pen tester) that the neutral is hot in the cans and at both 3-way switches. Pulled the wires and the switches from the boxes. Used a digital volt meter, found the neutral lines and one hot wire at, both switch locations, read 119v when checked with the ground wire. In the panel box I found 2 ground wires melted together just before they go into the bus-bar. Can this cause the hot neutral wires?
Comment: I'm thinking this is beyond D.I.Y.  and you need to hire someone who knows their stuff.
Comment: Tick testers or non contact voltage  testers are no good here, 2 wires in parallel 1 hot and one not connected to anything , the one not connected to anything will show hot in many cases, look up phantom voltage.  If this house is older than 5 years there was no neutrals in those boxes but a pair of travelers. More info is needed, number and color of wires in each switch location and light fixture. It's not hard and their are many answers on this topic. White wires are Not always neutral , in some cases the white was an always hot bu code in a switch leg. So jack may be right but more info!
Comment: If neutral is hot, what is hot doing?
Comment: Maybe you mean "soldered" as melting would be 1800+F and caused more the voltage problems.
Answer: Reading your question I think you have or had a high resistance joint in your panel on the neutral. In general electrical circuits in your residence wire all loads in parallel. This distributes amperage through each light fixture and the voltage remains the same.
If you had a loose connection of the neutrals at the panel this actually becomes a load in series with the rest of the circuit. The high resistance at that point would cause a voltage drop building up heat and melting your insulation. It would also show voltage on the neutral before it dropped at the joint.
I can't say that this is the only problem on your circuit but you must clean this up before trouble shooting any other problem that may be on the circuit. Make sure the circuits on the neutral are off then disconnect the neutral from the bus. Clean off any melted insulation, and clean the conductor so it looks "like a new penny". Make sure that when you reattach the neutral to the bus that it is also clean of and burning or corrosion. Make sure the neutral is mechanically and electrically secure to the bus. Then turn your circuit back on and see if there are any other problems.
Hope this helps and good luck.
Comment: Thanks for your knowledge sharing. At first I thought it was a ground wire that had melted but it was actually the neutral and ground. Both were going into the same spot on the bus. Clipped them both back to good wire and put them in different spots on the bus. I think you nailed it with the loose connection. The neutral fell out of the bus when I touched the lock down screw. Went over all the connections in the breaker box and found others that tightened up. I also found one of the 3-way switches ungrounded. Thanks again for sharing your knowledge.

Melted ground wires together


Drag-and-Drop functionality in Rally Tables

Question: I need to allow the re-ranking of the stories by implementing the drag-and-drop function inside the rally tables that I have created. How may I implement the drag-and-drop buttons that is available from rally into my rally app using the rally tables?
Answer: Unfortunately right now the App SDK's Table component does not support drag and drop re-ranking.  However we will be releasing a more powerful Grid component in the next version of the App SDK this spring/summer that will likely include this functionality.
Answer: You can enable drag and drop ranking under:
Setup --> Workspace + Projects --> Edit Workspace --> Rank Method
More info here.