Termination of unused MDI pairs

Question: I'm muxing Ethernet MDI between two PHYs – one of which is 10/100 (2-pair) and the other of which is 1+Gbps (4-pair). A single set of magnetics (4-pair) serves both PHYs via the mux. Does anybody have any insight as to how to properly terminate the two MDI pairs that are unused when the 10/100 PHY is selected via the mux? My current thought was the approach outlined in this response.
Comment: I don't see how that answer you linked to relates in any way, because you are switching the magnetics to two different PHYs and that diagram shows the connections between magnetics and the connector. Can you please add a diagram to make clear what you are switching and where.
Comment: @Justme Diagram added. I was interpreting the section of the diagram I linked to marked "unused" as a potential termination strategy that would be applicable, here.
Answer: I don't think it matters much because your path from magnetics to connector must be equal no matter which PHY you use.
If you want you can of course terminate the pins that the PHY does not use in same way than the pairs the PHY does use.
But the next problem is, it depends on the PHYs if they are compatible with the same magnetics connections. It is entirely possible that you not only need to swith 8 MDI lines of four pairs, but also the magnetics center taps, because some PHYs connect the center taps differently. Some with current mode drivers have it connected to driver supply voltage. The PHYs may use different driver voltages. Also some PHYs have voltage mode drivers where the center tap must not be connected to any potential.
Comment: I omitted this detail from my diagram. The 10/100 PHY has a voltage-mode driver and wants center taps referenced to GND with some DC blocking caps. For the 1Gbps PHY, I was considering putting another set of magnetics in front of it. I think I can do this within the insertion loss budget. Any thoughts?
Comment: It also occurred to me that this is basically how midspan PoE injectors work – so I think an additional set of magnetics (with center taps configured appropriately for the corresponding PHY) should be fine, here. I'm still curious to hear if you have any thoughts, though, since you seem to be pretty knowledgeable about these things!

Termination of unused MDI pairs


How to exclude a node from being indexed based on a field value?

Question: I would like to exclude some nodes from being indexed based on one field value (not content-type) on a drupal 7 installation, I can't find a hook letting me doing it, please help ! thank you
Answer: As said in the API, using hook_search_api_index_items_alter is not the best choice.
You should use hook_search_api_alter_callback_info
Example :
function mymodule_search_api_alter_callback_info() {
  $callbacks['exclude_some_nodes'] = array(
    'name' => t('Exclude some nodes'),
    'description' => t('Exclude some nodes from being indexed based on one field value'),
    'class' => 'SearchApiExcludeSomeNodes',
  );
  return $callbacks;
}

class SearchApiExcludeSomeNodes extends SearchApiAbstractAlterCallback {

  public function supportsIndex(SearchApiIndex $index) {
    return $index->getEntityType() === 'node';
  }

  public function alterItems(array &$items) {
    foreach ($items as $k => $item) {
      if($item->field_your_field['und'][0]['value'] == 'do_not_index') {
        unset($items[$k]);
      }
    }
  }

}

This will appear as an option in the UI of Search API, in the Data alterations section (admin/config/search/search_api/index/your_index/workflow)
Comment: This does not work.
Answer: Try to use the Finder module.

Finder allows Drupal site administrators to create flexible faceted search forms to find entities such as nodes or users based on the values of fields and database attributes.

NOTE: Finder module is an Unsupported Project due to security issue as of October 14, 2008
Answer: Use hook_apachesolr_node_exclude().  An example implementation is given in the API doc:
/**
 * This is invoked by apachesolr.module for each node to be added to the index.
 * If any module returns TRUE, the node is skipped for indexing. Note that nodes
 * which are already present in the index and subsequently qualify to be
 * excluded will not be removed from the index automatically. This hook can be
 * used to remove them prior to returning TRUE.
 *
 * @param object $node
 *   The node object which is being indexed.
 * @param string $namespace
 *   Usually the calling module (eg. 'apachesolr_search').
 *
 * @return bool
 *   Return TRUE to skip the indexing of the node.
 */
function hook_apachesolr_node_exclude($node, $namespace) {
  // Exclude nodes from uid 1.
  if ($node->uid == 1) {
    apachesolr_delete_node_from_index($node);
    return TRUE;
  }
}

Comment: Thanks, I will try this hook, I have found this hook as well : hook_search_api_index_items_alter() which does the job, but I have noticed it is called several times for the same node, so maybe it is called for each fields of the node being indexed..? yours looks a better solution, will come back to give the right answer
Comment: oups, my bad, I don't have the apachesolr module installed, so I could not test your hook, thank you anyway ;)
Answer: The hook to use is the following one:
/**
 * Implements hook_search_api_index_items_alter().
 */
function CUSTOM_MODULE_search_api_index_items_alter(array &$items, SearchApiIndex $index) {
    foreach($items as $id => $item){
        if(isset($item->YOUR_FIELD) && $item->YOUR_FIELD[key($item->YOUR_FIELD)][0]['value'] == 'FORBIDDEN_VALUE') unset($items[$id]);
    }
}

