Any interest in crewed mission to Mars without landing?

Question: Would there be any interest in a manned mission to Mars without landing?
This could consists of none (just a flyby) to many revolution(s) around the planet.
Would it cut a consequent part of the cost compared to a landing and return mission?
Comment: What would be the point to such a mission? Humans *on* Mars can do useful science - prospecting for samples, lab analysis, etc.. In orbit, about the *only* benefit I could see is shorter delay time for teleoperation of a robotic surface vehicle. Given the hazards and risks to the crew after going that far, they really ought to be present where the science is going to be performed - on the surface.
Comment: @AnthonyX you could explore Phobos and Deimos
Answer: Yes, there is interest, at least from some quarters. The Planetary Society proposes an orbit-first strategy for humans at Mars as part of an affordable plan to make progress and build capability. Yes, putting humans into orbit around Mars and returning from there would be much, much cheaper than landing them and getting them back off the surface.
While there, the crew could teleoperate rovers on Mars far, far more capably than we can do from Earth due to the light-time difference. The rovers themselves would be much more advanced than what we have today, and would be able to explore wider ranging, diverse terrains across the planet, more than the humans on a single landed mission could. The crew can also land on the moons of Mars and explore more directly there, both for science and for resource prospecting.
I see here heartfelt concerns for the astronauts taking all that risk without sufficient reward. You can set your concerns aside. I am confident that you will find many extremely highly qualified candidates who are willing to go on a Mars orbit and Mars moon rendezvous mission.
Answer: Do you know the names of the first humans who landed on the Moon? Yes! Armstrong and Aldrin, of course. (and if you scratch your head a little, you remember Collins in orbit too).
Do you know the names of the first who orbited the the Moon? (Borman, Lovell and Anders). Less likely. My point is: If you later land on Mars, people forget about the first mission. And if you do not follow up with a landing, people feel like you have cheated.
From a technical point of view, such a mission is just a long stay on a single use space station, without the possibility of a return in case of an emergency. On the other side, the technology is pretty much off-the-shelf. The much lower $\Delta v$ requirements and lower complexity are undoubtely cutting a large part of the cost too.
In short, a moderate risk, high cost voyage, with only a small reward.
Comment: Yet if they land on Mars, they can only touch it through their gloves, and see it through their visor. What if the gloves and the visor were on the surface, but they were in Mars orbit? The gloves have tactile feedback to their hands, and the visor has even better vision than they would. Now they can explore Mars from Mars orbit much more cheaply, and cover far more ground, exploring many more places on Mars than they would be able to by landing. Due to light time delays, they can't do this from Earth. Only from Mars orbit. Now is it worthwhile?
Comment: Isn't that the original question?
Comment: @MarkAdler No, not human spaceflight in general. I made "there is no point in that" answer, which, as you state, has some pitfalls regarding the "why the monkeys?" aspect of spaceflight.
Comment: @MarkAdler I see your point :) But this is perhaps not the best place for a discussion about what the purpose of human spacetravel  is anyway.
Comment: Personally I'm not convinced that the notability of whoever does the mission is really relevant to the question. Of course your answer shows that this opinion is not universal. Meanwhile I reckon that the technological gap between the two missions (the non landing one and the landing one) is so wide that it is more likely that we remember the names of the crew members of the non landing mission than the names of the first people who flew around the Moon. Maybe not enough to be as memorable as Gagarin or Armstrong & Aldrin though.
Answer: I think if a mission was to be sent to Mars without the intention of landing, there could be a great deal of science and hardware development that could be done by landing on Phobos (escape velocity ~41km/hr).
According to one NASA proposal:
Precursor missions to the surface of Phobos prior to undertaking human Martian surface operations would allow for a continuation in the phased approach of development, implementation, and in-situ testing/experience of the necessary hardware for an eventual Mars surface mission.
This plan calls for development of surface habitat/landing vehicle and a rover vehicle which could later be used on future missions to the Martian surface.
Also, the Caltech Space Challenge in 2013 did some interesting development work on a Phobos mission. They devised a plan using 11 Spacex launches to assemble the mission hardware in LEO, with a total mission duration of ~450 days. However this plan does involve a "nuclear propulsion unit" which may need a bit of development work first.
Answer: When a crew would arrive in the proximity of Mars (during a flyby) or enter its orbit, they'd be unable to return to Earth because, from a heliocentric point of view, the Earth goes faster around the Sun as it's closer. Therefore, the crew would either also have to go around the Sun and even faster (which requires a lot of fuel) or make a swing-by around Mars and go the opposite direction (which would also require a lot of fuel to decelerate near the Earth). The longer they stay in Martian orbit the more fuel they'd need for returning to Earth. Therefore a Mars flyby would be the better option than orbital insertion.
The first space tourist Dennis Tito founded Inspiration Mars - A Mission for America to make a married couple representing mankind go around Mars in a flyby as described above in the first option: by going on around the Sun eventually "catching up" with Earth again. Inspiration Mars Foundation
Tito's concepts were never considered much by any space agency and the Foundation is seemingly dissolved, their webpage defunct and, unfortunately, it won't be realized by Inspiration Mars.
But it would more reasonable that the first manned flight to Mars also aims to land there. A crew would fly to Mars about six months, stay on Mars an (Earth's) year until the planets are going to "meet" each other again and fly back to Earth another six months. That's risky, and perhaps by nuclear pulse propulsion it would be better to go to Mars in both flybys and landing missions, such a Mars flight would take by far not as long as a conventional one. And a Venus flyby would be easier than one around Mars and might perhaps be carried out first.


Z-axis not moving up

Question: I'm near the end of the build of a i3 MK2 clone and have run into a problem with the Z-axis motors. Specifically, the Z-axis will move down (and trigger the endstop) but it will only make a quick noise if I try to move it up.
M119 shows all endstops open.  Min software stops are currently disabled, as I try to set the printer up. Using Marlin 1.1.3 with a RAMPS 1.4. Both motors turn and I've even uncoupled the entire X-axis carriage.
Additional test: reversed the z-axis motor wires and they only go up. Inverted the motor direction in software and they also only go up.
Any advice? I've definitely done a few searches but haven't solved the problem.
Config.h is as follows (clipped due to posting restrictions):
//===========================================================================
//============================== Endstop Settings ===========================
//===========================================================================

// @section homing

// Specify here all the endstop connectors that are connected to any endstop or probe.
// Almost all printers will be using one per axis. Probes will use one or more of the
// extra connectors. Leave undefined any used for non-endstop and non-probe purposes.
#define USE_XMIN_PLUG
#define USE_YMIN_PLUG
#define USE_ZMIN_PLUG
//#define USE_XMAX_PLUG
//#define USE_YMAX_PLUG
//#define USE_ZMAX_PLUG

// coarse Endstop Settings
//#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors

#if DISABLED(ENDSTOPPULLUPS)
  // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
  //#define ENDSTOPPULLUP_XMAX
  //#define ENDSTOPPULLUP_YMAX
  //#define ENDSTOPPULLUP_ZMAX
  //#define ENDSTOPPULLUP_XMIN
  //#define ENDSTOPPULLUP_YMIN
  //#define ENDSTOPPULLUP_ZMIN
  //#define ENDSTOPPULLUP_ZMIN_PROBE
#endif

// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
#define Y_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
#define X_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
#define Y_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
#define Z_MAX_ENDSTOP_INVERTING false // set to true to invert the logic of the endstop.
#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the probe.

// Enable this feature if all enabled endstop pins are interrupt-capable.
// This will remove the need to poll the interrupt pins, saving many CPU cycles.
//#define ENDSTOP_INTERRUPTS_FEATURE

//=============================================================================
//============================== Movement Settings ============================
//=============================================================================
// @section motion

/**
 * Default Settings
 *
 * These settings can be reset by M502
 *
 * Note that if EEPROM is enabled, saved values will override these.
 */

/**
 * With this option each E stepper can have its own factors for the
 * following movement settings. If fewer factors are given than the
 * total number of extruders, the last value applies to the rest.
 */
//#define DISTINCT_E_FACTORS

/**
 * Default Axis Steps Per Unit (steps/mm)
 * Override with M92
 *                                      X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]]
 */
#define DEFAULT_AXIS_STEPS_PER_UNIT   { 100, 100, 4000, 120 }

/**
 * Default Max Feed Rate (mm/s)
 * Override with M203
 *                                      X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]]
 */
#define DEFAULT_MAX_FEEDRATE          { 200, 200, 3, 25 }

/**
 * Default Max Acceleration (change/s) change = mm/s
 * (Maximum start speed for accelerated moves)
 * Override with M201
 *                                      X, Y, Z, E0 [, E1[, E2[, E3[, E4]]]]
 */
#define DEFAULT_MAX_ACCELERATION      { 3000, 3000, 100, 10000 }

/**
 * Default Acceleration (change/s) change = mm/s
 * Override with M204
 *
 *   M204 P    Acceleration
 *   M204 R    Retract Acceleration
 *   M204 T    Travel Acceleration
 */
#define DEFAULT_ACCELERATION          3000    // X, Y, Z and E acceleration for printing moves
#define DEFAULT_RETRACT_ACCELERATION  3000    // E acceleration for retracts
#define DEFAULT_TRAVEL_ACCELERATION   3000    // X, Y, Z acceleration for travel (non printing) moves

/**
 * Default Jerk (mm/s)
 * Override with M205 X Y Z E
 *
 * "Jerk" specifies the minimum speed change that requires acceleration.
 * When changing speed and direction, if the difference is less than the
 * value set here, it may happen instantaneously.
 */
#define DEFAULT_XJERK                 10.0
#define DEFAULT_YJERK                 10.0
#define DEFAULT_ZJERK                  0.4
#define DEFAULT_EJERK                  2.0

//===========================================================================
//============================= Z Probe Options =============================
//===========================================================================
// @section probes

//
// See http://marlinfw.org/configuration/probes.html
//

/**
 * Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
 *
 * Enable this option for a probe connected to the Z Min endstop pin.
 */
#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN

/**
 * Z_MIN_PROBE_ENDSTOP
 *
 * Enable this option for a probe connected to any pin except Z-Min.
 * (By default Marlin assumes the Z-Max endstop pin.)
 * To use a custom Z Probe pin, set Z_MIN_PROBE_PIN below.
 *
 *  - The simplest option is to use a free endstop connector.
 *  - Use 5V for powered (usually inductive) sensors.
 *
 *  - RAMPS 1.3/1.4 boards may use the 5V, GND, and Aux4->D32 pin:
 *    - For simple switches connect...
 *      - normally-closed switches to GND and D32.
 *      - normally-open switches to 5V and D32.
 *
 * WARNING: Setting the wrong pin may have unexpected and potentially
 * disastrous consequences. Use with caution and do your homework.
 *
 */
//#define Z_MIN_PROBE_ENDSTOP
//#define Z_MIN_PROBE_PIN Z_MAX_PIN

/**
 * Probe Type
 *
 * Allen Key Probes, Servo Probes, Z-Sled Probes, FIX_MOUNTED_PROBE, etc.
 * You must activate one of these to use Auto Bed Leveling below.
 */

/**
 * The "Manual Probe" provides a means to do "Auto" Bed Leveling without a probe.
 * Use G29 repeatedly, adjusting the Z height at each point with movement commands
 * or (with LCD_BED_LEVELING) the LCD controller.
 */
//#define PROBE_MANUALLY

/**
 * A Fix-Mounted Probe either doesn't deploy or needs manual deployment.
 *   (e.g., an inductive probe or a nozzle-based probe-switch.)
 */
#define FIX_MOUNTED_PROBE

/**
 * Z Servo Probe, such as an endstop switch on a rotating arm.
 */
//#define Z_ENDSTOP_SERVO_NR 0   // Defaults to SERVO 0 connector.
//#define Z_SERVO_ANGLES {70,0}  // Z Servo Deploy and Stow angles

/**
 * The BLTouch probe uses a Hall effect sensor and emulates a servo.
 */
//#define BLTOUCH
#if ENABLED(BLTOUCH)
  //#define BLTOUCH_DELAY 375   // (ms) Enable and increase if needed
#endif

/**
 * Enable if probing seems unreliable. Heaters and/or fans - consistent with the
 * options selected below - will be disabled during probing so as to minimize
 * potential EM interference by quieting/silencing the source of the 'noise' (the change
 * in current flowing through the wires).  This is likely most useful to users of the
 * BLTouch probe, but may also help those with inductive or other probe types.
 */
//#define PROBING_HEATERS_OFF       // Turn heaters off when probing
//#define PROBING_FANS_OFF          // Turn fans off when probing

// A probe that is deployed and stowed with a solenoid pin (SOL1_PIN)
//#define SOLENOID_PROBE

// A sled-mounted probe like those designed by Charles Bell.
//#define Z_PROBE_SLED
//#define SLED_DOCKING_OFFSET 5  // The extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.

//
// For Z_PROBE_ALLEN_KEY see the Delta example configurations.
//

/**
 *   Z Probe to nozzle (X,Y) offset, relative to (0, 0).
 *   X and Y offsets must be integers.
 *
 *   In the following example the X and Y offsets are both positive:
 *   #define X_PROBE_OFFSET_FROM_EXTRUDER 10
 *   #define Y_PROBE_OFFSET_FROM_EXTRUDER 10
 *
 *      +-- BACK ---+
 *      |           |
 *    L |    (+) P  | R <-- probe (20,20)
 *    E |           | I
 *    F | (-) N (+) | G <-- nozzle (10,10)
 *    T |           | H
 *      |    (-)    | T
 *      |           |
 *      O-- FRONT --+
 *    (0,0)
 */
#define X_PROBE_OFFSET_FROM_EXTRUDER 22  // X offset: -left  +right  [of the nozzle]
#define Y_PROBE_OFFSET_FROM_EXTRUDER 12  // Y offset: -front +behind [the nozzle]
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0   // Z offset: -below +above  [the nozzle]

// X and Y axis travel speed (mm/m) between probes
#define XY_PROBE_SPEED 8000

// Speed for the first approach when double-probing (with PROBE_DOUBLE_TOUCH)
#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z

// Speed for the "accurate" probe of each point
#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)

// Use double touch for probing
//#define PROBE_DOUBLE_TOUCH

/**
 * Z probes require clearance when deploying, stowing, and moving between
 * probe points to avoid hitting the bed and other hardware.
 * Servo-mounted probes require extra space for the arm to rotate.
 * Inductive probes need space to keep from triggering early.
 *
 * Use these settings to specify the distance (mm) to raise the probe (or
 * lower the bed). The values set here apply over and above any (negative)
 * probe Z Offset set with Z_PROBE_OFFSET_FROM_EXTRUDER, M851, or the LCD.
 * Only integer values >= 1 are valid here.
 *
 * Example: `M851 Z-5` with a CLEARANCE of 4  =>  9mm from bed to nozzle.
 *     But: `M851 Z+1` with a CLEARANCE of 2  =>  2mm from bed to nozzle.
 */
#define Z_CLEARANCE_DEPLOY_PROBE   10 // Z Clearance for Deploy/Stow
#define Z_CLEARANCE_BETWEEN_PROBES  5 // Z Clearance between probe points

// For M851 give a range for adjusting the Z probe offset
#define Z_PROBE_OFFSET_RANGE_MIN -20
#define Z_PROBE_OFFSET_RANGE_MAX 20

// Enable the M48 repeatability test to test probe accuracy
//#define Z_MIN_PROBE_REPEATABILITY_TEST

// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
// :{ 0:'Low', 1:'High' }
#define X_ENABLE_ON 0
#define Y_ENABLE_ON 0
#define Z_ENABLE_ON 0
#define E_ENABLE_ON 0 // For all extruders

// Disables axis stepper immediately when it's not being used.
// WARNING: When motors turn off there is a chance of losing position accuracy!
#define DISABLE_X false
#define DISABLE_Y false
#define DISABLE_Z false
// Warn on display about possibly reduced accuracy
//#define DISABLE_REDUCED_ACCURACY_WARNING

// @section extruder

#define DISABLE_E false // For all extruders
#define DISABLE_INACTIVE_EXTRUDER true // Keep only the active extruder enabled.

// @section machine

// Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
#define INVERT_X_DIR false
#define INVERT_Y_DIR false
#define INVERT_Z_DIR false

// Enable this option for Toshiba stepper drivers
//#define CONFIG_STEPPERS_TOSHIBA

// @section extruder

// For direct drive extruder v9 set to true, for geared extruder set to false.
#define INVERT_E0_DIR false
#define INVERT_E1_DIR false
#define INVERT_E2_DIR false
#define INVERT_E3_DIR false
#define INVERT_E4_DIR false

// @section homing

//#define Z_HOMING_HEIGHT 4  // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
                             // Be sure you have this distance over your Z_MAX_POS in case.

// Direction of endstops when homing; 1=MAX, -1=MIN
// :[-1,1]
#define X_HOME_DIR -1
#define Y_HOME_DIR -1
#define Z_HOME_DIR -1

// @section machine

// Travel limits after homing (units are in mm)
#define X_MIN_POS 0
#define Y_MIN_POS 0
#define Z_MIN_POS 0
#define X_MAX_POS 230
#define Y_MAX_POS 200
#define Z_MAX_POS 200

// If enabled, axes won't move below MIN_POS in response to movement commands.
//#define MIN_SOFTWARE_ENDSTOPS
// If enabled, axes won't move above MAX_POS in response to movement commands.
//#define MAX_SOFTWARE_ENDSTOPS

/**
 * Filament Runout Sensor
 * A mechanical or opto endstop is used to check for the presence of filament.
 *
 * RAMPS-based boards use SERVO3_PIN.
 * For other boards you may need to define FIL_RUNOUT_PIN.
 * By default the firmware assumes HIGH = has filament, LOW = ran out
 */
//#define FILAMENT_RUNOUT_SENSOR
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
  #define FIL_RUNOUT_INVERTING false // set to true to invert the logic of the sensor.
  #define ENDSTOPPULLUP_FIL_RUNOUT // Uncomment to use internal pullup for filament runout pins if the sensor is defined.
  #define FILAMENT_RUNOUT_SCRIPT "M600"
#endif

Answer: UPDATE:  Turns out to have been a faulty RAMPS.  Replaced the card and made NO changes; z-axis is now behaving properly.  Thank you all.
Answer: This sounds similar to Prusa i3 Z axis only goes down (even on up command) and My Prusa i3's z-axis will only go up. Please check the answers to those questions.
The usual cause of your problem is that you need to:

install/configure the end stops, and;
home the Z-axis.

You say that you have already installed ad configured the end stops. Have you homed it yet, though?
However, check your wiring first as it could just be a simple case of a loose or misplaced connection.
Also, something else to consider, if your stepper is making a grunting noise, and trying to move but can not, then maybe your stepper driver is not supplying enough current, or maybe too much. See my answer to Extruder stepper motor problem, what can be wrong?. Yes, the answer is for an extruder, but all steppers drivers can suffer the same mis-configuration.
Comment: Thanks Greenonline.  Yes, I've homed the system.  Proterface even counts up mm in the z-axis when I try to move it, but it does not physically move. When I reversed the z-axis direction in software, the carriage DOES move up, but not down; so it does not seem to be a too little current issue.
Answer: If the carriage is moving in one direction but not the other is seems like a stepper driver problem to me. Or possibly a electrical contact problem as the stepper drvers have one pin each (pin DIR) to control the direction of the stepper.
Have you tried to change the drivers on your RAMPS 1.4? I suggest you temporarily change the stepper driver with an axis you know functions.
Comment: Thanks, Axel.  Sure have tried swapping the drivers.  I'm beginning to suspect that it could just as easily be the RAMPS.

Z-axis not moving up


MariaDB 10 Galera Cluster or Downgrade?

Question: i have some questions about MariaDB. Maybe anyone can help me.
I have two servers and want to loadbalance via DNS (Round Robin). Round Robin is configured.
Now i want to setup a multi master replication with MariaDB. The Problem that i have is i already have installed on the first server MariaDB in the version 10, but i saw that MariaDB Galera Cluster is only available for 5.5. What would be the best way to setup the MariaDB Galera Cluster? Downgrade or is a Cluster Version for 10 available?
Answer: I had a similar realization recently.  MariaDB 10 is really nice but there is currently no stable release with galera.  There is an alpha release (10.0.7) and it looks like a stable release may be available relatively soon.  For now, though, you should use the 5.5 line.

MariaDB 10 Galera Cluster or Downgrade?


Arduino 3 digit LCD calculator

Question: We would like to build a calculator using Arduino which uses 3 digit LCD and a keypad similar to digital phones. (# for plus , * for minus) Which components and way is good enough to not to run out of I/O ports?
Comment: With some care, you can share either the rows or columns between the display and the keyboard.
Comment: thank you very much for all answers and comments. It is my bad to not be able to check here again. We have designed the board from scratch , using the same model atmel processor on arduino uno.
Answer: Check this arduinoo calculator kit:
http://www.spikenzielabs.com/Downloadables/calc/CalcBuildInstructions.pdf
Software and hardware is open source. They manages to connect 17 buttons and 6 digits LED. Wiring and sketch is very easy to understand
Answer: Not know which arduino you use, or the total number of pins you need, the basic answer is Shift Registers or (i2c/spi) Port Expanders. More specialized versions would be 7 segment led drivers (if you are using led 7 segment displays obviously), and keypad matrix ICs. If you are using actual lcd displays, it would highly depend on the display and/or controller for the display.
Comment: He is probably looking for shields.

Arduino 3 digit LCD calculator


A database for RefSeq protein accession IDs

Question: Are there any databases or tools that contain a list of all RefSeq protein IDs for the interest organism/microorganism, e.g. get a specific microorganism name and return all RefSeq Protein IDs that have been identified?
Comment: Please consider accepting the answer below - its good for site stats and its a good answer IMO
Answer: How about using RefSeq itself? Say, you are interested in all E. coli proteins, you can use the query "Escherichia coli"[Organism] AND RefSeq[Filter] here.
If you know the Taxonomy identifier for the specific organism of interest to you, it can also be used. For example, if you are interested in only "Escherichia coli str. K-12 substr. DH10B", you can use the taxonomy identifier 316385 (obtained from here) in the query txid316385[Organism] AND RefSeq[Filter].
To extract a list of accessions and save them to a file on disk, use the "Send To" menu at the top right corner, choose "File" as destination followed by "Accession List" as the format and download the file. Alternatively, you can use E-utilities API or the EntrezDirect tool on the Unix command line to download these data programmatically.
To address the question about E. coli proteins shared between different species... There's no need to parse FTP files to get all the RefSeq proteins for a bacteria species. While it's true that some RefSeq WP proteins have taxids above species level, like Enterobacterales WP_003861789.1 where the identical protein is found in genomes from multiple species of the order Enterobacterales, those proteins are still retrieved by a species-level organism search. NCBI implemented some extra handling for the RefSeq WP proteins to treat the MULTISPECIES WPs like they belong to all of the species with genomes on which they're annotated. So of the 56947 WPs assigned as "Bacteria", 7401 are found by "Escherichia coli"[Organism], and the species-level search will give you the full set of proteins.
You could also use the AutonomousProtein2Genomic.gz file from the RefSeq FTP path which has a mapping of how all WPs map to specific genomic sequences, but it's a really big file and it would take a long time to grep for "Escherichia coli".
Comment: Thanks warmly for the response.
Actually, I was looking for a database in which I can extract all RefSeq protein IDs as a .csv or .xls file.
Comment: I would say,suggested query is not working as expected for refseq.Some escherichia coli refseq proteins have "lower" taxonomy rank ,for example ""Escherichia- proteins which shared between different Escherichia species.Technically ,I know only one way for now extract ALL Escherichia Coli refseq proteins
Comment: retrieve all corresponding refseq assemblies from ftp and parse them


Energy-Momentum Tensor under Lorentz Transformation

Question: In relativity, the symmetric energy-momentum tensor is given by
$$
T^{ij},
$$
where $T^{00}$ is the energy density and $\frac{1}{c}T^{10}$ is the momentum density. Thus:
$$ \left(\frac{1}{c}T^{00}dV, \frac{1}{c}T^{10}dV\right)^{T}$$
is the 4-momentum.
Under a Lorentz transformation, this should transform like 4-vectors where
$$ \frac{1}{c}T^{00}dV= \left[\frac{1}{c}T'^{00}dV'+\frac{v}{c^2}T'^{10}dV'\right] \left( 1-\frac{v^2}{c^2}\right)^{-1/2}\\dV=dV'\sqrt{1-\frac{v^2}{c^2}}.$$
After simplifications, we have:
$$ T^{00}= \left[T'^{00}+\frac{v}{c}T'^{10} \right] \left( 1-\frac{v^2}{c^2}\right)^{-1}$$
But if we apply the Lorentz transformation to the tensor directly we get
$$ T^{00}= \left[T'^{00}+\frac{v}{c}T'^{10}+\frac{v^2}{c^2}T\
^{11} \right]\left( 1-\frac{v^2}{c^2}\right)^{-1}$$
What accounts for the difference? I think the first is wrong but have no idea why.
Answer: One really doesn't talk about components of the Stress-Energy tensor being momentum densities.  Instead, you think about projections on vectors.  So, the energy density observed by a timelike observer with 4-velocity $u^{a}$ is given by
$$j^{a}=T^{a}{}_{b}u^{b}$$
Now, when you boost, you have two choices.  You can either boost to a new reference frame, and still look at the density observed with our original observer, which then means you have to boost $u^{a}$ as well:
$$\begin{align}
j^{\prime}{}^{a} &= \Lambda^{a}{}_{c}\Lambda_{b}{}^{d}T^{c}{}_{d}\left(\Lambda^{b}{}_{e}u^{e}\right)\\
&= \Lambda^{a}{}_{c}\Lambda_{e}{}^{d}T^{c}{}_{d}u^{e}
\end{align}$$
OR, we could measure the stress energy tensor as observed by someone who has a four velocity $v^{a}$ which has the same components as $u^{a}$, but in the boosted frame (i.e., $v^{a} = \Lambda^{-1}{}^{a}{}_{c}u^{c}$).  Then, we have:
$$\begin{align}
j^{\prime}{}^{a} &= \Lambda^{a}{}_{c}\Lambda_{b}{}^{d}T^{c}{}_{d}\left(v^{b}\right)\\
&= \Lambda^{a}{}_{c}\Lambda_{b}{}^{d}T^{c}{}_{d}\left(\Lambda^{-1}{}^{b}{}_{e}u^{e}\right)\\
&=\Lambda^{a}{}_{c}\delta_{e}{}^{d}T^{c}{}_{d}u^{e}\\
&=\Lambda^{a}{}_{c}T^{c}{}_{d}u^{d}\\
\end{align}$$
As you can see, the two factors differ by a factor of the lorentz transformation, and most critically, you need the two factors of the lorentz transformation to mix in the $T_{11}$ component into the momentum density.
Answer: Let $\textbf{u},\textbf{w}$ be the four velocities of observers at rest in the original and primed frames, respectively. Let $\Delta V$ be a small volume in $\textbf{u}$'s frame, and let $\Delta p^{\mu}$ be the total amount of four momentum contained in $\Delta V$. $\Delta p^{\mu}$ is also expressible as $T^{\mu0}\Delta V=T^{\mu\alpha}(u_{\alpha}\Delta V)$ - the flux of $T\cdot\textbf{d}x^{\mu}$ through an oriented (in the direction of $\textbf{u}$) hypersurface $\Delta V$.
When you perform a Lorentz transformation on the volume $\Delta V$ to obtain $\Delta V'$ the components of the volume's orientation also transform. The total four momentum in $\Delta V'$, oriented with $\textbf{u}$, is: $$\Delta p'^{\mu}=T'^{\mu\alpha}(u'_{\alpha}\Delta V')=T^{\sigma \rho}\Lambda^{\mu'}_{\sigma}\Lambda^{\mu'}_{\rho}\Lambda^{\beta}_{\mu'}u_{\beta}\Delta V'=\left(\frac{\Delta p^{\sigma}}{\Delta V}\right)\Lambda^{\mu'}_{\sigma}\Delta V'$$ So that the four momentum density flowing through the hypersurface $\Delta V$ oriented by $\textbf{u}$ is indeed a four vector. This is not the same object as $T
'^{\mu0}\Delta V'=T'^{\mu \alpha}w'_{\alpha}\Delta V'$ - the total four momentum flowing through a hypersurface (of volume $\Delta V'$) oriented by $\textbf{w}$. $T^{00}$ is $\textbf{u}=\textbf{e}_{0}$ component of the momentum flux through $\textbf{u}$ hypersurface, this corresponds to your last equation. The quantity on the right hand side of the preceding eqaution is the $\textbf{u}=\textbf{e}_{0}$ component of momentum flux through the $\textbf{w}$ hypersurface.
Answer: For an observer with 4-velocity $u^\mu$, the density of 4-momentum is $u_\nu T^{\mu\nu}$. If $u^\nu = (1,0,0,0)$, then indeed the 4-momentum is $p^\mu = T^{\mu 0}$ and this is a 4-vector.
Now let primed indices correspond to components in some other frame. Then $$
p^{0'} = L^{0'}_\mu p^\mu = L^{0'}_{\mu} T^{\mu 0}.$$
But it is not the case that $$p^{0'} \overset{!}{=} T^{0'0'}.$$
You can see this from the covariant expression $$p^{\mu'} = u_{\nu'}T^{\mu' \nu'}.$$
Since after a boost along the $1$-axis, $u_\nu' = (\gamma, -\gamma v, 0,0) \neq (1,0,0,0)$, what is true is that $$p^{0'} = \gamma T^{0'0'} - \gamma vT^{1'0'}.$$
This should cancel the additional term that confused you.
Answer: I build up on Brian Trundy's answer, giving a more explicit derivation. Indeed, when you do a Lorentz boost your orientation changes and you cannot think of $dV$ transforming as a simple length. You need to think of it as the component of a four-vector $dV^\mu=u^\mu dV$, where $u^\mu$ is the four-velocity. In a static reference frame, the four-velocity is $u^\mu=(c,0)$ (let me assume one spatial dimension for simplicity), so the energy is just
$$dE=\frac{1}{c}dp^0=\frac{1}{c}T^{0\nu}dV_\nu=\frac{1}{c}T^{00}dV$$
Now, indeed, if you transform this object as a vector you get
$$\frac{1}{c}T^{00}dV=\frac{1}{c}T^{0\nu}dV_\nu=\left[\frac{1}{c}T'^{0\nu}dV'_\nu-\frac{v}{c^2}T'^{1\nu}dV'_\nu\right]\left(1-\frac{v^2}{c^2}\right)^{-1/2}$$
And the transformation of the volume element four-vector is
$$dV'^\nu=\left(1-\frac{v^2}{c^2}\right)^{-1/2}(dV,-v\,dV)$$
So in the end we have
$$\frac{1}{c}T^{00}dV=\frac{1}{c}\left[T'^{00}-2\frac{v}{c}T'^{01}+\frac{v^2}{c^2}T'^{11}\right]\left(1-\frac{v^2}{c^2}\right)^{-1}dV$$
Which coincides with the transformation of the stress-energy tensor as a $2$-tensor, the factor of $2$ appearing due to the symmetry $T^{\mu\nu}=T^{\nu\mu}$.


Co-author Trouble

Question: So, I was writing a book with my best friend, and half way through - at 70,000 words - she decides she doesn't want to write the book anymore; but I still can. And we didn't have any agreements or anything because we - or I - thought that she wouldn't just quit... like we're best friends and put so much work into it. But since we first started I had decided I was going to publish... but now I'm not sure how I can. I have written 20,000 words since she quit (which was about a week or two ago) and at first she said that basically she should have her name on the novel too, if I get it published, because she wrote half of it with me... but I can't do that because she can't have the credit for the whole novel if I wrote one half by myself. So, after we had a big fight she said that I can just publish it... but I don't know if that means I can just have my name on it... and maybe just put hers in the acknowledgements? But then, I was wondering if this would make it more difficult for me to publish as there has been... well problems with ownership. And I am going to have two more novels going off this first book... so they would just be solely mine, right?
Comment: Welcome to Writing.SE! Could you clarify what your exact question is? Are you asking whether or not to credit your friend that you've fallen out with?
Answer: Any time you get into any business relationship, especially with a friend or relative, get everything in writing up front.  And the more important the friendship is to you, the more important it is to hash out the details ahead of time. It isn't a lack of trust --it is a way to avoid hurtful misunderstandings.
With that said, I am not a lawyer, nor have I been in this situation, but if it were me, I would give her the co-writing credit and up to 50% of the royalties without feeling ill-used. 35k words is a not-insignificant contribution to a book, especially since 70k is a viable length for a novel by itself. Furthermore, no collaboration is ever actually 50/50, so an even split is always a convenient fiction to avoid hard feelings. Who is to say her contributions weren't decisive? Denying her a cowriter credit after that big of a contribution seems petty and unfair.
In exchange, I would want, in writing, all rights to the characters, setting and any sequels, as well as the unilateral right to make decisions (publisher, selling rights, etc.) for this book. That seems fair, since she has abandoned the project, and you haven't, and it should adequately compensate you for the extra work you will be putting in alone.
Answer: I'm not a lawyer, but it looks like you can't publish the book with the content developed by someone else without having some kind of agreement with that person.
If you rewrite 100% of that content, then the answer is maybe, but the other person can still sue you and win.
So my advice is to talk to your co-author and try working something out.
Comment: Agreed. And you need to get her permission in writing. But before talking to her, you need to think about how important (not) sharing the credit is to you. What if she wants part of any royalties? Or she asks you to remove any characters/plot points she introduced? Or if she revokes her agreement to let you publish it at all?
Answer: The others advising you sound pretty spot on she can technically sue. Or you could technically offer her a deal in writing (Which she can counter a deal to you as well) either way you will need a contract in writing maybe even notarize it.
If she wants future royalties what is it 50/50 or 60/40? She has to agree this is ok or counter and you agree, but also is she giving up rights to media opportunities, product sales, ect?
If you pay her for her labor and then she is willing to allow you to have full rights and wave her own over the project with or without a co-author or maybe even mentor status credit you need paper work for all of that.
Some ghost writers are included onto novels others are not you might want to see how they do that if you pay her for her labor she may fall into ghost writer status now and will she have a non disclosure agreement?
Contacting a lawyer would be best if you want to keep her contributions to the work because she still has intellectual property rights as well as you do also will this dissolvement of your writing partnership also mean she can't write her own world based on this material? Or do you only get to write this one novel with the co-created content and nothing else? You want the universe, lore, marketing, product, royalties, ect laid out as to what can and can't be done with it and by whom but you are also willing to have any lawsuits, complaints filed about the book targeted at you, and you are also letting her know you are responsible for fees for publishing, doing cons for promotions (whatever) and other things not her she is cleared of financially assisting in the products, websites, whatever.
A lawyer can help you figure out all the points if you miss something (or they do) that loop hole leaves you open if something good turns on your book for her to come back in with lawyers of her own for services or fees or royalties. You can't make her come back and she may never want to try to get any future monies or deals from this book but unfortunately its something that has to be contract specified now to avoid any misunderstandings or expectations down the line.

Co-author Trouble


XOR two numbers

Question: Is there an intuitive meaning of XOR of two numbers not involving binary and just decimal? Or is is always converted into binary and then XORed?
Comment: Depends on your intuition. There's clearly a computable function $\mbox{XOR}:\mathbb{N}^2\rightarrow\mathbb{N}$ such that $\mbox{XOR}(n,m)$ is the exclusive-or of $n$ and $m$, regardless of the base you represent them in. Binary's the most intuitive to me, but your intuitive mileage may vary. And binary's pretty clearly the most straightforward way to describe an algorithm for computing $\mbox{XOR}$. So if that's what you mean by "intuition", then binary's likely best.
Answer: Bitwise operations like (bitwise) AND, OR, and XOR don't make much sense from the perspective of decimal expansion. They do make some sense in bases which are powers of 2 like hexadecimal, since in such bases they also operate digit by digit.
Comment: So it is possible to XOR two numbers (in Hex) without converting it into it's binary representation?
Comment: @user2505282 Yes. You do it digit by digit.
Comment: Can you give me an example?
Comment: 34 xor 43 = 77. You need to know how to XOR two digits.
Comment: No, that's false. 53 xor 75 = 26. The point is that this reduces to two independent calculations: 5 xor 7 = 2 and 3 xor 5 = 6.
Comment: How do I get 5 xor 7 = 2 and 3 xor 5 = 6?
Comment: @user2505282 By going to binary.
Comment: Oh, great. I just thought I could get rid of binary. Anyway, thank you.
Answer: There are only 16 distinct binary operations possible for $a$ op $b$, i.e., $0, 1, a, b, \overline{a}, \overline{b}, ab, a\overline{b}, \overline{a}b, \overline{a}\overline{b}, a+b, a+\overline{b}, \overline{a}+b, \overline{a}+\overline{b},ab+\overline{a}\overline{b}$ and $a\overline{b}+\overline{a}b$.  XOR is $a\overline{b}+\overline{a}b$.
With decimal digits you have a staggering possibility of $10^{100}$ functions. However, the idea of XOR can be easily duplicated. Nevertheless the idea of doing bitwise XOR is not acceptable, 0000 $\oplus$ 0000 is 1111 which is 15, not a decimal digit.
Let us try to do something like XOR for tertiary digits, i.e. 0,1,2. What we want is this: if $a$ XOR $b$ is $c$, then $a$ XOR $c$ should be $b$ and $b$ XOR $c$ should be $a$. So we should have the following:
$a \oplus b$ = $c$ $\Leftrightarrow$ $a \oplus c$ = $b$ $\Leftrightarrow$ $b \oplus c$ = $a$, for every choice of $ a,b, c \in \{0, 1, 2\}$.
Also we would like to have $ a \oplus b = b \oplus a$.
With this in mind we can have the following table:
XOR | 0 1 2
-----------
0   | 0 2 1
1   | 2 1 0
2   | 1 0 2

And we can have yet another table
XOR | 0 1 2
-----------
0   | 1 0 2
1   | 0 2 1
2   | 2 1 0

If we want to define XOR for decimal preserving the above mentioned property we can do it similarly. Of course, there wont be a unique way to this. And since there is no unique way to do this, there is no standard definition of XOR for decimal digits. It is cook your own definition kind of thing.
Answer: No, there is no intuitive meaning in terms of decimal. Bitwise operations are defined (literally) as operations on bits, and bits don't correspond directly to decimal digits.
Answer: XOR does have meaning on how decimal numbers are stored especially if you are considering using signed decimal notation.  I think of XOR because it is useful in calculations requiring the 2's Complement.
You need to learn how negative numbers are stored in computers and also consider instances where Big Endian and Little Endian are used when testing your code.
Comment: Search for "Karnaugh Maps" "Twos Complement" and "Max Data Type"
Answer: Normal "or" operation contains "and +or" (means we also treat  the both true cases as true which is and) but this doesn't gives rise to all possible combinations. For example consider there is one red and one white box, which contain balls of a certain colour. If the box contains same colour ball (eg., red box-red ball) let's denote that by bit 1 and denote all other cases by bit 0. We want to know whether only one box contains the same colour ball or both. In this case the normal "or" operation can't give the required output so we use exclusive or "xor" operation. Xor is used to compare if two signals (inputs) have correlation (similarity). So the physical meaning is not decimal or hexadecimal format the input is. It will always be converted to binary format to  compare the similarity between two numbers. In a nutshell mainly tells the similarity between two things.
Comment: The question is asking whether xor has any particular meaning on decimal numbers. Most of your answer explains what xor does on binary numbers, which isn't really relevant. And, xor doesn't seem to have much to do with similarity of decimal numbers. For example, $1024\oplus1$ has only a couple of bits set, suggesting that $1024$ and $1$ are "similar" numbers, whereas $1024\oplus 1023$ has ten bits set, suggesting they're very dissimilar. But I think most people would agree that $1023$ and $1024$ are very similar, whereas $1$ and $1024$ are very different.

XOR two numbers


microscopic slide cleaning and maintenance

Question: we do lot of gram staining and some spore staining. we normally wash our slides with detergent then rinse in D/w, dry it and store it. But on reusing this slide we have to flame it and also clean it with alcohol number of times to make it grease free. also these reused slides have some sort of deposit which does not go with cleaning and evend oes not hamper our staining too.  can anyone please suggest the best simple way to clean microscopic slide and to make it grease free and how to store it.
Comment: @always confused. we too use blue star or himedia slides. i also have same issue after washing and drying the slides, on preparing smear it does not give smooth smear but beads like. will try simmering slides in detergent water and check. thanks
Comment: Whoa! Dint know we could reuse gram stained slides. I remember reusing slides last for plant sections. But recycling always seems to be a good thing :)
Comment: We were often suggested to simmer the slides in detergent water... whatever new or re-used. We often did it on Lab. (Because the slides we bought from market, contained something greasy so that watery film divided into beads). (We used Blue Star (TM) slides ) However, sometimes removal of greasy layer opens some minute scratch-marks so the slide looks slightly turbid.
Comment: For permanent slides (in the slides library), if we use oil, we are required to dip the slides in xylene once were done.
Comment: @Polisetty I never cleaned slide with xylene but I doubt how-much evaporable it is. It was quite sticky and made the hand oily for long. Also, though some practical-instructions tell to clean the lens-oil with xylene; the xylene really did very bad to the oil-immersion lens (maybe it damaged the lens coatings or maybe it not removed properly). We usually  cleaned the lens first with moist cotton cloth and then a dry one.
Comment: oh no that is for permanent slides that will be again put under oil
Comment: I meant not only re-used slide... brand new slides from the packet also shown breaking the smear into bead-bead. However after simmering with soap/ detergent water don't forget remove the detergent. Sometimes a trace of remaining soap/ organic solvents/ surfactants may help facilitate beautiful smear but that is not the procedure.
Answer: An old technique to clean used slides is to just toss them in a jar containing equal volumes of distilled water, ethyl alcohol 95% and xylene. Shake from time to time. When needed wipe them dry using a clean, lint free cloth and use.
The techique was at the time (1930's?) in use in the lab of prof. Baudet (Veterinary parasitologist, Utrecht University) and is mentioned in several editions of the "Précis de Microscopie" by Maurice Langeron.
Langeron mentioned that the slides treated that way were "perfectly grease-free".
Another method is to wash the slides, rinse in distilled water and store for some time in a mixture of ethyl alcohol and acetic acid.
When on a tight budget, used Carnoy fixative was (is?) used.
This is a trick that was (is?) in use at some botanical labs in Eastern Europe.
It's mentioned in some of the German literature on microtechnique, if memory serves me right in Braune, Leman and Taubert's "Pflanzenanatomisches Praktikum".


What font is used in this "Reality" video games poster?

Question: Can anyone help me identify the font used for the heading of the following poster?
Comment: [I reject your reality and substitute my own.](http://www.sciencebasedmedicine.org/?p=297)
Answer: It looks like Impact font to me judging by the long letters and somewhat condensed shapes. All they did was used a bevel or inside shadow effect and applied a warp or a text shape to the word. Check this link out and use show by its caps. http://new.myfonts.com/fonts/urw/impact/%7CImpact
Here's my quick rendition -- you can tell those letters match distinctively.
Comment: yes, because there's nothing worse than untidy Impact crotches.
Comment: Yup, it's Impact all right. It's possible that the deep crotch in the Y has been tidied up a bit.
Comment: The distortion is likely an 'envelope' filter (Adobe Illustrator has them).
Comment: thank you. This is great. To clarify something, are those lines found inside the letters drawn or can they be created with a bevel?
Comment: Beveling would be the first thing I'd experiment with. Probably with a few tries you'll be able to get the same effect. I couldn't tell off-hand how to do that though as I haven't tried it yet. Good luck though!
Answer: We get a lot of font identification questions, you should check out this link.
However, I ran the header through WhatTheFont and some close matches were:
Interstate Compressed UltraBlack

Though, the R doesn't have the curve on the bottom...
Folio Bold Condensed

Though, the font isn't as heavy...
I hope this helps.
As for the "retro" effect, I would duplicate the font layer, and change it to black, and drag it down a little bit (creating this sharp shadow). Then, I would use the pen tool to create those lines you see on top of the letters. It also looks like all the letters have a stroke around them, so I would add a black stroke too.
This technique should be nearly identical in both photoshop and GIMP.
EDIT
Mike's post includes the correct font, which is Impact.
Comment: +1 for providing sources and inline effect notes, but -1 for just giving the not-very-close matches from an automated identification tool.
Comment: Hey, when I ran the scan, that's what I got e100 :P
Comment: Yes, but (1) the user could run it themselves with the same results, and I think should be encouraged to do so before asking the question here (2) WhatTheFont's results are very patchy, e.g they seem to rate general proportion and weight over shape of letterforms. Impact is a very common font; it comes with either Windows or Office and is pretty easy to spot (3) Another answer provides the 100% correct answer and is currently scored lower.
Comment: I up-voted Mike's answer. I agree that his is better. Though, to be fair I included in my answer how the retro effect could be achieved. But I agree, the impact font is easy to spot, and I should have figured that out, and that's my error. :]
Comment: thank you for the effort and help. I appreciate that. I was not aware that there are font identification tools--now I am.


How to merge two or more rasters which overlap?

Question: How to merge two or more rasters with values 0 and 1, where the value 1 does not overlap with other rasters. Finally, I want one raster file with pixel values 1 from all raster files as 1 and the rest 0.
Comment: Welcome to gis.stackexchange! Please note that a good question on this site is expected to show some degree of research on your part, i.e. what you have tried and - if applicable - code so far. For more info, you can check our [faq].
Answer: This should be straight-forward with a raster calculator. You could use an OR statement to generate a raster with output=1 wherever inputA=1 OR inputB=1. You could also do a simple sum (add the values of the two inputs).  If the 1 values really do not overlap (both inputs never have 1 in the same pixel), then you can probably get away with just summing the two rasters, since the result of the addition should always be 0 or 1.  If there is overlap, and some pixels end up with values of 2 or higher, then you can use a threshold to reduce the larger values back down to 1.
The details of how to do this depend on which software you're using (QGIS, ArcGIS, gdal, etc.).


When are assassins useful?

Question: In what ways can the assassins be useful, and what is their job in a team fight and the entirety of the game?
Answer: An assassin is typically a chamion with high mobility and burst potential, but limited sustained damage. Generally, they counter the ad/ap carries quite significantly, as they can move around them quite quickly and burst them down.
During the laning phase the assassins are typically in either the top or mid lane, depending on who they enemy picks. During this phase it's a good idea to harass the enemy as much as possible using your burst/movement speed to your advantage to win trades. Romaing to help other lanes is usually a good idea as well, just as long as you dont leave your lane for too long to do it.
During mid-late game, your job is to kill the carries quickly. Focus on the squishy targets, using your mobility to get around any CC.
Comment: This would be a question better to ask in the chat: http://chat.stackexchange.com/ . People in the Summoners Rift chatroom would be more than happy to dicuss this.
Comment: Which assassin you find the best and why?
In my opinion Talon  is the best assassin  because it has very good burst
Comment: @CyberDarius You are asking a discursive question in your comment what is not a good one, check on our [FAQ](http://gaming.stackexchange.com/faq#dontask). As +Emerica said, go to the [Chat](http://chat.stackexchange.com/rooms/2348/summoners-rift) for this kind of question. but Ryan's answer respond your question (of the comment) "as they can move around them quite quickly and burst them down." in the second and third line. So every assassin have a burst damage, not only Talon.
Comment: During the laning phase, an assassin should be able to deny significant CS/Exp to their opponent.  Because most assassin's damage falls off late game (compare LeBlanc to Annie at 40 min), it's important that they prevent their opponent from hitting their late game potential.
Answer: Assassins carry the roll of killing off the weak targets like support and carries. During laning phase they can roam around abit picking of the easy gankable targets. In team fights there primary focus is taking down lik said before, the carries and the support. Mostly circumventing the tank and going straight for them so that the rest of the team has an easyer time to take the rest down, because their carry is either fighting for their life or dead.
Answer: Simply answer: Kill the AD Carry, AP Carry and Support, they can even kill the Tank, but the point of the assassin champions is to nullify the opponent damage/support, and get advantage for your team in team fights.
Here is a list of the Assassin champions in LoL.
but the most common are the one who has the flag of assassin, those are:

Katarina
Akali
Kennen
Talon
Lee Sin

What is characteristic in those champions are the high burst damage (in 1 or 2 seconds they can finish a full health champion easily), they high mobility and they possibility of good escape/survivability.
They are usually solo top and mid, so they can farm fast and do they job.
To nullify a assassin is hard, but basically you need to avoid his farm, and force ganks on them.
There is not such thing as the best assassin, they all do they jobs quite good, but they are more counter-picks.
Comment: Shen is actually not an assassin even though he's a ninja. He has neither of the characteristics (would like to see him kill a champion in 2 seconds as you say, since the only source of damage is Ki Strike which has probably that time in cooldown).
Comment: You are right seth. I was so focused on the text that I put shen by mistake. updated =)

When are assassins useful?


How to get screen size using code on iOS?

Question: How to get the iPhone screen size to give calculation?
Answer: You can use the bounds property on an instance of UIScreen:
CGRect screenBound = [[UIScreen mainScreen] bounds];
CGSize screenSize = screenBound.size;
CGFloat screenWidth = screenSize.width;
CGFloat screenHeight = screenSize.height;

Most people will want the main screen; if you have a device attached to a TV, you may instead want to iterate over UIScreens and get the bounds for each.
More info at the UIScreen class docs.
Comment: This code doesn't work if the screen is a retina display - need to take into account the [scale value](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIScreen_Class/Reference/UIScreen.html#//apple_ref/occ/instp/UIScreen/scale).
Comment: That depends on your definition of size. The returned values are in points, which is often the desired unit when dealing with, for example, a view hierarchy. If you need pixel dimensions, yes, the scale factor comes into play; in my experience, however, this is a rarer need.
Comment: Remember that the device orientation is taken into account. If you're trying to determine if you're on a specific device don't just assume portrait orientation.
Comment: If your app is designed for only landscape or portrait mode you will need to compare the width to the height to determine the correct size. We cannot get the orientation reliably anymore. For example, I have an app designed only for portrait mode but if it is opened in landscape mode on an iPad the width and height are mixed up.
Answer: Here is a 'swift' solution:
(Updated for swift 3.x)
let screenWidth  = UIScreen.main.fixedCoordinateSpace.bounds.width
let screenHeight = UIScreen.main.fixedCoordinateSpace.bounds.height

This reports in points not pixels and "always reflect[s] the screen dimensions of the device in a portrait-up orientation"(Apple Docs). No need to bother with UIAnnoyinglyLongDeviceOrientation!
If you want the width and height to reflect the device orientation:
let screenWidth  = UIScreen.main.bounds.width
let screenHeight = UIScreen.main.bounds.height

Here width and height will flip flop values depending on whether the screen is in portrait or landscape.
And here is how to get screen size measured in pixels not points:
let screenWidthInPixels = UIScreen.main.nativeBounds.width
let screenHeightInPixels = UIScreen.main.nativeBounds.height

This also "is based on the device in a portrait-up orientation. This value does not change as the device rotates."(Apple Docs)
Please note that for swift 2.x and lower, you should use UIScreen.mainScreen() instead of UIScreen.main
Answer: Use This Code to fix in iOS8 :
float SW;
float SH;
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
if (( [[[UIDevice currentDevice] systemVersion] floatValue]<8)  && UIInterfaceOrientationIsLandscape(orientation))
{
    SW = [[UIScreen mainScreen] bounds].size.height;
    SH = [[UIScreen mainScreen] bounds].size.width;
}
else
{
    SW = [[UIScreen mainScreen] bounds].size.width;
    SH = [[UIScreen mainScreen] bounds].size.height;
}

Comment: In the if `height` and `width` are being assigned to the wrong variable.
Comment: @MurraySagal that's the point, it's checking the orientation and setting the height and width differently on iOS 7 and below, when it's in landscape.
Answer: Use the property bounds of UIView if you want to know the size of a certain view or [[UIScreen mainScreen] bounds] if you want to know the screen size of the device.
Answer: Similar to above but slightly less verbose:
CGFloat screenWidth = [[UIScreen mainScreen] bounds].size.width;
CGFloat screenHeight = [[UIScreen mainScreen] bounds].size.height;

Answer: float screen_Height;
float screen_Width;

if ([[[UIDevice currentDevice] systemVersion] floatValue]  >= 8) {
    screen_Height = [[UIScreen mainScreen] bounds].size.height;
    screen_Width = [[UIScreen mainScreen] bounds].size.width;
} else {
    screen_Height = ((([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortrait) || ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortraitUpsideDown)) ? [[UIScreen mainScreen] bounds].size.height : [[UIScreen mainScreen] bounds].size.width);
    screen_Width = ((([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortrait) || ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortraitUpsideDown)) ? [[UIScreen mainScreen] bounds].size.width : [[UIScreen mainScreen] bounds].size.height);
}

Comment: Yeah, the iOS 8 'fixed' the mainscreen size, and now all the old apps that used the 'hack', must be updated :(
Answer: Here is a Swift way to get screen sizes:
var screenWidth: CGFloat {
    if UIInterfaceOrientationIsPortrait(screenOrientation) {
        return UIScreen.mainScreen().bounds.size.width
    } else {
        return UIScreen.mainScreen().bounds.size.height
    }
}
var screenHeight: CGFloat {
    if UIInterfaceOrientationIsPortrait(screenOrientation) {
        return UIScreen.mainScreen().bounds.size.height
    } else {
        return UIScreen.mainScreen().bounds.size.width
    }
}
var screenOrientation: UIInterfaceOrientation {
    return UIApplication.sharedApplication().statusBarOrientation
}

These are included as a standard function here.
This is also in the documentation.
Answer: [[UIScreen mainScreen] bounds] returns physical screen dimensions not taking device orientation into account.
If you need to get screen size according to the current orientation please look at How to get orientation-dependent height and width of the screen?
Answer: Using the UIScreen's bounds is a good way to do it but you should us the the CGGeometry functions to access a CGRect's data rather than accessing it directly. See the CGGeometry docs.
CGRect screenBound = [[UIScreen mainScreen] bounds];
CGFloat screenWidth = CGRectGetWidth(screenBound);
CGFloat screenHeight = CGRectGetHeight(screenBound);

Answer: Assuming you want to take the current orientation into account, use:
float screen_width;
float screen_height;
float vers = [[[UIDevice currentDevice] systemVersion] floatValue];
UIInterfaceOrientation orient = [UIApplication sharedApplication].statusBarOrientation;
if (vers < 8 && UIInterfaceOrientationIsLandscape(orient))
{
    screen_height = [[UIScreen mainScreen] bounds].size.width;
    screen_width = [[UIScreen mainScreen] bounds].size.height;
}
else
{
    screen_width = [[UIScreen mainScreen] bounds].size.width;
    screen_height = [[UIScreen mainScreen] bounds].size.height;
}

Answer: For fellow Xamarians - here is the way you can get the screen size in Xamarin.iOS + C#:
var screenBound = UIScreen.MainScreen.Bounds;
var screenSize = screenBound.Size;
var height = screenSize.Height;
var width = screenSize.Width;

Answer: var PT: CGFloat = 0;

override func viewDidLoad() {

    super.viewDidLoad()
    setPoints();

}

func setPoints() {

    let screenBounds = UIScreen.main.bounds

    let screenScale = UIScreen.main.scale

    let screenSize = CGSize(width: screenBounds.size.width * screenScale, height: screenBounds.size.height * screenScale)

    let nativeBounds = UIScreen.main.nativeBounds

    let nativeScale = UIScreen.main.nativeScale

    let pxScreenWidth:CGFloat = nativeBounds.width;

    let ptScreenWidth:CGFloat = screenBounds.width;

    PT = pxScreenWidth/ptScreenWidth/nativeScale;

}

How to use:
let label: UILabel = UILabel(frame: CGRect(x: 15 * PT, y: 10 * PT, width: self.view.frame.width - 30 * PT, height: self.view.frame.height - 20 * PT))


Is There a Way To Set "Lisp-Interaction-Mode" to be Default?

Question: I'm using Emacs in the terminal of Mac.  Each time I exist an .el file and reopen another, I have to set lisp-interaction-mode.  Is there some sort of command or item I can place in the .emacs file to make it so that this is the default every time I open a .el file?
Comment: (I'm curious why you prefer that mode for an Emacs-Lisp code file, instead of `emacs-lisp-mode`.)
Comment: Good question.  I'm a CSCI major in my senior year and in a class that requires us to learn Elisp.  While I've written many applications in other languages, I have no knowledge of Elisp and only had very limited time with Emacs before this class.  We haven't really begun to write anything useful with Elisp, just smaller functions.  Our professor has asked us to use lisp-interaction-mode and to use ctrl+j to evaluate functions and function calls.  I've never used emacs-lisp-mode to evaluate functions and expressions.
Comment: 1. The Emacs manual is your friend. 2. In Emacs-Lisp mode you can use `C-x C-e` to evaluate the sexp before point, and you can use `C-M-x` to evaluate a defun. 3. In any mode you can use `M-:` to evaluate a Lisp sexp that you enter at the prompt. 4. In any buffer with Lisp code you can use `M-x eval-region` or `M-x eval-buffer`, to evaluate code.
Answer: Update auto-mode-alist, to give it an association between *.el and lisp-interaction-mode.
(add-to-list 'auto-mode-alist (cons "\\.el\\'" #'lisp-interaction-mode))

See the Elisp manual, node Auto Major Mode.


Is it practical to find actual very large prime numbers (such as those up to 100 digits)?

Question: I just asked How to find extremely large BigInt prime numbers exactly in JavaScript? and was explained that all I ever can hope for is a "probable" prime, not an exact/actual prime if they are that large (up to 100 digits). To me, the reason for that would be because it takes too long to compute the possible factors of the potential prime (which is what my JS code was saying to me). Is this true? Is there no way to find an exact/actual (i.e. non- "probable") prime number that is 70 to 100 digits long? If it is possible, how is it done (at least at a high, non-software/non-code level)? If it is possible, can we go to larger integers like up to 65536 digits? If not, why can't it be done/calculated with certainty, is there no possible way?
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/133132/discussion-on-question-by-lance-is-it-practical-to-find-actual-very-large-prime).
Answer: There are numbers that have properties that make them interesting for the search of large primes. They provide quickly large numbers and we can apply efficient primality tests. For example Mersenne numbers of the form $2^n-1$ can only be prime if n is prime (a necessary condition) and we can use the Lucas-Lehmer primality test on them.
So 521 is prime and $2^{521}-1$ is also prime, it is a 157 digit prime. But we can fine huge prime like $2^{82 589 933}-1$ which has 24 862 048 digits (base 10).
Comment: Interesting, thanks for pointing out I never thought of that.
Answer: It is absolutely practical and can be done deterministically. The AKS (Agarwal Kayal Saxena) primality test is a deterministic test which proves primality. It is also unconditional (does not depend on any unproved but widely believed hypothesis). The AKS test's complexity has been improved over time and is  by now of order $O(t^6)$ where $t$ is the bitsize of the prime candidate you are testing (so $t=100/\ln 2$ for your 100 digit number).
So, you can randomly choose an odd integer of 100 digits and run AKS on it. After repeating this roughly $\ln 100$ times (density of primes of that size by the Prime Number Theorem) you are likely to discover a provable prime of the form you like.
AKS Paper from the Annals of Mathematics is available here. Use google for much more information on AKS.
Comment: I tried doing _what I think_ is something similar to what you are suggesting [here](https://gist.github.com/lancejpollard/8f0788feea5e74b9974c7d4a9a8039a6#file-findprime-js-L72-L77) (Miller test to filter out candidates, and then AKS test using the I guess [broken code](https://www.geeksforgeeks.org/aks-primality-test/)? I updated that AKS code to work with BigInts, so maybe that helps, not sure). I ran it for 3 minutes but found no primes. I will check out some more AKS resources and your link. Thanks! FWIW the miller test is fast (thousands of candidates a second).
Comment: of course miller is much faster but it is randomized--you may be happy to live with a small probability that what you find is  not a prime
Comment: I am _not_ happy with "probable" primes haha, I want _actual_ primes guaranteed.
Answer: Not quite $70$ digits ("only" $61$) but the integer
$$p=2~000~000~000~000~000~000~030~000~000~000~000~000~000~500~000~000~000~000~000~007$$
Is prime. And, as per the request in your other question, it is also very clear that
$$\operatorname{mod}(p,4)=3$$
Comment: [Source.](https://primes.utm.edu/curios/page.php?number_id=2854)


How to set default SMS App in Android 4.2 Jelly Bean

Question: It is possible to set it in Android 4.4 KitKat. But how can I set it in Android 4.2 Jelly Bean?
After installing Tango I fell in this problem.
Comment: Uninstall it, or go to Settings > Applications > Tango > Remove Defaults and then select a new default SMS and dialer appliction. There should be a setting in your SMS app but I have no idea what phone you have. You can aslo go into Hangouts settings and set it as default SMS.
Comment: I have Sony Xperia Z Ultra. I don't want to uninstall it. I need Tango.
I couldn't find where you told. I couldn't find a place in my phone to set default SMS application.
Comment: In Android 4.4, it is possible: http://www.cnet.com/how-to/manage-default-sms-app-on-android-4-4-kitkat/
but how to in Android 4.2?
Comment: In settings->app->Downloaded->Tango->Clear default
Answer: Thanks all.
In Android 4.2 Jelly Bean, We should manage default app in same app we don't want it to handle SMS.
In Tango 3 settings, there is an option to avoid SMS handling.


How to find polarity of terminals of a circuit using meter?

Question: Title may not me appropriate but i have a basic question that may be a beginners question so forgive me in advance. If we have a PCB and two wires are coming out for the battery connection. One will be connected to positive terminal of battery and other will be connected to negative of battery.
As PCB is a complex circuit most of the times so how we would know using a meter, which terminal of circuit will be connected to positive and which to negative if the positive and negative is not marked on the upper side of PCB.
Answer: If you post a picture or two of your PCB (close ups of input and surrounding components) it would be easier to help confirm things.
Often, there will be some indication on the PCB silkscreen at the power inputs of polarity. If not you can often tell by following the input trace(s) and seeing what it connects to. For example, if the input pad is connected directly to a large copper fill (you may see 2 or 4 "wheel spoke" type connections to the fill), then it's almost certainly ground (not always though).
You can also look for things like power filter capacitors and see if the negative side (usually a stripe on that side probably also polarity symbols)) is connected to the input pad (i.e. has 0 ohms on multimeter ohms range, or beeps on continuity setting)

Similarly, if there are any ICs on the PCB you can get datasheets for, look at the pinouts, see which pin is ground and test between this and the input pad.

For the positive input, you would look for the input to the other side of a filter cap, connection to an IC regulator input (example datasheet from which above pinout was taken), any LEDs (on a typical 5mm LED the flat side is the cathode or negative side, so the other pin may be connected to the positive rail, probably through a small value resistor - it's cathode may be connected directly to ground)
Comment: +1 for a general, pragmatic, and systematic way to figure out a solution
Answer: If your DMM (Digital Multi Meter) supports it. you should have a "diode check" mode that supplies a small current and measures the voltage.  If the diode is forward biased it should measure voltages that are < 1 V (probably 0.8 V).  If you connect it with the +'ve lead of the DMM on say the purple wire and you get a diode reading the purple wire is the ground/negative.  The diodes you are testing in this case will be reverse biased in normal operation.
One word of caution.  Your circuit may draw too much current in normal operation for the diode tester so it may show a voltage value that is also in < 1 V.  IF this is the case then you can't make assumptions as to which is the right polarity.


What laws require establishments to serve free tap water in the UK and what are the parameters of these requirements?

Question: Can an ice cream / "fast food" shop, that purports not to be a restaurant, decline to serve fresh drinking water free of charge when asked for by a customer?
Comment: According to this [BBC article](https://www.bbc.com/news/uk-39881236) from 2017, "Unlicensed premises in the UK do not have to legally supply free drinking water."
Answer: In England and Wales and Scotland, 'licensed premises', i.e. premises authorised to serve alcohol, are obliged to provide free drinking water to customers on request. Unlicensed premises are not obliged to provide drinking water.
In England and Wales, all licensed premises "must ensure that free potable water is provided on request to customers where it is reasonably available". https://www.legislation.gov.uk/ukdsi/2014/9780111116906/schedule?view=plain
In Scotland, all licensed premises are obliged to provide "tap water fit for drinking" free to customers on request. https://www.legislation.gov.uk/asp/2005/16/schedule/4/paragraph/8/2005-12-21?view=plain
In Northern Ireland there is no law providing for giving customers free water on request.

Schools in Great Britain (i.e. not Northern Ireland) are obliged to supply free drinking water.
England https://www.legislation.gov.uk/uksi/2012/1943/made
Scotland https://www.legislation.gov.uk/ssi/2020/153/regulation/7/made
Wales https://www.legislation.gov.uk/mwa/2009/3/section/5

All UK workplaces must provide workers an "adequate supply of wholesome drinking water". https://www.legislation.gov.uk/uksi/1992/3004/regulation/22/made
Comment: Note that a premises license is also required for premises providing "regulated entertainment" and "late night refreshment". It is also required for selling alcohol for consumption off the premises, so for example a supermarket requires such a licesne. In practice I think all such premises are required to provide free water, but I've never seen it on offer at a supermarket.


Could a medical condition rendering a person incapacitated make someone ineligble for the presidency?

Question: Alice wants to run for President of the United States. She qualifies for age, being born in the US and time lived in the US. So far so easy. But Alice also is suffering from an illness that results in her being mentally incapable of making decisions or understanding facts fully from time to time. For simplicity, let's assume she has a light case of Alzheimers disease, but it is quickly progressing.
Comment: @MichaelHall 2nd person to find the catch I put into the question: It's if there is a disqualification from presidency for medical reasons, e.d. 25th section 4 that is about a president unable and *temporarily* taking over their duties, or permanent..
Comment: Technically, being in a coma does not render a candidate constitutionally ineligible to run.
Comment: @MichaelHall YEP! That is the point.
Comment: So why then are you even asking?  Because my point is that "eligibility" for any job, (*from POTUS to entry level burger flipper*) presumes a certain level of base human functionality as a minimum requirement.  There's no need to list every possible qualifying or disqualifying medical condition in a job description or posting.  If you have a question about medical privacy for public officials then ask that.  This just isn't a particularly useful question as written.
Answer: There is no constitutional impediment to electing Alice, or to Alice holding office.
Of course, Section 4 of the Twenty-Fifth Amendment allows the vice president and cabinet to declare the President unable to discharge the duties of the office, but this is a separate issue than you're asking about.
Comment: Even before the 25th Amendment, the original Constitution in Article 2, section 1, clause 6, provided that in the case of the President being unable to discharge the powers of the office, the powers will devolve to the Vice President. And the 25th Amendment didn't repeal this. But the Constitution is silent on how an Article 2 disability would be determined, so absent a 25th amendment declaration, it might lead to a constitutional crisis.
Answer: There are only 3 requirements to be eligible:

Be natural born
Be at least 35 years old
Have been a resident for 14 years

An illness, even Alzheimer's, is not disqualifying.


Custom Content Type on Documents SharePoint 2010

Question: I'm trying to attach a custom content type to Document Library so that it's available to users whenever they upload a new document, they'll have the necessary columns visible. I'm struggling to staple this onto SharePoint 2010 and cannot really find a solution to this online.
Comment: Using Sharepoint UI or code or feature?
Comment: Ashish, I created the content type as a feature and activated it. What I need to do now, is "attached" this custom type to document libraries created with the creation of a new site. Can I do this via the ONET, if so, how?
Answer: You can attach a contenttype to a list in a feature:

Get a reference to the list
Check if the list accepts contenttypes
Add the contenttype

And in code:
<code>SPList list = web.Lists["your list"];
list.AllowContentTypes = true;
SPContentType ct = web.AvailableContentTypes["your contenttype"];
list.ContentTypes.Add(ct);
</code>
This isn't production code, please add some checks and exception handling.


Indexer always getting stuck processing when using the admin GUI

Question: When completing a reindex via the admin GUI it always gets stuck and never completes. If I reindex via the command line it completes rather 3 minutes. Could anyone advise the best way to make the GUI work without getting stuck
Answer: Whenever you start an indexing process, Magento writes out a lock file to the var/locks folder.
$ ls var/locks
index_process_1.lock    index_process_4.lock    index_process_7.lock
index_process_2.lock    index_process_5.lock    index_process_8.lock
index_process_3.lock    index_process_6.lock    index_process_9.lock

The lock file prevents another user from starting an indexing process. However, if the indexing request times out or fails before it can complete, the lock file will be left in a lock state. In var/locks folder delete the .lock file which was created.
This will be the first step in solving.
Also check if php execution time and memory limit are not the reason for indexing script not completing its execution.


Presenting flow charts diagrams in a mobile app

Question: I am working on an app which junior doctors will use for clinical pathways, these clinical pathways are currently presented as flow chart diagrams which I'm not too keen on. I think there's a better way to present them so from a usability perspective how else do you think I can present these flow chart diagrams in my app so they are easy to see and navigate.
Comment: Out of curiosity, why are flowcharts inherently not usable? In much of medical literature, clinical pathways are already presented in flowchart format. Representing it as such in a decision support system would seem at first glance intuitive?
Answer: Present in steps, based on the flow - like a decision tree. For example:
Does the patient have xxx?
-Yes-   -No-
Where Yes and No would take you to subsequent steps.
If you follow this pattern (speaking from experience) - please consider the following things:

sometime expert users will just need reminders, and will find navigating an entire flow tedious - provide a way for them to see the entire chart
flows will never cover every case - provide a way out, or an esclation, if the user's option is not available
watch out for 'loops' - if a user follows the same 2 steps in the same order, twice in any one flow then you the user is stuck.  Again, provide a way out.

IMO - the trickiest thing is not the UI, it is writing the flows and testing them - they can get very complex.  Make sure to put significant usability test time into your authoring tool as well as your front end.
Comment: Many thanks for your answer, really appreciate it.


Number theory and NP-complete

Question: What are some of the natural number theory problems that are np-complete? I am looking for examples not in lattices and geometric number theory. Examples in analytic/algebraic number theory are ok.
Answer: You can take a look at the papers by Adleman and Manders (not always in this order) from the 70s (at least "Computational complexity of decision procedures for polynomials", "NP-complete decision problems for quadratic polynomials", "Diophantine complexity"), and the references therein.
One example of the problems they show to be NP-complete is the following decision problem.

Input: three natural numbers $a,b,c$ (in base $2$),
Output: YES/NO depending whether the equation $ax^2 + by = c$ has solutions (for $x,y$) in the natural numbers.
Comment: This example is Theorem 1 in the paper "NP-complete decision problems for quadratic polynomials". There you can find the proof of the NP-hard part, but the fact that it belongs to NP is easily proved because there is a solution for $x,y$ iff there is a solution with $x,y\leq c$ (this bound is enough for showing membership in the class NP). The problem that it is known to be undecidable is the one where you allow multiple variables (not just the two $x,y$) and integer coefficients [in the same paper it is noted that it is known that 9 variable are enough for the undecidability].
Comment: Good explicit example. Thankyou.
Comment: Do you happen to know the proof? I had the opinion Diophantine equations usually have only undecidability results.
Answer: See pages 249-251 of Garey and Johnson, Computers and Intractability, for a dozen NP-complete problems in Number Theory.
EDIT: A couple of examples, by request.
AN2, Simultaneous incongruences. Given a collection $\lbrace(a_1,b_1),\dots,(a_n,b_n)\rbrace$ of ordered pairs of positive integers with $a_i\le b_i$ for $1\le i\le n$, is there an integer $x$ such that for all $i$, $x\not\equiv a_i\pmod{b_i}$?
AN4, Comparative divisibility. Given sequences $a_1,a_2,\dots,a_n$ and $b_1,b_2,\dots,b_m$ of positive integers, is there a positive integer $c$ such that the number of $i$ for which $c$ divides $a_i$ is more than the number
of $j$ for which $c$ divides $b_j$?
Comment: Hi Gerry: I don't have the book and I can't see it in google book preview. Could you provide some example problems if you have the book? It would greatly help.

Number theory and NP-complete


What problems arise when a clock signal is connected to a nondedicated clock input pin on an FPGA?

Question: FPGAs have dedicated pins to input clock. They are supposed to directly connect to clock networks and PLL inputs. However, if we use a nondedicated pin, the design can still compile. Why are we allowed to compile a design that uses clock on nondedicated clock pins and what affects does it have on the design performance?
Comment: Clock jitter and delay can affect the maximum frequency the design can work with. The clock needs to "feed" different parts of the FPGA, and if the clock edge is not coming to these parts "synchronously" enough - it affects the functionality.
Comment: These are simply routed more efficiently to minimize the jitter. If you use non-dedicated, it might fail timing which would work otherwise.
Comment: Why should it fail timing? Due to clock insertion delay or what?
Answer: The clock input pins have optimised routes to the clock distribution logic.
At worst this means lower delays compared to general purpose pins.
At best this means accurately constrained delays, that allow the clock PLLs to drive the clock nets with near zero skew from the clock input pins.
The tools generally don't forbid a design that uses GP pins as clock inputs, you may be forced for some reason to do that. However, your design will not be able to take advantage of all the optimisations that the dedicated pins can provide, so will probably be slower.
Comment: Check the manufacturer's website for documentation.  I know that Xilinx documents this somewhere, either in an app note or in their data sheets.  (Well, I know they *did*, the last time I looked, 20 years ago...).  It's probably a good idea to check anyway -- I don't know if anyone *does* this, but it's certainly conceivable that dedicated clock inputs could be restricted to zones of the chip.
Comment: Also, some chips preserve specific routing layers for clock signals – you might get into high-speed routing trouble once you try to *do* anything with that clock-converted-to-logic signal.


How do i install bitcoind on my redhat linux server?

Question: I have recently created an api that runs the bitcoind commands. I had it running on another server, but it was setup by someone else. I have been searching for sensible instructions on how to install bitcoind on my new server, but can't find any.
Comment: I don't understand your question. To run bitcoind on your server, you just... run it? Like, `./bitcoind`? What's the problem?
Comment: If you're using Ubuntu, you can install it from a [ppa](https://launchpad.net/~bitcoin/+archive/bitcoin).
Comment: how do i install i guess is a better way to word it?
Comment: and for some reference i am using an amazon ec2 server so i am doing everything through terminal
Answer: git clone git://github.com/bitcoin/bitcoin.git
cd bitcoin/src/
make -f makefile.unix
sudo cp bitcoind /usr/local/bin

Comment: i i get this error: g++ -c -O2 -pthread -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -g -DBOOST_SPIRIT_THREADSAFE -I/home/ec2-user/bitcoin/src -I/home/ec2-user/bitcoin/src/obj -DUSE_UPNP=0 -DUSE_IPV6=1 -I/home/ec2-user/bitcoin/src/leveldb/include -I/home/ec2-user/bitcoin/src/leveldb/helpers -DHAVE_BUILD_INFO -fno-stack-protector -fstack-protector-all -Wstack-protector -D_FORTIFY_SOURCE=2  -MMD -MF obj/alert.d -o obj/alert.o alert.cpp
alert.cpp:5:29: fatal error: boost/foreach.hpp: No such file or directory
compilation terminated.
make: *** [obj/alert.o] Error 1
Comment: i am not using ubunuto as far as i can tell. I believe its redhat linux.
Answer: Install Git
sudo apt-get install git-core

Dependency Build Instructions: Ubuntu & Debian
Build requirements:
sudo apt-get install build-essential
sudo apt-get install libssl-dev

for Ubuntu 12.04+:
sudo apt-get install libboost-all-dev

db4.8 packages are available at:
 https://launchpad.net/~bitcoin/+archive/bitcoin
Ubuntu 12.10 has packages for libdb5.1-dev and libdb5.1++-dev,
 but using these will break binary wallet compatibility, and is not recommended.
for other Ubuntu & Debian:
sudo apt-get install libdb4.8-dev
sudo apt-get install libdb4.8++-dev
sudo apt-get install libboost1.37-dev

(If using Boost 1.37, append -mt to the boost libraries in the makefile)
Optional:
sudo apt-get install libminiupnpc-dev (see USE_UPNP compile flag)

Retrieve and compile Bitcoin source
git clone git://github.com/bitcoin/bitcoin.git
cd bitcoin/src/
make -f makefile.unix
sudo cp bitcoind /usr/local/bin

(much of this pulled directly from the build-unix.txt instructions)
Comment: @AndrewFont they do not. However, we are going outside bitcoin's scope, you should ask in a generic linux site...
Comment: i am using redhat linux so i am not sure if these instructions apply?
Answer: From another site (SO clone - http://www.rugatu.com/questions/15712/how-to-install-bitcoind-in-linux):
Here the step-by-step setup. Follow the procedure as root, or as user but use sudo when needed. I'll use sudo here.
1) Add the experimental repository to get the latest version of bitcoind. To do so, run nano (or your preferred text editor) to open the sources.list:
sudo nano /etc/apt/sources.list

and add to the end of the file the following line:
deb http://ftp.us.debian.org/debian/ experimental main

save and exit.
2) Run the update:
sudo apt-get update

3) Install bitcoind from the experimental repo:
sudo apt-get install -t experimental bitcoind

4) comment out the experimental repo line in sources.list.
Comment: Apt? Redhat? You're missing something.
Comment: whoops! good call - sorry. I saw another answer mentioning apt-get
Answer: The easiest way is to just download an RPM that does all of this for you. I provide one on my website for both i686 and x86_64:
# 32 bit
yum install http://tvdw.eu/bitcoin-0.8.1-1.el6.i686.rpm
# 64 bit
yum install http://tvdw.eu/bitcoin-0.8.1-1.el6.x86_64.rpm

# Now you can just run the client
bitcoind

These RPMs aren't signed, so install them at your own risk.

Don't want the RPM? Understandable. Get the compiled tarball from the bitcoin site (direct link)
wget http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.8.1/bitcoin-0.8.1-linux.tar.gz/download
tar -xfv bitcoin-0.8.1-linux.tar.gz
cd bitcoin-0.8.1-linux
./32/bitcoind


What is a website's private signing key used to sign?

Question: I am trying to understand digital signatures and digital certificates. I know that digital certificates verify a server's public verification key but what does the website's (client) private verification key sign?
Comment: Are you asking that, in the context of web browsing, what does the private key of the server that hosts the website signs when some client makes a connection?
Answer:
What does the website's (client) private verification key sign?

When a standard browser connects to a website, that browser is the client, and typically has no public/private key pair. Thus there is no "website's client private verification key" to sign with.
In the following I consider a website with a single server, thus do no distinguish if a key or certificate is that of the website, or of the server.

What is a website's private signing key used to sign?

The website's private key, matching the public key signed by the website's certificate, is used by the website to sign a message incorporating a challenge generated by the browser, yielding a session-unique signature, that the browser verifies against the server's public key extracted from the server's certificate.
More in detail: In TLS 1.3, what's signed by the website is the transcript hash, which is a digest of some selected earlier exchanges† of the browser and the server, that both had an opportunity to influence with random seed they generated.
The browser somewhat gets the website's certificate (typically, from the server or from a cache); checks the signature of that certificate (typically thru a chain of certificates, perhaps obtained from the server, and from a local trusted database of ultimately trusted certificates‡ that came with the browser); perhaps checks that the certificate was not revoked; extracts the website's public key from the website's certificate; and verifies the signature in the Certificate Verify message of the server  against that public key and the transcript hash jointly generated.

† Specifically: those of ClientHello, HelloRetryRequest, ClientHello, ServerHello, EncryptedExtensions, server CertificateRequest, server Certificate, server CertificateVerify, server Finished, EndOfEarlyData, client Certificate, client CertificateVerify, client Finished that have occurred.
‡ That list of ultimately trusted certificates is a serious weakness of the whole stuff, such that only a fool would trust TLS secure from state-level actors and other well-funded adversaries. For the latest (November 2022) account on (possibly) rogue certification authorities, see e.g. Bruce Schneier's blog article, or (while that works) the Washington Post article that AFAIK broke the story in the general press about that particular (possibly) rogue CA, with Joel Reardon.
Comment: No, it signs the transcript hash only. That doesn't contain the contents of the website, but rather of the key exchange. Then the exchanged symmetric key is used with Authenticated Encryption to send the contents of the web site, so the receiver both decrypts and verifies at the same time.
Comment: So does the website use its private key signing key to sign the hash of the contents of the website so it can be viewed by anyone who has the website's public signature verification key?
Comment: Oh the transcript hash which is signed by the website contains the Diffie Hellman shared key (g^ab)?
Comment: @CryptoGuru, not the transcript hash doesn't contain $g^{ab}$, which is technically not part of the transcript. However, the (partial) transcript hash(es) is used together with $g^{ab}$ to derive the many keys used in TLS 1.3 (either to encrypt the handshake or other things).  See here: https://datatracker.ietf.org/doc/html/rfc8446#section-7.1


I am not able to copy the downloaded windows istaller

Question: I downloaded the Ubuntu 12.04 LTS Windows Installer on my desktop.
Now am not able to copy it to my external hard disk. It gives an error 'low disk space, delete some files and try again' even though i have 200+ GB space on the disk
Answer: Will you please check the .trash folder in your external hard drive. Pressing CTRL+h shows all hidden folders in your hard drive.
I also got the same problem once, there was lots of items in the .trash folder of my external hard drive.
Hope this helps.


Drop All Columns in a Table that are not Keys

Question: This may seem like an odd request but let me explain, there may be a tool that I haven't found that will do what I need. I couldn't make SSMS do what I needed
Goal: To deliver a Database Diagram that contains tableName, their PKs and FKs for related tables and their relations for several groups of tables.
What I have done is to create a copy of the DB and plan on removing all columns that are not PK or FK from each table. Which I am not thrilled with doing since it could range from 150 tables to 950 tables.
So I would like either (or both :)) the name of a tool that will diagram as I need or a script that I can use to delete all columns that are not PK or FK from all non-system tables.
Answer: This T-SQL will generate a series of ALTER TABLE statements that you can copy-and-paste into a query window in SSMS to remove columns that are neither primary keys nor foreign keys.
;WITH ForeignKeys AS (
SELECT t.object_id
    , c.column_id
FROM sys.foreign_keys fk
    INNER JOIN sys.foreign_key_columns fkc ON fk.parent_object_id = fkc.parent_object_id
    INNER JOIN sys.columns c ON fkc.parent_object_id = c.object_id
         AND fkc.parent_column_id = c.column_id
    INNER JOIN sys.tables t ON fk.parent_object_id = t.object_id
), PrimaryKeys AS (
SELECT t.object_id
    , c.column_id
FROM sys.key_constraints kc
    INNER JOIN sys.indexes i ON kc.parent_object_id = i.object_id
    INNER JOIN sys.index_columns ic ON i.object_id = ic.object_id
         AND i.index_id = ic.index_id
    INNER JOIN sys.tables t ON i.object_id = t.object_id
    INNER JOIN sys.columns c ON ic.object_id = c.object_id
         AND ic.index_column_id = c.column_id
)
SELECT 'ALTER TABLE ' + QUOTENAME(s.name) + '.' + QUOTENAME(t.name) + '
    DROP COLUMN ' + QUOTENAME(c.name) + ';'
FROM sys.tables t
    INNER JOIN sys.schemas s ON t.schema_id = s.schema_id
    INNER JOIN sys.columns c ON t.object_id = c.object_id
WHERE NOT EXISTS (
    SELECT 1
    FROM ForeignKeys fk
    WHERE fk.object_id = t.object_id
        AND fk.column_id = c.column_id
    )
    AND NOT EXISTS (
        SELECT 1
        FROM PrimaryKeys pk
        WHERE pk.object_id = t.object_id
            AND pk.column_id = c.column_id
        )

It will correctly handle tables in various schemas, as well.
You may also have to first remove any default constraints:
SELECT N'alter table ' + QUOTENAME(t.name) +
    ' drop constraint [' + OBJECT_NAME(so.object_id) + N']'
FROM sys.objects so
    INNER JOIN sys.tables t
        ON t.object_id = so.parent_object_id
WHERE OBJECT_NAME(so.OBJECT_ID) like 'DF%'

Comment: Thanks Max, Now I just have to figure out order of precedence. Getting Drop failed because it's a dependent column
Answer: Red Gate SQL Dependency Tracker. It will do a diagram: Play around with the different options, but the one that you want is in there.
I don't have access to that tool at my current job (only RedGate Schema Compare and RedGate Data Compare) but we used it at my last job for the purpose of including diagrams in documentation.
Answer: Please do not go through the trouble of copying your database, and dropping all the non-keys! Take a look at SchemaCrawler's diagramming options, in particular, the option to show only significant columns, such as primary and foreign key columns with -command=brief.
Sualeh Fatehi, SchemaCrawler


Movie about sleepwalking people repairing an alien spaceship

Question: I saw part of a movie on TV back in the late 1970's about a young couple who are traveling through a small town when they have a car wreck.  All of the townspeople are yawning and tired all the time.  I think it turns out that aliens are using the people at night to repair their spaceship.
Comment: @DVK - It was also very similar to SG1 : [Nightwalkers](http://stargate.wikia.com/wiki/Nightwalkers).
Comment: @DVK: There actually was an episode of Eureka like this (people constructing a landing pad at night for a returning ship). I guess this is where they got their inspiration for the episode from.
Comment: Sounds like an episode of Eureka or X-files.
Answer: This is "Night Slaves". IMDB didn't have enough plot details, but Movie Mistakes has a pretty good plot synopsis in one of their "what's this movie" questions.

"Question: I'm trying to find the NAME of an old (ABC?) TV movie, circa 1970's, likely mid 1970's. All I remember is the (basic) plot AND the final shot. PLOT: the main character (Andrew Prine?) has been in accident (?), or was hurt in the military and he has a plate in his head or some sort of surgery was done to his brain. Something is "odd" about the new town he moves into and the main character thinks the Sheriff / Police Chief is controlling the people and might even be doing doing something illegal. Also, the main character falls in love with a mysterious woman in the small town, and through some series of events he finds out that the people of the town are being controlled by outer space travelers who are using the towns people to rebuild their space ship, at night, while they are hypnotized while asleep. The Sheriff and his new love ARE the head aliens. They are using the towns peoples 'bodies' to do the repairs because they don't have physical bodies, they are just beings made of 'energy'. The main character can't be 'hypnotized' because of the plate / surgery to his head. Near the end of the movie he actually sees the people wandering out toward a field where the busted space ship is being repaired. LAST SHOT: the final shot is the main character's body, lying in a field, in broad daylight. He's gone off into outer space (or just his 'life energy' has gone')with the woman with whom he fell in love. Roll Credits. 11:00 o'clock news. I started thinking about this because there was an episode of "Eureka" where the town's people worked on a 'project' at night, while they were hypnotized. Same plot, different out come. Thanks
Answer: This sounds like the 1970 made-for-TV movie titled, Night Slaves, starring Andrew Prine, James Franciscus, and Lee Grant. Leslie Nielsen played the sheriff of a small western town where some strange force has turned the residents into zombies."

You can watch the full movie below;
Comment: If they saw it in the late 1970s like they claim in the question it wouldn't be a Stargate episode originally aired in 2002. That said it doesn't sound like an overly original plot, there are probably more than a few movies or TV episodes that would fit this.
Comment: Good Point. Let me try again...
Comment: I think you nailed it as being "Night Slaves".  I am going to try and find a copy of it.  Thanks!
Comment: It is not night slaves. I know what he is talking about, and have been searching for it myself. It is black and white, and does not look so western.
Comment: When I watched the Stargate episode, I was sure I'd seen a similar story before. I can't specifically recall watching Night Slaves back when I came out, but I'm sure I must have.