Comment: To make it clear to future readers: This code requires the [Search API](http://drupal.org/project/search_api) module.
Comment: I have tried this with Search API enabled and it does not work one bit.


Default image for homepage when shared in social media

Question: Currently, my homepage contains a few of the latest posts. Therefore, when the homepage is shared via social media (i.e. Facebook), the thumbnail image which is displayed comes from the top image in the latest post.
What I am trying to do, is to set it so that when the homepage is shared, a specific, default image will be displayed. However, the image must only be displayed when the homepage is shared, and should not otherwise appear on the site. What would be the best way to do this?
Answer: Several options:
Out-of-the-box plugin
If you're using Yoast WordPress SEO, you have a built-in setting for Facebook images. Under your SEO > Social menu, go to the Facebook tab and select an image under "Frontpage settings." You can also set an image as a fallback, for posts that have no featured image, under "Default settings."
Other SEO plugins may have similar capabilities.
Child theme
You can create a child theme or modify a custom theme. First, make sure the theme supports a site logo. If not, add custom logo support.
Next, edit or copy header.php into your new child theme. Inside the  tags, include a check for if(is_front_page()) or if(is_home()) depending on your needs. Sounds like either would work in your case.
If the condition is met, grab the custom logo URL
$image = wp_get_attachment_image_url(get_theme_mod('custom_logo'), 'large');

and output it within Open Graph tags:
<meta property="og:image" content="<?php echo $image; ?>" />
<meta name="twitter:image" content="<?php echo $image; ?>" />

Custom plugin
You could also create your own plugin, if you don't want to use Yoast WordPress SEO or fiddle with the theme. The risk is that an existing theme or plugin may already output a featured image, so you'd want to check your page source and make sure nothing else is setting a featured image. I assume this is the case since your current theme and plugins are setting the most-recently-published post's image when you try to share it.
Basically, you would add an action for the wp_head hook. Your action would output the Open Graph and Twitter image data just like you would if you chose the first option, working with the theme.
You'd have to decide whether to hard-code the image into your plugin, or whether you would create an options page somewhere in wp-admin where you could change the image whenever you wanted.
Answer: Different social platforms use different methods.
For Facebook, you need a set of <meta> tags with og properties - e.g. og:url, og:type, og:description and og:image. og:image should contain the full path to the image you want to be displayed.
Twitter is similar but has their own 'card' mechanism which requires its own set of meta tags - e.g. name="twitter:card" and name="twitter:image"
I believe there are plugins to handle this. I have my own simple function which uses the thumbnail of the page, or a fallback if this isn't set.
Answer: OG meta tags is probably what you are looking for, in this case :
<meta property="og:image"content="path/to/foo.jpg" />

put inside a if is_home() and hopefully it will work


Bluetooth RSSI values are always in dBm in all Android devices?

Question: I'm new to Android and my app uses Bluetooth to receive data from a small load cell amplifier. While in some devices (Samsung ones) the BT signal strength (RSSI) vary as expected (from around -20, at short distance, to around -80, at 10m), in some others (one LG model, at least) the RSSI are quite weird, as around 200 (positive value!) at short distance. I'm supposing that LG phone is not giving RSSI values in dBm. In all cases Samsung tablets and LG phones were always connected to the same remote device (the amplifier sample that my customer is developing). Actually my question is if it is normal, in this case, that different Android devices (or different Android versions) answer differently to the same API call.
Answer: The RSSI is an 8-bit signed two's complement integer(-128 to 127).
If you read the value as a byte then you will get the correct value range for any device.
If you read it as an integer or a string you might end up with correct values on some devices but incorrect on some other...
200 as an 8-bit signed two's complement integer equals -56
Comment: Great! I knew that RSSI is 8-bit signed, but I thought my code could convert RSSI to integer without problem:
     lastRssi = (int) intent.getShortExtra(BluetoothDevice.EXTRA_RSSI, Short.MIN_VALUE);
Comment: I think your code is correct... i've seen it used like that all over the place... but: short is 16bit, try using getByteExtra instead of getShortExtra...
I think that way it should work for all devices
Comment: Sorry Tiago, I am not used with StackOverflow. Answer accepted! Obrigado!


Is there a way to edit which fields display in the header of a default report? Specifically, to add custom fields to it?

Question: One of my clients asked about adding a couple custom fields to the default fields in the header section of the report customization page.  I can't see any way to do it but maybe someone out there has an idea?  Thanks!
Answer: No, the standard header provides standard filters that are generated based on the configuration of a given org. The Date area does include custom date fields, but basically what you see is what you get. This is why there's a Filter section for each report to add additional filters. If they want to already have some fields selected, they could save it as a custom report.


Intensifier or mitigator?

Question: When we use pretty with please as on "pretty please, then "please is used as an intensifier, right? Can't we use any other intensifier with please?
Answer: No. In that phrase, the request is please and its intensifier is pretty.

Please? Pretty please?

Especially among children, this can also be followed with:

Pretty please with sugar on top?

The only other intensifier I can think of in combination with please specifically is something like this:

What can I ever do to please you?

Other intensifiers with other forms of the word include saying that something is very pleasing or that someone is not too pleased.

Here is another idiomatic expression where pretty might be considered an intensifier:

That's a pretty pickle you've got yourself into.

(Which is similar in meaning to "another fine mess," even though no intensifier is used in that expression.)

But in general, pretty is not thought of as an intensifier.
Answer: This is a fixed expression and not productive.  We generally can't use other intensifiers with "please", and we can't say "pretty thank you" either.
We also don't use "pretty please" when please is part of a sentence: We don't say "Pretty please tidy your room".  We can strengthen the request to a demand by omitting "please":  "Tidy your room!".  Or soften it with tentative language "Would it be possible for you to tidy your room?"
There are a number of joke expressions like "please with a cherry on top" that are probably best avoided, as they are not very funny.

Intensifier or mitigator?


Why is it more efficient to compute the modular exponentiation by calculating to the power of two and not three for example?

Question: I learned about modular exponentiation from this website and at fast modular exponentiation they calculate the modulo of the number to the power of two and then they repeat this step. Why not calculate to the power of three ?
https://www.khanacademy.org/computing/computer-science/cryptography/modarithmetic/a/fast-modular-exponentiation
Comment: Try it and you'll understand !
Comment: As @Yves notes, this really is one of those things you could have answered yourself by actually doing the experiment. Don't be afraid to try stuff and make wrong turns!
Answer: If we want to calculate $x^N$, the monomials:
$$x, x^2, x^4, x^8, \ldots, x^{2^{\lfloor \log_2 N \rfloor}}$$
are the only initial powers we need to calculate (this is $\lfloor \log_2 N \rfloor - 1$ multiplications, because we obtain each term by squaring the previous term). Then we write $N$ in binary as
$$N = \sum_{i=0}^{\lfloor \log_2 N\rfloor} a_i2^i,$$
$a_i \in \left\{0,1\right\}$. If there are $k$ $1$s among the $a_i$, there are $k$ nonzero summands of $N$, and it takes $k$ multiplications to get $x^N$ by multiplying the corresponding monomials $x^{2^i}$. In the worst case, we perform $2 \log_2 N$ total multiplications of large numbers. In this analysis, we ignore the cost to write $N$ in binary, because we assume $N$ is small compared to the powers of $x$ we will be dealing with ($N \ll x^N$).
If we try to use base 3 instead of base 2, we now have $\log_3 N$ monomials to calculate, but each one takes 2 multiplications to obtain (2 multiplications to get $x^3$ from $x$, another 2 to get $x^9$ from $x^3$, etc.), so in total $2 \log_3 N$ multiplications to get the monomials. In analogy with the above, now the expansion of $N$ has coefficients in $\{0,1,2\}$, and each $2$ introduces an extra multiplication in the final step:
$$x^{24} = x^{2(9) + 2(3)} = x^9x^9x^3x^3,$$
so in the worst case again we have $2 \log_3 N$ multiplications to get the final result.
Since
$$\frac{2 \log_3 x}{\log_2 x} = \frac{2\ln 2}{\ln 3} \approx 1.26,$$
this is less efficient in the worst case. More than that, the fact that the coefficients of $N$ in ternary have 3 cases instead of 2 makes the algorithm more complicated.
This is not the end of the story, because there are ways to avoid some of the extra multiplications introduced by modular exponentiation in base 3, by combining terms that have coefficients of 2:
$$x^{24} = (x^9x^3)^2,$$
a technique that can be broadly applied (see this question on the CS StackExchange).
So I have not answered why (or whether) base 2 is used in practice in modern algorithms, but I think I have shown why base 2 is optimal for the naive algorithm, and why there is no immediate improvement from moving to a larger base.
Comment: I think you mean $x^{2^{\lfloor \log_2(N) \rfloor}}$ at the top. (The last exponent should be the largest power of $2$ which is less than or equal to $N$, which is $2^{\lfloor \log_2(N) \rfloor}$.)
Comment: @Ian Yes, thanks.
Answer: You might think that exponentiation by cubing might be faster because it triples the exponent in one step whereas exponentiation by squaring doubles it the exponent in one step. But this comparison is not fair, because exponentiation by cubing takes two multiplications per step (compute $x^2$, then multiply it by $x$) while exponentiation by squaring only takes one.
If you instead "compare apples to apples", two multiplications with exponentiation by squaring quadruples the exponent, while two multiplications of exponentiation by cubing only triples the exponent. Now if you ignore any "shortcut" optimizations, multiplications in modular arithmetic take essentially constant time (depending only on the modulus), so exponentiation by squaring will raise the current exponent by more for a given computational cost.
For the overall procedure, the situation is made a little bit more complicated, because in general $k$ is not a power of $2$ or $3$. Consequently these methods have to perform a recursive step: this recursion amounts to the decomposition $x^k=\prod_{i=0}^n x^{b_i a^i}$, where $b_i$ are digits in the base $a$ expansion of $k$.
So there is a question of how long each of the factors in the recursion takes to compute, and also how many of them there are. The number of factors is typically smaller for $a=3$ than for $a=2$, at least if you use the decomposition I wrote above (which requires a squaring step at the end of a given branch whenever $b_i=2$).
Still, none of the issues in the previous paragraph are enough to give exponentiation by cubing the advantage, simply because the factors themselves take significantly longer to compute.
Comment: As for the work difference between computing $(x^2)^2$ and $x^2\cdot x$, the latter is actually _not_ easier when we're talking _modular_ exponentiation, where the "sizes" of the values is not really meaningful -- on the contrary, _squaring_ a single value sometimes enables some shortcuts that are not available when multiplying _different_ values.
Comment: This computation needs to be corrected for the fact that a random large exponent will tend to have slightly more nonzero digits in its base-2 representation than it has in its base-3 representation, so there will be more work involved in multiplying together the final product of powers -- but base 2 still comes out ahead.
Comment: @HenningMakholm I missed that this was actually about modular exponentiation rather than just computing a large exponent. Let me fix that.
Answer: You can indeed speed up a modular exponentiation by working in a different base, and this is routinely done by constrained implementations in real life (e.g. smart cards). But to make it work, the base has to be a power of $2$.
Suppose you have to calculate $x^e \bmod p$, and you decide to work in base $8$. Then you pre-compute a table $T$ containing $1, x, x^2, x^3, x^4, x^5, x^6,$ and $x^7$ (all $\bmod p$).
Now you can perform the exponentiation (roughly) as follows:
y := 0
Loop while bits remain in e:
  y := y^8 mod p // Square y three times
  i := the next three bits in the exponent e (from msb to lsb)
  y := y*T[i] mod p // Incorporate the appropriate table entry
End Loop

The reason it has to be a power of $2$ is that otherwise the step y := y^8 would be too slow.
It takes time (and storage space) to build the table $T$, so you have to choose your base carefully to optimise the time saved. (But if the exponentiation is going to be performed many times for the same $x$, then you only need to build the table once, so you can make it as large as possible subject to your space constraints.) You can also effectively double the table size by only storing odd powers of $x$; you might like to work out for yourself how to do this.
Note that the number of squarings is unchanged by this method, so you can't achieve a speed-up of more than about 50% unless squaring is significantly faster than multiplication.
Answer: In order to raise x to the power N - modularly or otherwise - by repeated squaring or cubing, one has to add corrective multiplications to make the final exponent of the result equal to N in base 2 or 3, respectively.  This means one has to extract the base-2 (resp. base-3) digits of N.  The advantage of binary is that, because of our hardware design choices, we already have the base-2 digits of N; extracting them requires only SHIFT and AND instructions.  For base-3 one would have to divide by 3, a significantly more expensive operation.  [this assumes N is a variable input; if N is a pre-chosen constant one can of course precalculate the required steps without performing any divisions]
If we were living in a world where our design choices favored some form of ternary, maybe this question would have been asking why base-2 isn't preferred over base-3.    :-)
Comment: It's actually very annoying to me "give me the binary digits of this number" is not straightforward in many languages. It is somewhat straightforward in C, but it is not so obvious that log2 will do this for you in Matlab, and I haven't been able to find how to do it in Python in a little bit of googling.
Comment: @Ian, one does hope for more straightforward routes instead of resorting to bit twiddling... ;)
Comment: @J.M. Usually, yes, but in something like $\prod_{i=0}^n x^{b_i 2^i}$, it would actually be really nice to have $b_i$ explicitly. Similarly, it is not uncommon in certain numerical problems to want the nearest power of 2, or perhaps the next largest power of 2, to the number you have. There is absolutely no need to do this with logarithms when the internal representation is binary...but without access to the internal representation (or a function that does this for you using the internal representation), logarithms are what you're stuck with.
Comment: @J.M. To put it another way, there are various small subroutines that you might want to do directly with the internal representation that don't have standard library functions. Those are what you would actually want to do. You don't want to write a complicated algorithm on the internal representation, that would be horrifically tedious and error prone.
Comment: @Ian, yes, as I had been obliquely stating, bit twiddling (when bit operation functions are available) is the most efficient way of going about it, but one then has to explain this to other people (or to yourself when you're reading code many moons later). So, probably a well-named subroutine that just hides the bit stuff behind the scenes.


Does the severity of a market downturn seem to be correlated with the length of the bull market that proceeded it?

Question: There is a lot of talk on the net, in the WSJ, etc. about how we're in the longest bull market in recent memory, that "this can't last forever", and so on.  Does history suggest that when things finally do turn south, it will be more severe due to the length and scale of the bull market we're in?  Or is there no useful, known correlation between the size of a bull market and the proceeding downturn?
Comment: @horsehair Agreed that it's relevant for personal investing and therefore not entirely off-topic, but I think any answers will be more economic theory than practical investing wisdom. I would guess there's no correlation that is actionable, we'd all love to time the market, but successfully doing so is more luck than skill in most cases at least, I'd think.
Comment: Probably better suited for https://economics.stackexchange.com/
Comment: @HartCO - I'm not on your level (judging by your answers I've read on here).  My amateur assumption is that the bull market is more than simply a recovery and reaction to the 2008 downturn, based largely on charts of the big indexes.  They've picked up (in terms of value and rate both) so much over the past 10 years that they dwarf what they've been in the past.  For what I'm talking about, go to google and enter 'djia' and select 'max' for scale.  Again, I'm a newb and this is likely an illogical observation.
Comment: @HartCO I put it here because the question relates to my investing decisions.  I don't care too much about the theory behind it.  Also that we have an "economics" tag here suggests that some amount of economics is allowed in questions.
Comment: I don't think that there's any correlation between the length of a bull market and the severity of an ensuing downturn.  The 1982-1990 and 1991-2000 bull were long in duration and the end of them was a small blip compared to  previous gains. Conversely, the recession of 1974 was far more severe than the run up.Google "Macrotrends DJIA Historical" and you can view a graph of up to 100 years of the DJIA with recessions overlaid as well. If you want a more precise answer, download the data and calculate market gains and losses for bull markets and their subsequent downturms.
Answer: Based on A Random Walk Down Wall Street - no.  The book's main premise is the market goes up and down randomly, and there is no way to predict future performance based on either historical Data or detailed analysis of the company (Warren Buffet comes up a few times).
Essentially, there is no way for traders to know which companies are embezzling money, about to be hit with tariffs, etc.  Because the future is unknown its impossible to predict bull/bear markets as they are caused by future events.


No history in zsh shell

Question: I've recently switched from bash to zsh shell. In contrast with bash, when I re-login the history is empty. When I press up/down nothing displays. How to set zsh to save the history between sessions?
Comment: What have you set `HISTFILE` and `HISTSIZE` to?
Answer: Zsh has a minimalistic configuration out of the box which doesn't include nice features such as saving the command history between sessions. This and other features are available, but turned off by default.
Depending on how your operating system is set up, it may present you a configuration screen (zsh-newuser-install) the first time. If it doesn't, or to run it again, see Run the Zsh first use wizard
In the first-time configuration screen, select (1) Configure settings for history, change the settings if you want, then (0) Remember edits and return to main menu. While you're at it, activate command-sensitive completion with (2) Configure the new completion system. and either (1)  Turn on completion with the default options. or (2)  Run the configuration tool (compinstall). Also activate some basic features in (4)  Pick some of the more common shell options: I recommend turning on autocd, extendedglob. Finally select (0)  Exit, saving the new settings..
If you prefer doing the configuration manually, you need to set both HISTFILE and SAVEHIST and you'll probably want to increase HISTSIZE too. These settings go into the file .zshrc in your home directory.
# Save history between sessions
HISTSIZE=10000
SAVEHIST=$HISTSIZE
HISTFILE=~/.zsh_history

# Turn on some useful options
setopt auto_cd
setopt extended_glob

# Activate context-sensitive completion
autoload -Uz compinit
compinit

Here are some more basic settings that the first-time configuration screen doesn't cover.

Prevent against accidentally overwriting a file with output redirection or with mv or cp.
Make the mass-renaming function zmv available.
The default prompt is bland and uninformative by default. To get you started, here's a prompt that shows the last 3 components of the current directory and the status of the previous command if it failed.

# Prevent against accidentally overwriting files
setopt no_clobber
alias cp='cp -i'
alias mv='mv -i'

# Rename, copy or link files based on patterns.
autoload -U zmv
alias zcp='noglob zmv -C'
alias zln='noglob zmv -L'
alias zmv='noglob zmv'

# Prompt
PS1='%B%(?,,[%?] )%3~%# %b'

No history in zsh shell


For mobile app developer, which screen size is the most common one?

Question: Currently, I'm designing a mobile app -using hybrid platform- for public use, and I'd like to know, which screen size I should use as my standard, so I can give the best user experience for my customer.
Answer: What's your product for? Do you have targeted an audience of users yet? Where do they live, what do they do, how are they interacting with your product?
I wouldn't necessarily decide on this upon "most used screen size".
I personally would think about the product, its placement on the market and my target audience first. Age, country, local internet speeds play a huge role when deciding upon designs especially on mobile.
The best experience does not come from a single most used device or screen size, but rather from an experience that works on any device you're targeting.
Comment: 'but rather from an experience that works on any device you're targeting.' Very, very, very important.
Answer: Well, you could see here the 2016 stats for all smart devices: https://deviceatlas.com/blog/most-used-smartphone-screen-resolutions-in-2016
You can see it also by country and choose the exact case you want.


Колледж vs училище

Question: A Quizlet flashcard set had both these words translated as "college". Maybe different kinds of colleges? Technical school?
Answer: Училище means "vocational school", a place where one learns a trade that requires a skill but doesn't require a degree. There used to be профессионально-техническое училище (all kinds of blue collar trades), музыкальное училище, педагогическое училище, военное училище etc.
During the influx of English words in the 1990s, most of them renamed themselves колледж, following the trend.
Before that, the word колледж wasn't really used in Russian other than to translate the English word "college" (in all its meanings).
When applied to educational facilities in modern Russia, these two words mean pretty much the same: "a trade school". The difference between them is purely stylistic, and each particular school picks the one it likes best.

Колледж vs училище


Using Git for source code management on Ubuntu Linux and Windows 7

Question:
I have a Java codebase that was built using Eclipse Helios EE.
We want to setup a development environment as follows:
a. Ubuntu Linux Git server that will house the source code repository
b. Development will be done on Eclipse Helios under Windows 7
What tools do I need to install for this setup to work? Here's my list, please advise if this is complete:
a) Git on Linux server
b) Eclipse Helios on Windows 7 laptop
c) Do I need any Git plugins on Eclipse? Or can Eclipse Helios inter-operate directly with the Git repository on the Ubuntu Linux server?
d) Do I need Windows Git for any reason on the Windows 7 laptop?
Any pointers to tutorials or detailed instructions welcome!
Answer: Just to confirm: You want to develop in Eclipse on Windows 7 and host the repository on your Ubuntu server?
Then you need on the Windows machine or any development machine:

Git itself, to use it in any way, as Git is decentral and works locally on your machine.
Obviously Eclipse if you want to work with Eclipse, but that is not related to Git at all.
Optionally a Git plugin for Eclipse if you don't want to use the command line but rather want to access the Git functionality from within Eclipse.

On your Linux server you need:

Git, again.
Depending on how you want to communicate with the server, you might want some other tools, but it works fine out of the box with just SSH and Git. See also the "Git on the Server" section in the Git book.

In general, take a look at the Git book for general Git help (as you seem to miss how Git exactly works).
Comment: Yes, I want to develop in Eclipse on Windows 7 and host the repository on an Ubuntu server.

Thanks for the response.


Dual monitor lubuntu how to change wallpaper in extended screen?

Question: Hi I have dual monitor in lubuntu. The main screen is 1280x800 and the extended screen is 1024x768.
I installed variety. It changes wallpaper every 5 minutes.
However it changes wallpaper only in main screen. In the extended screen the wallpaper stays always the same. It is the default lubuntu wallpaper. I tried to change wallpaper in extended screen using nitrogen but nothing happens. How to change wallpaper in extended screen?
Answer: This is a super-old question, but I was annoyed by the issue today and finally found a solution. Note that this might only apply to LXDE, not to LXQt and hence might not be applicable for recent lubuntu versions.
The right way to do this is to have two files ~/.config/pcmanfm/LXDE/desktop-items-0.conf and ~/.config/pcmanfm/LXDE/desktop-items-1.conf.
The former holds the config for the first desktop, the second for the second desktop. The desktop settings utility only covers the first one, so you'll need to change the various wallpaper= values manually with an editor of your choice.
Answer: Ok I found the solution.
I downloaded and installed disper-indicator. It is a .deb package.
I installed it manually because I could not find it in repositories.
Then I have set disper-indicator to run on startup. So now I click on disper indicator and I configure the dual monitors

Disper indicator can be found from this repository https://launchpad.net/~nmellegard/+archive/ubuntu/disper-indicator-ppa
Added later by Edit
Answer: I actually had this same issue on Lubuntu 14.04 and it was driving me crazy. I changed the desktop wallpaper multiple times and ways, including even using Nitrogen and SyncWall both mentioned here.
What worked for me was running the following:
pcmanfm --desktop-off
from a terminal window.
I hope that helps some wandering soul that is trying to set multiple monitors with different wallpapers. I found the help on an old archlinux forum of all places.


How to transfer files from Host OS to guest OS running on VirtualBox?

Question: I am trying to transfer files from my Host OS (Windows 7) to Guest OS (CentOS) running on VirtualBox.
I tried using pscp but it gives the error: More than one remote source not supported
I tried ftp but it doesn't connect and I don't know why.
Answer: You can install Guest Additions:
http://www.virtualbox.org/manual/ch04.html
and then use Shared Folders:
https://forums.virtualbox.org/viewtopic.php?t=15868
Comment: It's also possible to mount a vdi from the host (and access the guest operating system's files): http://superuser.com/questions/34913/mount-virtualbox-vdi-disk
Answer: You can do it with "scp" command, then the ssh daemon (sshd) has to be running on the Windows box as well.
Or use one of the windows scp clients to talk to the centos VM. You can transfer files either way using scp.
Comment: how do you identify the IP and credentials of the guest machine for the scp command?
Answer: I have the exact same setup (Windows 7 Host OS, CentOS 6.5 Guest OS)...
(if you have SSH working on an IP address for CentOS, then you can skip this paragraph below)
I set Virtualbox to use bridged network adapter (Settings > Network > Adapter 1: set to bridged) and after installing Apache (set a hostname, and also turn off firewall with: service iptables stop). You can view the IP address given to you with ifconfig eth0 or narrow the ouput with ifconfig eth0 | grep 'inet addr' | awk '{print $2}'. This is the IP address that should also be in your /etc/hosts file on the same line with your hostname. For testing purposes, put an index.html file in /var/www/html (your web root). Then you should be able to browse to the VM at a local IP address: 192.168.x.x from a browser on your Windows 7 OS.
To transfer files back and forth, you can use WinSCP on your Windows 7 host OS. Create a new session with these settings in WinSCP:
File protocol: SFTP (this means you will be connecting via SSH)
Host name: 192.168.x.x (this is the ip address of your VM)
User name: root
Password: (leave this blank for security reasons...
           but when prompted during connecting you'll enter your root password
           you set for CentOS)
Private Key file: (leave blank...you will be prompted to say 'yes' to accept the key)

Answer: You can use Samba for transferring files. Just install Samba, and then choose the Host OS and then the OS where the files are to be transferred.


Retreive secret key and IV knowing the plaintext and ciphertext?

Question: If I use AES-128 in CBC mode, and I know the plaintext, ciphertext, and length of the plaintext padding, which is 15, can I retrieve the key and IV, using brute force or some special techniques?
Comment: Please take the time to write a well-written question with correct grammar and spelling that clearly expresses what you want to know. Doing so will improve the reception of your question and possibly garner more answers. You can use the "edit" link beneath the question to make changes.
Answer: No, the AES key is protected by the AES block cipher at all times. Only if the block cipher itself gets broken, if the implementation of the block cipher leaks data (though side channel attacks) or if the key is otherwise leaked can the key be retrieved by an adversary. Actually, even if the adversary dictates which plaintext is encrypted, the cipher should still be secure (CPA level security).
The IV is not considered a secret. That means that usually the adversary is allowed to know the IV value. And commonly the IV is simply send with the ciphertext, meaning that the adversary just has to eavesdrop the message containing the ciphertext to learn it.
It is possible to completely hide the IV, but this would not give you any security benefits (the IV is only used for the first block anyway when using CBC mode). The IV could be retrieved by a plaintext oracle attack, where available. However, the attacker could then retrieve the message as well and learning the IV would not give the adversary any additional benefits.
Comment: Note that the key retrieval question has been asked before, so I wondered if I should reply at all. I answered because the IV retrieval question could be beneficial to other crypto novices.


Ignoring subtrees with a certain tag

Question: I want to ignore a subtree temporarily.
I can do this by setting the property :header-args: to :tangle
no, but this is not usually visible.  Could I have this property
set automatically by all subtrees tagged with :notangle:, and
removed when the tag is removed; or something to a similar effect?
Comment: If the subtree will be commented (e.g. with `C-c ;`) it will not be tangled.
Comment: @KonstantinMorenko, perfect, thanks!
Answer: You could comment the subtree with C-c ; (org-toggle-comment).  If the subtree marked COMMENT, it will not be tangled.  I use it into my init files (with org-babel-load-file) to temporary exclude some code.
Comment: If you require you can modify the actual word that triggers the `:notangle:` behavior moreover you can put there a regex (setq org-comment-string "\\(EXCL:\\|COMM:\\|NOTE:\\|PLOT:\\|CTRL:\\)") (set-face-attribute 'org-special-keyword nil :foreground "#ff66cc" :background 'unspecified :weight 'bold)

Ignoring subtrees with a certain tag


Gas limit is not set REMIX

Question: I set the gas limit to 1 000 000 for every transaction. But each transaction takes less amount of gas than 1 000 000. Could you please explain why it happens or what I need to read to get this right. The same problem occurs when I use a call message and pass the gas limit to another contract. For example, I pass 100 000 gas but much less passed in reality.
Answer: The gas limit you set in remix is just the maximum gas you wish to spend on a given transaction. It does not mean that you will spend this much gas.  The actual gas you spend depends on what your contract is doing. If there are complex calculations involved, you will spend more gas to compensate the miners for their processing power.  If the total gas required for the transaction exceeds the gas limit you set, the transaction will fail.
The block gas limit is set by the network and is the maximum amount of gas allowed in a single block.
A really good breakdown of how the gas prices work is the Ethereum docs:
https://ethereum.org/en/developers/docs/gas/

Gas limit is not set REMIX


Can non-deuterated solvents be used for 13C-NMR (and in fact other nuclei)?

Question: Basically, my question is can you used a non-deuterated solvent for 13C NMR? I'm thinking that there might be some problems with locking?
Comment: On top of long's answer, I would just mention that you can use nondeuterated solvents even for ordinary 1H NMR. (This is already implied in the answer.) Ideally, you'd pick a solvent which doesn't overlap with your peaks of interest; and the solvent suppression techniques (routinely used with H2O samples) will be useful too.
Answer: If using a deuterium lock, then normally you would require, as minimum, about 10% deuterated solvent. Without any deuterated solvent, it is not possible to obtain a spectrometer lock (unless using a 19F lock channel, but that is unlikely, and is a hardware requirement).
It is, however, perfectly feasible to acquire spectral data for all nuclei without any deuterated solvent, and hence, without a spectrometer lock. When running without a lock, you need to turn the lock sweep off, to hold the spectrometer field constant. This does not provide the same level of field stability as a lock, but is more than adequate for short-medium 1D experiments that do not require very high resolution. Using gradient shimming, it is also possible to shim on non-deuterated solvents and achieve the same lineshape specifications.
Running long experiments (such as an overnight 13C{1H} experiment), without a lock will give you linewidths that are slightly broader than usual; the consequences of this are that (i) your resolution is reduced (rarely a problem with 13C), and (ii) your signal-to-noise will be reduced (and therefore longer experiment times may be required...leading to further broadening and longer experiment times...)
Not claiming to be the first to report about this technique, the Hoye group published two papers in Organic Letters (2004OL953 and 2004OL2567) with examples of application of no-D $\ce{^1H}$-NMR spectroscopy, covering sample preparation and data acquisition, too.  Especially the second one, outlining how to determine the concentration of LDA or Grignard reagents by addition of 1,5-cyclooctadiene as internal standard may be a reliable and faster alternative to the titrations once you are used shim manually for samples of this type.  But speak and obtain clearance in advance with your NMR manager before running your no-D sample; some interfaces to the spectrometer tend to be less puzzled to record NMR with a lock after your sample (e.g., elder Varian), than the more modern (e.g., Topspin Bruker) to prevent unnecessary delays in the queue of samples following yours.
Comment: In groups where recording NMR spectra by your self is permitted / assumed, recording no-D 1H-NMR may be something as normal as recording your «normal» 1H-NMR spectrum.  Thus I thought the addition of the two Hoye papers were beneficial to your answer given.
Answer: It is indeed possible and you will indeed have problem with locking. My solution is to use sealed capillaries with a deuterated solvent inside. This procedure allows you to lock without having the solvent in your mixture.
Comment: @dissemin8or You may use already a normal NMR tube with a capillary containing your e.g., deuterated trifluoroacetic acid.  Depending on the sensitivity of the NMR spectrometer, a about 5 cm partially [80%] filled, but flame sealed (e.g., by a lighter) melting point capillaries already may do the job.  This isn't too much weight added and may be used multiple times.  Indeed, this will _prevent_ H-D exchange completely. (H-D exchanges may be _slowed_ in dry DMSO-d6, too.) [Schematic example](http://u-of-o-nmr-facility.blogspot.com/2008/06/nmr-to-determine-paramagnetic.html)
Comment: This is an interesting approach, can you provide additional details or citations for those of us not familiar with the technique? Does it require specialized NMR tubes? Can this help in situations where peaks are lost due to rapid H-D exchange?
Comment: @dissemin8or I use normal NMR tubes (5mm) and capillary for melting point determination closed on one side (dimensions 1.55 mm diameter, 75 mm lenght) i fill them in a way that no air is contained in the measuring zone but you have to leave a bit of space for flame seal them. As already mention you can add up to two of them (in this way you even reduce the volume of solution needed in your measurements), my experience is that with C6D6 one is more than enough but when you go for a solvent with less deuterium content like CDCl3 you most likelly need two.


How do you use collision blocks (and triggers) in Geometry Dash

Question: I have searched all over the internet for any answers on how to use the items stated in the question in the Geometry Dash Level Editor but nothing was very accurate or detailed. The help in-game and out (see hyperlink) is absolutely useless and I really just want to know how to use them.
Geometry Dash Level Editor Guide: See Lesson 8
Comment: The best way is to just experiment with them, or search for other youtube tutorials. Some of them are much better than the one you linked.
Answer: Collision Blocks
Collision blocks are blocks that activate the 'collision' trigger when they collide. You can move these blocks with other triggers, and they can be used to trigger things like custom death effects, effects from dynamic movements, etc.
Triggers
Overview
Triggers are essentially things that cause other things to happen. They are invisible while playing the level.
Most triggers are activated when the player moves past the trigger in the level - you can see this point indicated by a vertical blue line. However, triggers can also be set to 'touch triggered' mode. This means the player will physically have to touch the trigger, e.g if I place a trigger (in 'touch triggered' mode) above the player, and they jump and hit it, the trigger is activated.
Groups
Triggers must be set to a group in order to change anything. Groups are things that can be added to objects in the 'edit group' menu. Adding an object to a group allows it to be affected by triggers.
To get triggers to affect a group, you go to the 'edit object' menu and change the 'target group ID' to the group ID of the objects you wish to affect. You do not need to add the trigger to the group.

From here, the guide should adequately explain each trigger in detail - if you need more information, please inform me.


Any phrase or idiom for a person who tries to copy a professional's act without any of the skills needed

Question: A person who tries to copy a professional and skillful person's act, without possessing any skills or experience needed
Comment: Please make your question's title say something about the content of your question.
Comment: Do you mean like 'cargo cult'? (Slightly disparaging)
Comment: What kind of act? Fail film fodder or poser?
Answer: He is a rank amateur.  According to The Word Detective:

a "rank amateur" is a person with absolutely no, zero, nada, zippo
  experience or expertise in a particular task or activity.

The word amateur has undergone a remarkable change in emphasis. The current meanings, given by Merriam Webster are:

one who engages in a pursuit, study, science, or sport as a pastime
  rather than as a profession.
one lacking in experience and competence in an art or science.

In an earlier era, definition 1 predominated, and amateurs were often more skilled than professionals.  For example, in competitive figure skating, one had to maintain one's amateur standing to compete in official competitions, including the Olympics.  When a skater "turned professional" it was often to join an ice show, where the skating was showier, but easier. The restrictions on what one could not do and still remain an amateur eased about the 1960s or so. (Not sure of exactly when.)
According to Etymonline, amateur originally meant

1784, "one who has a taste for some art, study, or pursuit, but does
  not practice it," from French amateur "one who loves, lover" (16c.,
  restored from Old French ameour), from Latin amatorem

The same link gives the later, pejorative, meaning, citing amateurish (1863) as:

having the faults and deficiencies of a non-professional, 1863; from
  amateur + -ish.

I can't speak with any authority on why professionals came to be regarded as, and even actually to often be, more expert than amateurs.  It is beyond the scope of this question, and an explanation involves social, economic and technological factors.
Rank in rank amateur intensifies the amateurishness and removes any possible ambiguity as to the meaning.  For example, Edmund Hillary was an amateur climber when he climbed Everest, whereas many of the people who now pay tens of thousands of dollars to join an "expedition" with guides and Sherpas are rank amateurs as climbers.
Answer: consider to ape someone TFD

to imitate or mimic, especially in a inept way.

As in:
It is pretty standard now for comedians to ape many politician's behavior and manner of speech.
Answer: Many of the synonyms for impostor, provided by Merriam-Webster.com, could work, though they are single words and not phrases or idioms:

charlatan, fake, faker, fakir, fraud, hoaxer, humbug, mountebank,
  phony (also phoney), pretender, quack, quacksalver, ringer, sham

M-W defines impostor as:

one that assumes false identity or title for the purpose of deception

I'd suggest charlatan:

one making usually showy pretenses to knowledge or ability
Answer: She made a ham-fisted attempt to imitate the performer.


What was Charles Spurgeon view on The Lord's Supper?

Question: I was just reading a sermon by Charles Spurgeon and wondered what his view on the Lord's Supper was.
Comment: What sermon were you reading and why did it make you think to ask this question?
Comment: The Warrant of Faith and why? i kinda don't know honsetly it was probably that my mind did remind me that he was a baptist that most of bapitsts seem to hold memorialist views and so my brain asked "does it apply to him too" or something like that
God bless you and your family(like in non-offensive way i know it may sound passivly-agressive but i don't mean it)
Comment: thanks - this question just showed up in the queue and I thought it seemed like it could use some more context
Comment: Although this question does not meet the standards of CSE (no research, not enough information), the answers are good.  For that reason alone, I think the question should stay.
Answer:
"This is my body, which is for you." That is to say, Christ is for you—does not the supper itself say that? The bread represents His body for you—the wine represents His blood for you. We know that it is for you, because you are going to eat it. There is nothing that is more certainly a man's than what he eats or drinks.
(Sermon: THE RIGHT OBSERVANCE OF THE LORD'S SUPPER, 1899)

This indicates he held a memorialistic view of communion.
Further:

[Referring to 1 Corinthians 11:26] Just in passing, notice that it is bread that they eat, and it is wine that they drink; nothing is said about transubstantiation here; but "as often as ye eat this bread," — and it is bread, and nothing but bread, — "and drink this cup," which still remains but a cup, and its contents just what they were before, — "ye do shew the Lord's death till he come." (Sermon: The Object of the Lord's Supper, 1877)
Answer: This is from a communion address given by C.H. Spurgeon in December 1882, at the close of the College Conference. There is far too much in the booklet to copy here, so I will take a few extracts, to give you the flavour of what it would have been like to sit in such a gathering, around the Lord's table that day.

"We have nothing now to think of but our Lord. We come to Him that He
mat cause us to forget all others. We are not here as ministers,
cumbered with much serving, be we now sit at His feet with Mary, or
lean on His bosom with John. The Lord Himself gives us our watchword.
'Remember me' is the loving command. We beseech Him to fill the full
circle of our memory as the sun fills the heavens and the earth with
light. We are to think only of Jesus, and of Him only will I speak. Oh
for a touch of the live coal from Him who is our Altar as well as our
Sacrifice!
The text is found in the words of John, in Revelation chapter one, at
verses 17 & 18: 'And when I saw Him, I fell at His feet as dead. And
He laid His right hand upon me, saying unto me, Fear not; I am the
first and the last: I am He that liveth, and was dead; and, behold, I
am alive forevermore. Amen; and I have the keys of hell and of
death.'
John was of all men the most familiar with Jesus: if any man could
have stood erect in the presence of the glorified Saviour, it would
have been that disciple whom Jesus loved. Love permits us to take
great liberties: the child will climb the knee of his royal father,
and no man accuses it of presuming; John had such love, yet even he
could not look into the face of the Lord of glory without being
overcome with awe... A clear view of our Lord's heavenly splendour
while we are here on earth would not be fitting, for it would not be
profitable for us always to be lying in a swoon at our Redeemer's
feet, while there is so much work for us to do.
...If we are permitted to see Christ in the simple and instructive
memorials which are now upon the table, we shall in a blessed sense
fall at his feet as dead. For, first, here we see provision for the removal of our sin, and we are thus reminded of it. Here is the
bread broken because we must have been broken for ever had there not
been a bruised Saviour. In this wine we see the token of the blood
with which we must be cleansed, or else be foul things to be cast away
into the burnings of Tophet, because abominable in the sight of God.
Inasmuch as we have before us the memorial of the Atonement for sin,
it reminds us of our death in sin in which we should still have
remained but for that grace which spake to us of life and salvation...
We sin and still need the cleansing blood. How this humbles us before
the Lord! We are to be winners of sinners, and yet we ourselves are
sinners still, needing as truly the bread of life as those to whom we
serve it out.
...We may well fall at Jesus' feet, though He only reveals in bread
and wine, for these convey a sense of our sinnership while they remind
us of how our Lord met our sin and put it away. Herein we fall as low
as the dead. Where is the 'I'? Where is the self-glorying? Have you
any left in the presence of the crucified Saviour? As you in spirit
eat His flesh and drink His blood can you glory in your own flesh, or
feel the pride of blood and birth? Fie upon us if there mingles a
tinge of pride with our ministry, or a taint of sef-laudation with our
success. When we see Jesus our Saviour, the Saviour of sinners, surely
self will sink and humility will fall at His feet. When we think of
Gethsemane and Calvary, and all our great Redeemer's pain and agony,
surely by the Holy Ghost self-glorying, self-seeking, and self-will
must fall as though slain with a deadly wound. "When I saw Him, I fell
at His feet as dead."
Here, also, we learn a second lesson. Jesus has placed upon this table
food. The bread sets forth all that is necessary, and the cup all that
is luxurious: provision for all our wants and for all our right
desires: all that we need for sustenance and joy... Brothers, we are
Gentlemen Commoners upon the great bounty of our great Kinsman; we
come to his tab le for our maintenance: we have no establishments of
our own. He who feeds the sparrows feed our souls; in spiritual things
we no more gather into barns than do the blessed birds; our heavenly
Father feeds us from that 'all fulness' which it hath pleased Him to
lay up for us in Jesus. We could not live an hour spiritually without
Him who is not only our bread, but life; not only the wine which
cheereth, but consolation itself. Our life hangs upon Jesus; He is our
head as well as our food... He is the great One who feeds us, who give
us all that we enjoy, who is our all in all; and as for us, we are
suppliants - I had almost said mendicants - a community of Begging
Freres, to all personal spiritual wealth as dead on the slain on
Marathon. The black slave at least could claim his own breath, but we
cannot even claim that. The Spirit of God must give us spiritual
breath, or our life will expire. When we think of this, surely the
sight of Christ in this bread and wine, though it be a dim vision
compared with that which ravished the heart of John, will make us fall
at the Redeemer's feet as dead...
Now let us consider how we get alive again, and so know the Lord
as the resurrection and the life. "He laid his right hand upon me,
saying unto me, Fear not; I am the first and the last: I am he that
liveth, and was dead; and behold, I am alive for evermore, Amen; and
have the keys of hell and of death."
His foot has been pierced for us, and it cannot b e that foot which
has been nailed to the cross for His people should ever trample them
in His wrath. "He laid His right hand upon me." The right hand of His
strength and of His glory He laid upon His fainting servant. It was
the hand of a man. It is the right hand of Him who in all our
afflictions was afflicted, who is a brother born for adversity. Hence.
everything about His hand has a reviving influence...
This Lord's supper represents the giving of the whole body of Christ
to us, to enter into us for food; surely if we enter into its true
meaning we mat expect to be revived and vitalized; for we have here
more than a mere touch of the hand, it is the whole Christ that enters
into us spiritually, and so comes into contact with our innermost
being. I believe in 'the real presence,' do not you? The carnal
presence is another thing: that we do not even desire. Lord Jesus,
come into a many handed contact with us, and us in thee.
Still there was something else wanted, for our Lord Jesus, after the
touch, gave the word, 'Fear not; I am the first and the last.' He did
not direct His servant to look at himself, but to remember the great I
AM, his Saviour, and Lord. The living comfort of every swooning child
of God, of everyone who is conscious of a death-wound to the natural
'I' lies in that majestic 'I' which alone can say 'I am'. You live
because there is an 'I am' who has life in Himself, and has that life
for you. 'I am the first' I have gone before you and prepared your
way; I loved you before you loved me; I ordained your whole course in
life before you were in existence. In every work of grace for you and
within you, I am first. And I also am the last, perfecting that which
concerns you, and keeping you unto the end. A am the Alpha and the
Omega to you, and all the letters inbetween...
Read on, 'I am He that liveth'. Because I live, ye shall live also; no
real death shall befall you, for death hath no more dominion over me -
your head, your life. While there is a living Christ in heaven no
believer shall ever se death: he shall sleep in Jesus, and that is
all, for even then he shall be fore ever with the Lord.
Read on, 'And was dead'. Therefore, though you die you shall go no
lower than I went; and you shall be brought up again even as I have
returned from the tomb. Think of Jesus as having traversed the realm
of death-shade, and you will not fear to follow  in His track. Where
should the dying members rest but on the same couch with their once
dying Head.
'And behold, I am alive for evermore.' We serve an ever-living Lord...
The believing heart can never be a widow, for its husband is the
living God. Our Lord Jesus will not leave us orphans, He will come
unto us. Here is our joy, then: not in ourselves, but in the fact that
he ever lives to carry out the Father's good pleasure in us and for
us. Onward, soldiers of the cross, for an immortal Captain leads the
way.
Read once more, 'And have the keys of hell and of death'. The prince
of evil, the devil, hath not the keys of his own house! They are
swinging at the girdle of Christ! Surely I shall never go to hell, for
my Lord Jesus turned the key against my entrance long ago. The doors
of hell were locked for me when He died on my behalf...  Whenever He
chooses, He can cage the devouring lion, and restrain the power for
evil. That day is coming, for the dragon hath great wrath, knowing
that his time is short... When Joshua, the high priest, stood before
the angel clothed in filthy garments, Satan stood at his right hand to
resist hi, but he was silenced by being told of the election of God:
'The Lord which hath chosen Jerusalem rebuke thee.' Ah, brethren, when
Christ's right hand is upon us the evil one departs. He knows too well
the weight of that right hand.
Conclude the verse - 'And of death'. Our Lord has the keys of death,
and this will be a joyful fact to us hen our last hours alive... We
feel quite confident to go wherever he leads us. Our bodies shall
descend into what men call a charnel-house, though it is really the
unrobing-room of saints, the vestibule of heaven, the wardrobe of our
dress where it shall be cleansed and perfected. Our bodies shall rise
again in the likeness of 'the Lord from heaven'. So if the worst fear
that crosses you should be realised, and you should literally die at
your Lord's feet, there is no cause for dread, and no enemy can do you
harm, since the divine right hand is pledged to deliver you to the
end. Let us give the Well-beloved the most devout and fervent praise
as we now partake of this regal festival. The King sitteth at His
table - let our spikenard give forth its sweetest small. Amen. Sword and the Trowel, December 1882."


How is the exogenous DNA protected from degradation during bacterial transformation?

Question: During transformation, a bacterium can take up DNA from its environment. A small fraction of bacterial species are known to be naturally competent, meaning that they can engage in this sort of horizontal gene transfer in their natural environments.
As I understand it, naturally competent bacteria carry genes that encode the machinery necessary to facilitate the transport of this DNA across the membrane and into the cell. The exogenous DNA binds to a receptor located on the surface of competent cells, gets fragmented into small pieces, and then one strand is degraded while the other strand is transported across the membrane into the cytoplasm with the aid of a DNA translocase enzyme. Ultimately, assuming a sufficient degree of homology, it incorporates into the host genome via recombination.
During this process, however, the DNA has to be protected from degradative nucleases. I remember reading something about a transformation-specific DNA binding protein that coats the entire length of the DNA strand and prevents degradation. Is it the same translocase enzyme that facilitates movement across the membrane that is responsible for this? Or is there another protein involved?
And then, regardless of which protein is responsible in the case of natural competence, how does that protein get expressed and activated in the case of artificial competence? When we induce competence in the laboratory through one of various methods (e.g., electroporation), the DNA is essentially forced into the cell through openings in the membrane, so no transferase protein is needed. What signals the bacterium, then, to express the protective binding protein? What keeps the exogenous DNA from being readily degraded by endogenous nucleases? Whatever signals induced the expression of this protein in the case of natural competence would seem to be absent when competence is induced artificially, and it doesn't make any sense that the bacterium would constitutively express such a protein.
Comment: As an aside, one of the reasons that plasmids are circular no doubt is to prevent natural degradation of the sort you are talking about.
Answer: Different bacteria have different modes of transformation and as I understand it is Haemophilus influenzae that takes up the single strand whereas ?Streptococcus [i am not sure which bacteria it is] takes up dsDNA.
I intuitively think that DNAses are not that common like RNAses. Moreover, natural competence is associated with stress and is even triggered by DNA damage. Therefore we can speculate that DNA repair proteins will be prevalent and DNAses will be low in the cell, under these conditions. The chance of foreign DNA being damaged goes down.
In the case of artificial transformation, I guess the entire concept of heat shock is a way of providing stress. Moreover, the lab strains such as DH5alpha have certain mutations which disable them from recognizing a plasmid as "foreign".


How should I understand this sentence grammatically?

Question: The sentence is, "She is as tall as I am." I'm having trouble with the "as ... as ..." structure. I understand that the second "as" is a preposition followed by a noun clause. My guess is that the first "as" acts as an adverb which modifies "tall" and that the "as I am" phrase also modifies "tall"?
Comment: This is probably a better question for ELL.SE
Answer: She is as tall as I am.
You are correct; the second "as" is indeed a preposition; it is in construction with the first "as" which is an adverb of degree modifying "tall".
The "I am" is a comparative clause as complement of the prep "as". Comparative clauses are obligatorily reduced in some way, as your is, since the complement of "am" is left understood.
The meaning is "She is x tall; I am y tall; x=y".
Comment: This is wrong. Prepositions do not join clauses, conjunctions do. "As" is absolutely not a preposition here. If you want to use a preposition, you need an object to follow, as in "She is as tall as me."


How calculate the error offset or the noise threshold for MyoWare and FSR sensors?

Question: I am working on EMG and FMG signals to extract time domine features and i need a threshold value for some features. I must calculate it from the characteristics of MyoWare and FSR sensors.For the MyoWare sensor i concluded that it is the error offset from the CMRR.The MyoWare has as CMRR:110,Adjustable Gain Potentiometer:50 kΩ,Input Impedance:110 GΩ and VIN=5v.How can i calculate the error offset? and i still stucked in the threshold of the FSR sensor.Can anyone help me?
Answer: In a measurement system, an error budget is key to accurate measurement.

Input Impedance 110 Billion ohms has meaning, in a model of the cell walls you are sensing. The cell_Walls form a voltage_divider with the 110 Billion ohms. That ratio defines a measurement error. If you know the cell_Wall resistance or impedance, you compute that ratio.

CMRR 110: Assuming this is 110_dB, where the ratio is 10^(110db/20db) = 10^5.5 and that becomes 316,000:1 . This is used in computing how badly the power_line voltages on the biological tissues change from common_mode to differential_mode. As example, if you have 0.316 volt at 50Hertz on the biological entity, divide that by 316,000 as 0.316 / 316,000 and find 1 microvolt is the error caused by Common Mode Rejection Ratio. Please note I assumed 110 is really 110_dB.

there may be DC_offset errors. Ask the professors if you should be concerned.
Comment: thank you for the response @analogsystemsrf.the CMRR is not expressed with dB it is without unity


What is flash fiction?

Question: Is it simply defined by its short word count? Or are there other accepted conventions in flash fiction? If it's just the word count, how short is too short? How long is too long?
Answer: I have written flash fiction as short as 50 words and seen submissions in the range described by OneMonkey.
Flash fiction is largely defined by the word count, but doing flash fiction well is more than just getting the right word count.  Imagine telling an entire compelling story in 200 words.  That's an extreme compression of the rising action, climax, falling action sequence.  Because of the compression, flash fiction often shares characteristics with poetry.  In poetry each word often has multiple tasks and each phrase and image has multiple layers of meaning.  Flash fiction is the same way.  Flash fiction doesn't necessarily carry the same emphasis on the lyrical quality of the writing as poetry, though.
Because of the short nature of flash fiction, it is often very well suited to intriguing revelations close to the end of the work.  The most compressed part of the piece is usually the falling action, which often is less and less important to a story as the word count decreases.
Comment: @Final Draft - personally I think literary, mystery, and romance would be better suited than science fiction or fantasy because there's not time for world-building in flash fiction, but I'm willing for an excellent piece of sci fi flash fiction to prove me totally wrong.
Comment: Think any particular genre of fiction is better suited than others to the format?
Comment: A short story of exactly 100 words is referred to as a "drabble" and the practice of writing them a game. "Frankenstein" and "The Vampyre" both started as drabbles.
Answer: Flash fiction is primarily determined by its word count. The max word count I've seen for flash fiction is 1000 words but could be as low as 300 words. For it to "count" as flash fiction it has to be a complete story with a beginning, middle, and end and not just an excerpt.
There are other sub-categories of flash fiction though:
Micro fiction - Anywhere from 50-250 word max depending on the site
Drabble - exactly 100 words
69er - Story in exactly 69 words
Nanofiction - A story of exactly 55 words
Twitfiction - A story in 140 characters or less
Answer: Zoetrope defines flash as a short piece of between 200-1000 words. That's the only restriction they have on submissions to their flash fiction workshop.
Answer: I've seen items as short as 50. That seems to be the bottom of the barrel, so to speak. I think there's even a specific contest for pieces of 50 or 51 words. I can't remember the name though.
Answer: Flash fiction is really short. That's about it. And, well, not being real, you know. And it has to be complete. A good exercise is to start with short fantastic stories, one or two pages long, to get the gist of ending things in a short written span.

What is flash fiction?


Are there any real advantages to assigning more "cores" to VirtualBox?

Question: I have an 2.8 quad core i7 with a VirtualBox.  I have the option of assigning up to 4 cores to a guest machine, but I have only been doing two.  What are the advantages/disadvantages of assigning more cores to a guest?  BTW, I am still able to play StarCraft 2 on Ultra settings all the way while running two guest OS's (Win 7 and Ubuntu), and same goes with BFBC2 (my stress testers).  How does the i7 react to uneven loads accross cores?
Answer: The "virtual" cores you assign to a VM are available to use in multi-processing within the client OS. If you assign only one core to a VM, then there is no chance by the guest OS to distribute load across multiple cores. So let's assume some practical scenarios:
Host with 4 CPUs, guest assigned 1 CPU

Host machine running 4 physical cores
Client OS within VM assigned 1 core

In this case the guest OS will be able to use only one core. Therefore if you run a multi-threaded application which scales well on multiple cores it will still run on one core only. Therefore all threads on the guest OS have to share one physical core.
Running a guest OS in this setup which fully loads the CPU will yield a host OS CPU load of ~25% (one out of 4 cores loaded on host).
Of course you can still have CPU-consuming tasks running within your host OS and make use of the remaining 3 cores.
Host with 4 CPUs, guest assigned 4 CPUs

Host machine running 4 physical cores
Client OS within VM assigned 4 cores

In this case you can run well-scaling multi-threaded applications within the guest VM which can make full use of all 4 virtual CPUs. VirtualBox will use 4 physical cores to process tasks scheduled within the VM and therefore your host CPU load could reach a maximum of 100% usage.
So what setting should you chose?
The answer to this question depends pretty much on what you would like to do. In some cases it might be useful to assign all cores to a VM or even running multiple VM having each one the full amount of CPUs assigned. In such cases a VM can make full use of the whole processing power of the host. If more CPUs are assigned to VMs than actually physicall present then the VMs will be impacted by load on different VM. To prevent this you might dedicate some cores to specific VMs. For example running 2 VMs with 2 CPUs assigned each on a 4 core node could help that each VM gets 2 dedicated CPUs (assuming there is no load imposed by host OS which takes a part of the processing-power too).
Does it have negative impact on my host to assign all cores to a VM?
Again this depends on the software run. If you run a VM which is idle (no CPU-intensive programs run at all) the load imposed by this VM will be near to 0%. You can even run 10 VMs in parallel and still experiencing a host CPU load of close to 0% if all VMs are idle.
How does the CPU behave on uneven load?
Well, CPU load distribution heavily depends on an OS-specific built-in component called the scheduler. For Windows XP the scheduler tried to round-robin load all CPU cores. So running a single-threaded task with full load on a quad-core CPU would have yielded ~25% load on each core.
Unfortunately this has proven to be bad for modern CPU power management. For modern systems it's even an advantage if one single core is loaded up to 100% before the second core even gets involved. The reason is that as long as there is not sufficient load to fully use up one core the other cores can remain in deep-sleep mode to save energy and reduce heat dissipation.
For some CPUs like Intel Core i-Series and newer AMD (Bulldozer) this is even more interesting since in case only a subset of the cores are used the unused ones are switched off. This reduces the power consumption of the CPU. Both (Intel and AMD) start to use the thermal and power consumption budget then to overclock the cores which are active. So this can give single-threaded applications (which cannot be distributed to multiple cores to work on a task in parallel) a boost. However when all cores are active then most of these "boost" technologies do have only a small effect on processing power since the "all cores active" situation is exactly the situation the CPU was designed for. But when you switch off some cores then the remaining cores can run overclocked without causing the chip to run more hot (or consuming more power) than in case all cores are active.
So the answer is that your core i7 very well handles uneven load on single cores and might even provide a performance boost to single-threaded applications. However this boost is within the range of a few percent while actually multi-threaded applications which can distribute the load across multiple CPU cores can be boosted by factors (x2 on dual-core, 4x on quad-core...) in optimal case. So multi-threading is always providing more power in terms of combined CPU power than single-threading combined with clock boosting.
Comment: I was having a problem with my Ubuntu 12.04 LTS client running really slow on my Macbook Air w/ 2 ghz i7 Dual core. I upped the client's setting to two cpus and now it blazes. I am ignoring the warning message of unoptimal settings .
Comment: Wow, that really helps me understand multi-core behavior, not just how it affects vms.
Comment: It's very complicated since VirtualBox doesn't use Core's it uses Processors and everyone has 1 Processor maybe 2.. even if it's a quad-core or octa-core, unless they call Cores Processors?
Answer:
In a comment elsewhere, VirtualBox expert "mpack" writes:
In real life, a lot of operations are disk-bound or network-bound.  Only a minority of operations are CPU-bound.
The more cores you create for your VM, the more overhead these cores will cause (due to context switches).
In practice, the ideal choice is usually to assign two cores to each VM.
If you need to run CPU-intensive tasks all day, such as video encoding, don't run these tasks in a VM.  Run them on the host OS:  they'll run faster there.


turning positional servo motor more then 180 degrees

Question: My RC servo motor is capable of turning more then 180 degrees(around 200 degrees) when I physically turn it, but when I use my code it only turns 180.
Is there a way to code it so that it turns to 200 instead of 180?
Comment: what code are you talking about?
Answer: First some basics to clear definitions:
A Servo Motor does not normally spin a full 360 degree rotation. Instead it is limited to a range of 180, 270 or 90 degrees depending on the make or type. A control signal is sent to the servo to position the shaft at the desired angle.

Conventional Servo Motor Timing

In a conventional analog servo motor a PWM signal with a period of 20 ms is used to control the motors. A signal of 20 ms has a frequency of 50 Hz.
The width of the pulse is varied between 1 and 2 ms to control the motor shaft position.

A pulse width of 1.5ms will cause the servo shaft to rest in the 90 degree position, the center of its travel.
A pulse width of 1ms will cause the servo shaft to rest at the 0 degree position.
A pulse width of 2ms will cause the servo shaft to rest in the 180 degree position.

Varying the pulse width between 1ms and 2ms will move the servo shaft through the full 180 degrees of its travel. You can bring it to rest at any angle you desire by adjusting the pulse width accordingly.
So if your servo is a 270 degree servo (like the domanrc DM-S0903MD or DS3218 270 Degree Digital RC Servo) the standard sweep sketch (Arduino Servo library) will let your servo sweep from 0-270 even if in the *.ino its myservo.write(180); So to simply test you could use write(map(desired_angle, 0, 270, 0, 180))
If you want to control it more precicly you use microseconds.
servo.attach(5,500,2500)
servo.writeMicroseconds(1500);

AND you have to use an extra power supply for 270 degree servos, the 5V from Arduino want make them move or only in a jittering way of.
If you just have a "defect" 180 degree servo turning to lets say 190 degree for some reason, you might try the microsecond method playing around with the values in attach, also use an extra power supply, but for real over 180 degree action get a 270 degree servo.
Answer: Just because a servo can manually be turned more than 180 degrees doesn't mean that it should be turned more than 180 degrees.
Most servos will include a certain amount of leeway in their design to help reduce damage from external forces, but the internal design will be geared1 towards operating over a 180 degree range.
While it may be possible to "overdrive" the motor by changing the PWM timing signals (see the Servo attach() reference page) doing so may end up damaging the servo itself.

1: Pun intended


Special case of work done by two opposing forces of equal magnitude on a body possesing inertial motion

Question: Consider an elevator moving upward with constant velocity. The constant velocity is maintained by an upward tensional force equal to weight. If we add the total work done on the elevator it will be zero since work done by two equal and opposite forces cancel out. But the elevator's P.E is increasing. How and who does the work? I think no change P.E takes place i.e. only when we have removed the upward force we can have PE stored in the system. Is  this true? Also, can we say that the upward force is *doing any work * because although the object is displacing in the direction of force but it is not causing it.
Answer: A common misconception. The elevator does negative work on the motor (the force of the elevator on the rope is in the opposite direction to the velocity), while the motor does positive work on the elevator (force and velocity in the same direction).
So energy is transferred from the motor to the elevator, where it becomes potential energy (in the earth-elevator system: the force of gravity on the elevator is in the opposite direction to the velocity of the elevator relative to the earth...)
Answer: The total work done on an object by all forces is equal to the change in its kinetic energy.
If you take the sum of all the forces on an object and multiply it by the distance traveled, you will have calculated the change in kinetic energy, not potential energy.
$(F_1 + F_2 + \cdots + F_n)\cdot\Delta x = \Delta K$
For your elevator, the forces sum to zero, so the change in kinetic energy is zero ($\Delta K = 0$). Thus, the elevator moves with a constant velocity.
We can group these forces into conservative and non-conservative forces. Conservative forces give rise to potential energies (gravity, electric fields, among others). The motor does not produce a conservative force.
$(F_{conservative} + F_{non-conservative})\cdot\Delta x = \Delta K$
In our case, the conservative force is gravity, and the non-conservative force is the motor.
$(F_{gravity})\cdot\Delta x + (F_{motor})\cdot\Delta x = \Delta K$
The work done by a conservative force results in changes in potential energy.
$-\Delta P + (F_{motor})\cdot\Delta x = \Delta K$
The negative sign comes from the fact that if gravity (for example) does positive work on an object by pulling it down to the ground, the potential energy of that object decreases since it goes to a lower elevation.
$(F_{motor})\cdot\Delta x = \Delta K + \Delta P$
So, the motor doing work can change both the potential and kinetic energy of the elevator. In your question, the elevator has a constant speed, so $\Delta K = 0$. Thus,
$(F_{motor})\cdot\Delta x = \Delta P$
The motor's work does indeed change the potential energy of the elevator.


How to Make RF Waves Visible

Question: I understand RF (Radio Frequency) Waves are electromagnetic waves and a mode of communication for wireless technologies, such as cordless phones, radar, ham radio, GPS, and television broadcasts. Most modes of RF waves are invisible. Can RF Waves be visible? If so, how do I make RF Waves visible? Is an X-ray an example. Please give me a few examples?
Comment: To make RF waves visible you should run toward the source **very** quickly. Eventually they will become red, then yellow, green, blue.
Comment: Dude I had this idea couple years ago, also make sounds waves visible that would be much cooler :)
Comment: @0x90, Sound waves can be done with appropriate chemical stimulation of the nervous system. RF is a much harder problem.
Answer: One way to make RF waves visible is with something like a radio telescope. An ordinary (light) telescope collects light and focuses it onto a receptor (CCD, photographic plate, the eye), thus making it possible to see the visible radiation emitted by a distant galaxy.
A radio telescope does exactly the same with RF frequencies. The resultant display shows us the intensity ("brightness") and frequency ("colour") of the RF radiation coming from different parts of the object under study.
Other telescopes reveal yet other parts of the spectrum (IF, UV, X-ray, etc). When comparing the same object at these different frequencies, we can see differences that give scientists clues about the physical processes that operate in the object. However, each part of the spectrum requires its own specially designed instrument.
Comment: Also worth noting that what you "see" is a false colour image, rather than what RF "actually" looks like,
Comment: Your link to the "comparing the same object at different frequencies"  no longer works.
Answer:
Is an X-ray an example?

An X-ray is not an example of an RF wave. Electromagnetic waves are classified based on their frequencies (or, equivalently, their wavelengths). RF waves are low energy, and have wavelengths from 1 mm to 100 km. X-rays are extremely high energy, and have wavelengths from 0.01 to 10 nanometers. Visible light (which is just another range of wavelengths in the electromagnetic spectrum) has wavelengths from about 380 to 740 nanometers.

Can RF Waves be visible?

Assuming that you mean "visible" in the sense that the photoreceptors in human eyes would respond to them, then no, RF waves are not visible. Photoreceptors only respond to electromagnetic radiation in the visible spectrum.

If so, how do I make RF Waves visible?

There is, however, a slight loophole. It depends upon whether you define the wave as being RF in the rest frame of the object emitting the wave or the observer (that is, your eye). If you define it in terms of the observer, the answer is again unambiguously no. However, if you define it in terms of the emitting object, the frequency of the wave could be blueshifted into the visible spectrum provided that the emitter and observer are moving towards each other at high velocity (the relativistic Doppler effect).
Answer: They are all examples of electro-magnetic waves, radio-frequency (RF) are those that are in the range of frequencies we call radio.  The limits of frequencies that you would call "radio" depends on the field you work in.
An X-ray is like a radio wave but very very much higher frequency.
All radio frequency waves are much lower frequency and so much lower energy than visible light and so you can't make them visible directly. You can make some invisible frequencies directly visible by using them to make something else emit energy in a frequency we can see.
That's easier if the frequency is higher (more energy) than visible because the process will lose energy. So for example there are materials that will take in a high energy X-ray wave and give out a much lower energy visible one.  It's much harder to make a material that will take in lower frequency (lower energy) waves and give out higher frequency (higher energy) visible ones. You can do it for frequencies that are only a little too low but not something as low energy as RF.
Answer: In some sense, it is possible to visualize RF waves using, e.g., thermochromic liquid crystals, which change color with temperature: the liquid crystals are applied on an RF absorbing film and change color when RF waves heat the film.
Answer: As I have the same question, and I have a completely different solution, which I would like to share with you. In order to see an invisible wave, the solution is to use another carrier visible wave to interfere or act as a carrier for the invisible wave. The same as the carrier waves used to carry sound waves. The carrier wave, we are speaking about here has to be a monochromatic light to act as a carrier. In this case the invisible wave will appear in the form of interference in the monochromatic ray which will be directed through the invisible wave.
Comment: There is a carrier used to carry sound waves?
Answer: I like Will Briard answer, and since I can't vote or comment until I reach a limit and I don't like to post mediocre or wrong answers like others, I'll expand Will answer here in lamer terms.
Interference is like Moiré. Moiré and interference is what makes you see the tire of a car static, while in motion, because the speed of the tire matches the speed of the frames-per-second of the video (in usa 29.97 fps, in film 25fps)
so you are able to see a fast-moving object in the visible parameters of our eyes.
Have you been watching TV near a fluorescent light and you are constantly seeing the room's light flashing? Well, that's not the speed of the bulb or TV set frequencies, but the "moiré" or interference between both.
Same happen when you overlap two line patterns, like psychedelic 70's effects in music videos. The two patters make a third patern, which moves in a third direction.
Same happens when you say "Ohmmmmmm" (or whatever the english onomatopoeia is for the indian meditation vocalization). You are actually tunning to the ambience resonation (sun I think), and you can actually "hear" when they match.
You could say you are listening to the "sound" there.
Last, stroboscopic devices like the ones to "see" the piston of a car while fast moving, or the ones used to "see" the lines around a disc-jockey's vinyl records turntable, by introducing a second frequency (the flashing light).
In these cases you are seeing the "object", not the frequency (which light is) but at least you can know, by measuring the frequency you are mixing in, what the frequency of the rf is, or its subtle variations.
Comment: "Ohmmm" is not tuning into an ambient resonance, especially not of the Sun.  If it is resonant in any way at all, it's in your own throat / skull and not your surroundings.
Comment: It's called "OM" and if the resonance was in your head, why do all people tune at the same frequency? I think you were doing it wrong. http://en.wikipedia.org/wiki/136.1_Hz

Not my fault if I CAN tune to 136.1 naturally and you can't.

How to Make RF Waves Visible