TCA9548A Reset Pullup Resistor

Question: Is the pullup resistor on the reset pin of the TCA9548A multiplexer necessary if I do not intend to ever use the reset pin?   The datasheet says to "Connect [RESET] to VCC... through a pull-up resistor, if not used."   If the pin is not used do I really still need a resistor?   Will the IC ever try to assert that pin low for any reason causing a short?   I can't think of any other reason why they would recommend a resistor.
Comment: You may need to debug with a reset in future. It is called good design practice (DFT) which of course you are free to ignore.
Comment: Are you asking if you should use a pull-up resistor, or if you can just short it out to Vcc?
Comment: Possibly to protect the reset input during power cycling.  If the datasheet advises you to do it, not doing it you're on your own.
Comment: Fair enough -- I guess it's no harm just to add it in there
Comment: @Tony Stewart do you mind making your comment an answer so I can accept it and people won't think this is an unanswered question
Answer: The datasheet actually says, in section 8.4.2:

The RESET input must be connected to VCC through a pull-up resistor

Please note the level of assertion: MUST. It is therefore the condition when manufacturer guaranteed the IC to function correctly.
According to the datasheet, Table 6.5 DC characteristics, the RESETn pin is listed a having leakage anywhere from +1 uA to -1 uA. If you leave  this pin unconnected, it might assume some middle level in vicinity of switching threshold, and can begin to oscillate like hell, screwing all things. The effect might be spurious, depend on ambient humidity and temperature, affecting maybe 20-30% of your boards.
If you decide to connect this pin to VCC directly, you might run into another trouble. Again, according to the datasheet, it takes only 6 ns for the RESET to go active and reset all internal circuits. Only 6 ns !!!. You might be even unable to see this glitch even with a good oscilloscope. It is well known that power rails can have glitches due to logic switching around, and bypass caps can't be placed at every centimeter of board. So glitches on power rails do happen, and they might reset your mux configuration in the middle of operations. But if you use say, a 10k pullup, together with 5 pF input pin capacitance you will have a 50-ns filter at least.
But instead of listening to all this musing about glitches, leakages etc. you could simply follow manufacturer's requirement and get a working device without wasting your time. Always assume that there is a reason behind every manufacturer's requirement.
Comment: 5ns glitch to Vcc/2 demands very high current on 0.1uf of about> 50A which is unlikely Ic=CdV/dt
Comment: @TonyStewartolderthandirt, 50ns glitch would need only 4A, but will reset the IC in no time, better than a 6-ns glitch. Also, rails are inductive, and can be perceptive to external EMI. Switchers can easily ring at 10-20MHz as well. Equipment with an IC with sensitive RESET connected directly to power rail is a recipe for trouble, it won't pass immunity to EFT (61000-4-4) test. Whatever the reasons are, RESETs should not be connected to power rails, period.
Comment: Of course most newbies ignore magnetic radiated and conducted impulse noise vs ESR of shunt caps if they exist here or not

TCA9548A Reset Pullup Resistor


Why is it that when you give someone approval to spend funds, they cannot approve someone else to spend?

Question: Perhaps, this is already possible, but when I approve someone to spend tokens on my behalf using the approve method, why can't they just delegate their spending authority to someone else?
Answer: You could certainly write a smart contract that worked that way.
I believe that spending such coins would require finding at least one path through an arbitrary DAG of approvals. In the best case, this is O(n) in the smart contract where the caller specifies a valid set of approvals that will allow the transfer. In the worst case, the smart contract has to attempt to find those approvals itself, which could be quite expensive.
So I imagine this isn't commonly done because it's computationally expensive.
Unless you're thinking of the second approval replacing the first, in which case this should be fairly trivial to do?
Answer: Although it is easily possible to write a contract which delegates the approval to spend tokens to a different address other than that was stated in the function parameter, I believe it would be a violation of ERC20 spec in which the algorythm of the approve function clearly states that namely the appointed address gets allowance to spend tokens.
And from the point of view of the function caller it is quite unexpected if someone else receives the allowance to spend tokens.


QGIS dividing a raster by a polygons layer

Question: I've got a raster image and I want to divide that raster by a polygon layer. There are just 7 polygons in the layer so i need to obtain 7 raster images as output.
How can this done in QGIS?
Answer: If I understand you correctly, you can use the Clipper tool (Raster > Extraction > Clipper):

If you want to automate this, you can do it by creating a model or by python scripting.
Answer: Easiest thing to do is to use the Clipper function in the Raster Menu. You'll see in that there is a "clipping mode" option set and you can set it to a mask layer which will allow you to select a vector layer. You would need the 7 polygons to be in different layers though.
In the processing toolbox you will find a "clip raster by mask layer" which does roughly the same thing.
I came up with a workaround if you're looking for multiple graphical raster files (aerial photography, background mapping) clipped to vectors. I use this for providing data to third parties, but you could equally use it for extracting a WMS or for getting subdivisions of a raster. Using the atlas builder, you can cover the whole page with the map and then run the atlas builder using your vector input layer (if your vectors are irregularly shaped, set the symbology to inverted polygons. Make sure you set the output to a geotiff. I'm not sure if that will be of use to you, but it's an idea if you have lots of vectors.


Hibernate ScrollableResults via HQL requires left join fetch for every association

Question: Hopefully some Hibernate guru can help out.
I have an object structure that looks like this:
class Customer {
    private Stuff1 stuff1;
    private Stuff2 stuff2;

    // Bazillion other fields
}

class Report {
    private Customer customer;
    private String uniqueBatchId;

    // Bazillion other fields
}

class AbstractSpecialReport {
    private Report report;

    //Bunch of other fields
}

class SpecialReport extends AbstractSpecialReport{
    private List<ReportParts> reportParts;
}

All three are annotated as Hibernate entities and all associations are default (using Hibernate 3.2, so should be lazy by default.
I want to use this HQL to get the results, using ScrollableResults. I've done the required incantations to get the result set to stream.
select srpt
from SpecialReport as srpt
left join fetch srpt.report as rpt
left join fetch rpt.customer as cst
left join fetch cst.stuff1
left join fetch cst.stuff2
where rpt.uniqueBatchId = :batchId

But I get "java.sql.SQLException: Streaming result set com.mysql.jdbc.RowDataDynamic@633f8d4f is still active. No statements may be issued when any streaming result sets are open and in use on a given connection. Ensure that you have called .close() on any active streaming result sets before attempting more queries."
I have sql query logging on, and I can clearly see it trying to fetch an unrelated property on Report after it scrolled forward.
So I started growing my HQL to include these fields.
Now it looks like
select srpt
from SpecialReport as srpt
left join fetch srpt.report as rpt
left join fetch rpt.customer as cst
left join fetch rpt.field1
left join fetch rpt.field2
left join fetch rpt.field3
left join fetch rpt.field4 as child
-- now field 4 was an object that also has fields that are associations.
left join fetch child.field1
left join fetch child.field2
-- ad nauseum, this keeps going down the object tree
left join fetch cst.stuff1
left join fetch cst.stuff2
where rpt.uniqueBatchId = :batchId

Even with about 25 join I still have more fields that are being loaded causing the same exception.
I could continue to manually walk the graph, but this is taking forever, and I feel like this shouldn't be necessary. Looking through the Hibernate code it seems the TwoPhaseLoad called by the scrolling tries to initialize all proxies and lazy loaded fields in the objects, which necessarily breaks the requirement that no other sql queries be executed while a scroll is running. Does this make sense to anyone out there?
Answer: XxxToOne associations are eager by default. Annotate them as lazy if you don't want Hibernate to load them eagerly.
Moreover, a SpecialReport is a Report, so the following join doesn't make much sense:
from SpecialReport as srpt
left join fetch srpt.report as rpt

Comment: That was a error in my sketch of the code, SpecialReport does not extend Report in reality. I will check the *ToOne associations though, did not realize they were Eager.


Exercise for carrying things on arms

Question: I want to be able to carry things in my arms for a longer period, carrying like carrying someone on your lower arms, half bicep curl position.
How do I increase endurance in this type of carrying?
Answer: The ideal exercises for training to carry stuff are, surprisingly, carrying stuff. On the assumption you can't find a willing person to be carried around, then something like sandbag work would be ideal. You can do sandbag carries for distance or time, in a bearhug or cradle position, practice picking it up off the floor, you can even try pressing it overhead for a bit of extra fun (note: I use fun in the sadistic sense). You can also use a keg, filled with sand or water, but a sandbag tends to be a little more forgiving.
You can use barbells and dumbbells to work some of the related musculature, but honestly the best way to get better at carrying something is to practice carrying something.
When you're carrying something (or someone), particularly in the cradle position, it's not just the arms you need to take into account, there's also a lot of stress on your posterior chain, spinal erectors and upper back, as well as your legs when you're actually in motion with the load, not to mention your core fires like crazy. If anything, I'd say that the arms are actually the least important element when it comes to carrying something in that position, as you can normally shift the weight around to move it more towards your own body, making it more mechanically advantageous to carry (lift it higher, lean back so it's more over your own center of gravity).
Besides sandbag work (seriously, if you've never tried picking up and carrying even something like a 75kg sandbag or keg, you're missing out), I'd look at a routine consisting of deadlifts, squats, rows, farmers walks, and if you have access to them, yoke carries and stone lifting. Yes, throw in some curls as well, because having stronger arms will help, then you may as well throw in some overhead presses to round things out (if this is starting to look like a strongman training program, there's a reason for that... a lot of their training revolves around lifting heaving things off the ground and carrying them).
But seriously, get out there and carry stuff, as Dan John says, it tends to be the missing element in most people's training programs.

Exercise for carrying things on arms


Showing output using command prompt for a ruby file

Question: I just started learning ruby language and I am doing exercises from Codeeval.com. Just started from the first exercise Fizz Buzz. I have a folder with .txt file which contains the input and logic.rb file with my code for this exercise.
I want to check my code using command-prompt and I don't know what should I write there to run my code and to see the output. I have tried to run: C:\folder> ruby logic.rb, but it does not work... Could any one help? Thanks!
Answer: you should be able to run from command line in any folder "ruby -h" and see the help parameters for Ruby. If this is not the case then you would have to either add ruby's executable directories to your windows search path or drill down to the ruby install directory.  "cd c:\program files\ruby\etc"
An easy way to see if ruby is in your windows search path is to run the "set" command in your cmd prompt and look for the values defined in the "Path=" variable.
To add locations to the windows search path you can navigate to the environment variables.
Right Click Computer Icon -> Properties -> Advanced System Settings -> Advanced Tab -> Environment Variables
In some cases a reboot of that machine will be required for windows to allow execution to those newly added locations.
I am not a Ruby programmer but in general execution I think its the direction needed.
I also see that command in Ruby of "PUTS" writes output to console similar to an "Echo" or "Write-Host" in other languages.
something like...
puts "hello"


How to make people leave a lot I own?

Question: Land is inherited from great great grandaparents. The land was divided among my grandmother's mother and her siblings. Now, the land that we got, being the heirs of one sibling, already has a house built on it for almost 15 years now. How do I make them leave? What laws? Could the current residents claim adverse possession? We did not know about the land until recently, apparently the family, cousins, have been living in the lot sans taxes. They've been living there long before the land was divided and so happen my grandmother got the part where the house stands. My grandmother had been paying taxes for the long time, us when we found out after her death. Now these people refuse to leave claiming my grandmother's half-sibling owes them money. Although the sibling is recognized only my grandmother inherited the land. Can I have their house demolished? Do I have to pay them for the house?
Comment: What city/state/country?
Comment: Does this lot have significant financial or use value to you? If not, one option is to quit claim it to the cousins and then you are out of it and *they* would have to pay the taxes. Adverse possession depends on the state and other details but 15 years makes it a strong possibility
Answer: washington-state
It's definitely not their land, and it probably was your grandmother's land.  Title has passed to whoever she willed it to.
The three key elements to adverse possession in Washington are open possession of the land, a good-faith claim of title to the land (correct or otherwise), and paying taxes on the land for at least seven years:

Your cousins have by far the better claim of open possession of the land: they've been living there.
Your grandmother has a clear good-faith claim to the title: she inherited it from her mother.  Your cousins don't have as clear a claim to title.
Your grandmother paid the taxes.  Your cousins didn't.

Point #3 completely invalidates any adverse-possession claim your cousins might have, but point #1 means you can't use adverse possession either -- you've got to show that your claim to the title is correct.
Answer: new-south-wales
It's not your land
Under the laws of possessory title (or adverse possession), your grandmother lost title to the land at least  3 years ago, specifically, 12 years after the current residents were suffered uncontested occupation. Since she didn't own it, you don't own it.
Now, it appears that they don't know this and are willing to walk away for payment of an alleged debt - if this is less that the value of the land it might be worth paying it to get them out.
Or, just transfer the property to them and they become responsible for future rates and taxes.
Answer: russia
It's not their land
Article 301 of the Russian Civil Code says that

The  owner  shall  have  the  right  to  reclaim  his  property  from
  the  other  person's  adverse  possession.

and Article 303 states that

In  reclaiming  the  property  from  the  other  person's  adverse
  possession,  the  owner  shall  also  have the right to claim from the
  person, who has known, or should have known, that his possession is
  adverse (the possessor in bad faith), the return or the compensation
  of all the incomes, which he has derived,  or  should  have  derived,
  over  the  entire  period  of  the  possession;

Basically, you take them to court and get them removed, and maybe you can recover incomes derived from that adverse possession. You would need a lawyer for this.

How to make people leave a lot I own?


Calculating exactly how much etherum I need to send to wallet to transfer an erc20 token from it?

Question: I have some wallets that have some erc20 tokens that I want to move, but these wallets currently do not have etherum for the gas, so I started writing a program to handle this. The idea is to load the private key and then estimate the amount of etherum that I need to transfer into in order to transfer the erc20 tokens. The issue that I am having is that I seem to be having difficulty figuring out how much etherum to send. It works sometimes, and then other times the transaction fails with this error:
ValueError: {'code': -32000, 'message': 'insufficient funds for gas * price + value'}

It doesn't happen all of the time, rather probably half the time. I posted a full log of what is going on here: https://termbin.com/hxn1
It does not make sense to me because there is always ETH leftover after I send the tokens, so why is it claiming that there is not enough eth for gas?
My program is written in python and I am using web3. I am sending erc20 like:
unicorns = self.web3.eth.contract(address=contact_address, abi=EIP20_ABI)

raw_txn = {
        "from": '0xDb2733F1143D59E2bF096F7Ee6d9cF2f61352F82',
        "gas": 200000,  # 200000
        'maxPriorityFeePerGas': max_priority_fee_per_gas,
        'maxFeePerGas': max_fee_per_gas,
        "to": contact_address,
        "value": "0x0",
        "data": unicorns.encodeABI('transfer', args=(to_address, raw_amount)),
        "nonce": self.web3.eth.getTransactionCount(from_address),
        "chainId": self.web3.eth.chain_id
    }
    signed_txn = self.web3.eth.account.signTransaction(raw_txn, private_key)
    tx = self.web3.eth.sendRawTransaction(signed_txn.rawTransaction)

And of course right now I am testing on testnet till I get this right.
[1]: https://
Answer: Turns out this solves the issue:
unicorns = self.web3.eth.contract(address=contact_address, abi=EIP20_ABI)
est = unicorns.functions.transfer(to_address, raw_amount).estimateGas({'from': '0xDb2733F1143D59E2bF096F7Ee6d9cF2f61352F82'})
est = self.web3.eth.estimate_gas(raw_txn)

signed_txn = self.web3.eth.account.signTransaction(raw_txn, private_key)
ret = self.web3.eth.sendRawTransaction(signed_txn.rawTransaction)


Quotients of Schemes by Free Group Actions

Question: I've often seen people in seminars justify the existence of a quotient of a scheme by an algebraic group by remarking that the group action is free. However, I'm pretty sure they are also invoking something else. So my question is: when you can you quotient a scheme by a free action and get a scheme? In particular, when do the coset spaces of a subgroup of an algebraic group exist as a scheme? And in these cases, how do you construct the quotient?
Comment: An old reference for such questions: Donald Knutson's book "Algebraic Spaces".
Answer: In the case of a quotient of a scheme $X$ by a finite group $G$, a necessary and sufficient condition for the quotient scheme $X/G$ to exist is that the orbit of every point of $X$ be contained in an affine open subset of $X$. This is proved in SGA I, Exposé V, proposition 1.8.
In particular, if $X$ is a closed subscheme of projective space, then for any finite set of  points of $X$ (in particular, any orbit of a single point) we can find a hyperplane not containing any of those points.  The complement will be an affine open of $X$ containing the orbit.  This covers the existence of the quotient in the cases that $X$ is projective (and by a similar argument, quasi-projective).
Here is a sketch of the argument in SGA I:
If the condition is satisfied, one first shows that this implies that $X$ is covered by $G$-invariant open affines, then by taking invariants, constructs the quotient of each affine by $G$, and then glues together to get the global quotient $X/G$.
Conversely, if $X/G$ is a scheme then for any open affine $V \subseteq X/G$ the inverse image of $V$ under the morphism $X\longrightarrow X/G$ is an open affine of $X$ stable under $G$.  Since we can cover $X$ by such opens, the orbit of any point of $X$ is contained in some affine open set.
As in George McNinch's answer there is no need for the $G$-action to be free.  (This discussion was limited to quotients by finite groups though!)
Answer: Hironaka's example of a proper non-projective 3-fold has a $\mathbb Z/2$ action which is free (actually, there's one fixed point, but you can just throw it out) whose quotient is not a scheme. (see an appendix of Hartshorne (page 443) or Shafarevich (page 75))
In general, the quotient of a scheme by a free action of a group is an algebraic space. If this group is finite, this is just because the action induces an etale equivalence relation  (this is where you use freeness), and any quotient of a scheme by an etale equivalence relation is an algebraic space. For infinite groups, the quotient will be an algebraic stack fibered in sets, so it will be an algebraic space (c.f. this question).
You are then reduced to the question, when is an algebraic space a scheme?

Here's one situation where you get a scheme quotient. If you have a quasi-projective variety $X$ with an action of a connected reductive group $G$, then there is a geometric quotient $X/G$ if there exists a line bundle $L$ (with $G$-action compatible with the $G$-action on $X$) such that every point of $X$ is stable with respect to $L$. That is, if for every point $x\in X$, there is an invariant section $s$ of some tensor power of $L$ such that $X_s$ (the non-vanishing locus of $s$) is an open affine neighborhood of $x$ in which every $G$-orbit is closed. This is Theorem 1.10 in Geometric Invariant Theory. I don't know if knowing that the action of $G$ is free helps in finding such an $L$.
Answer: Well, this question is old, but I suppose something got updated so I noticed it.
There are various statements made in answers/comments about finite groups, and I wanted
to mention that Serre's text "Algebraic Groups and Class Fields" contains a reference. In it, Serre shows (in III.3.12) that:

the quotient of an affine variety by a finite group is again an affine variety. (This is basically Greg Muller's answer).
if V is an algebraic variety on which the finite group G acts, and if each G-orbit
is contained in an affine open subvariety of V, then the quotient of V by G is an algebraic variety. (In Hironaka's example, mentioned by Anton Geraschenko, there are orbits not contained in any affine open -- see Remark 2 on p. 80 in the reference [Shafarevich, Basic Algebraic Geometry 2] given in Anton Geraschenko's answer).
in particular, if V is a quasiprojective variety (locally closed in some projective space $\mathbf{P}^r$), and if a finite group $G$ acts on $V$, then every $G$-orbit is contained in an affine open subvariety and hence (as in David Speyer's answer) the quotient of V by the action of G exists.

Serre is working with algebraic varieties over an algebraically closed field $k$ -- i.e.
reduced, separated $k$-schemes V of finite type.
In this setting there is no need to stipulate that the action of the finite group G on V be free.
Answer: There's an example of a free action of a (non-reductive) subgroup $\left( \begin{array}{cc}1&*\\0&1\end{array} \right) \subset \operatorname{SL}_2$ on an affine variety $A$ with no geometric quotient, see Derksen Quotients of algebraic group actions, example 18. The variety $A$ consists of pairs of matrices $3 \times 6$ and $6 \times 3$, whose product is a certain explicitly given matrix $3 \times 3$.
Answer: To answer (in one case) the particular question it is always true for linear algebraic groups that the orbit space of a closed subgroup is a scheme, and it will also be a linear algebraic group provided that the subgroup is normal.
Suppose that we have a closed subgroup H of G. One way to build the orbit space is as a G-orbit in the projective bundle P(V) associated to some rational representation G -> GL(V). The point is that we can pick such a representation having the property that V has a one dimensional subspace W so that H is precisely the subgroup of G fixing W. Taking [W] in the associated projective space of V we get that H is the isotropy group of [W]. One can then identify G/H with the orbit of [W] in P(V) and it can be checked that this is the right thing to do in terms of the universal property. In particular the orbit space is quasi-projective and one can go onto study when the orbit space is projective (i.e. look at parabolic subgroups).
I am not sure about the first part... If the action is transitive often one can argue that the quotient is representable by an algebraic space and then use transitivity of the group action to show that one in fact has a scheme. I am pretty sure freeness should correspond to good properties of the geometric quotient provided one exists (probably only then on some open subscheme) rather than guaranteeing existence and it seems that this is the case given the example Charles linked to.
Answer: I think that the quotient of a quasi-projective scheme by a finite action is always a scheme. I don't know a reference for this.
Comment: @Anton, in the quasi-projective case, you can use the same argument. For any quasi-projective variety, there is a quasi-projective Hilbert scheme of $\lvert G \rvert$ points on $X$. For example, you can take the Hilbert scheme of points on the projective closure $\overline X$ and remove the closed subscheme of points which intersect $\overline X - X$. Hilbert schemes of higher-dimensional varieties don't work well in quasi-projective varieties, but for points, there's no problem.
Comment: In the projective case, I think the argument goes like this. Consider the Hilbert scheme of |G| points in your projective scheme X. The action of G on X induces an action on this Hilbert scheme, and the closed subscheme fixed by G is naturally X/G because a point of the Hilbert scheme which is fixed by G is the same as a G-invariant set of |G| points (i.e. a G-orbit). I don't see how to extend this to the quasi-projective case because I don't see why you should be able to find a compactification where you can extend the G-action so that it's still free.
Answer: A standard case where the quotient exists is when the group G is finite.  In this case, if you start with the ring of functions O, and take the ring of G invariants O^G.  Then O^G is finitely-generated and is Spec(O^G) is the quotient of Spec(O).
Its worth noting that these quotients behave a little different that you might expect.  For instance, the quotient can still be very nice when there are stablizers.  Take Z/2 acting on C[x] by x -> -x.  Then the ring of invariants is C[x^2], and the quotient map is the map from affine space to itself which takes a point p to p^2.  In the algebraic case, the fixed point at the origin isn't 'orbifoldy' enough to be a singularity.
For non-finite actions, this invariant based approach can still be rigged to work, but its trickier.  This typically goes under the name Geometric Invariant Theory, and the main concern is finding the right locus of bad points to discard before quotienting.
Comment: Even if the group is finite, there may not be a quotient in the category of schemes. The procedure you describe produces a quotient of an *affine* scheme by a finite group, but strange things can happen if you act on non-affine schemes, like the example of Hironaka I mentioned in my answer.


The most variant groups of periodic table

Question: Is it okay to call group 11 (formerly 1B) a "group"? I meant that according to my knowledge "A group is a horizontal column consisting of elements with similar valencies and a continuous gradation in physical and chemical properties" but there is no gradual trend or we don't obtain similar reactions for same circumstances. Members do not show similar oxidation states and do not form analogous compounds. Electronegativity values and other bonding characteristics also deviate badly from one another. Are they in a group just because their atomic numbers allot their positions in same vertical column? Shouldn't 1B and other d-block "groups" (which show such variant properties) treated as "ungrouped region" or something like that?
Comment: Placing in groups is directly related only to electronic configuration, "results may vary".
Comment: I assume you meant "vertical column"?
Answer: Sure Group 11 is a group. And if you look in the right areas you see similarities between copper, silver and gold:
1)  Among the best electrical conductors even compared with other metals (http://eddy-current.com/conductivity-of-metals-sorted-by-resistivity/).
2)  Tend to prefer combining with "soft base" nonmetals:  Cu and Ag found as sulfides, gold is oxidized by $\ce{HNO_3}$ when a chloride source is added.
3)  Have some chemistry in the +1 oxidation state, especially wuth said soft-base nonmetals.
Comment: Conduction is somewhat physical quantity as I think and much more lanthanides tend to combine with soft base non-metals e.g iron. And iron and copper possess more similarity than copper and silver from this prospective.
Comment: Iron is found in nature primarily combined with oxygen (at least near the surface where it's chemically combined with anything at all).  It favors hard-base nonmetals much more than anything in Group 11.


Ubuntu software centre not responding

Question: Software centre is not responding. Whenever I open it the screen becomes black and I cannot do any thing. Instead I have to force quit the application, please provide me a solution.
Comment: Can you give us details? Is there an error displayed? Any console output? We may do magic here, but we need all the info we can get.
Comment: what was the output of `software-center` in terminal.
Answer: Try running a sudo apt-get install software-center from a terminal to upgrade your version of software-center. Possibly there is a new version already that fixes this error.
If that does not help, try running sudo software-center from a terminal and check the terminal output for any clues why it is not starting and possibly post the relevant output back here again.
Answer: open your terminal and reinstall your software center with
sudo apt-get install --reinstall software-center

then try again.

Ubuntu software centre not responding


Use custom module template for content type page?

Question: I'm finding lots of examples for theming the node template of a content type, but I can't figure out how to use a template from my module as the page template for a custom node type.
Answer: page.tpl.php doesn't know, by itself, anything about node types so you'll have to make your module preprocess the page with hook_preprocess_HOOK() to add an alternative theme hook suggestion.
function MYMODULE_preprocess_page(&$variables) {
   if (isset($variables['node']->type)) {
     $variables['theme_hook_suggestions'][] = 'page__' . $variables['node']->type;
    }
}

Once done, you can have your module evoke hook_theme() to advertise processing for your custom page node type template and its location. For example:
/**
 * Implements hook_theme().
 */
function MYMODULE_theme($existing, $type, $theme, $path) {
  $theme = array();
  $theme['page__mynodetype'] = array(
    'path' => drupal_get_path('module', 'MYMODULE') . '/templates',
    'template' => 'page--mynodetype',
  );
  return $theme;
}

When the module is enabled (and theme registry cache cleared), the theme engine will look for page--mynodetype.tpl.php within the templates directory of your module.
Comment: I'm not looking for a node template, but rather a page template.
Comment: Updated, same idea but with an additional function to make page templates aware of node types.


What's the English idiom for wanting something without the effort necessary to get it?

Question: What's the English idiom for wanting something without the necessary effort to get it? In German, we say "wash me but don't get me wet."
Comment: @Alexander Schmidt: To me, the German saying you mention is closer to "wanting two mutually exclusive things at the same time", not "having something for free" - which one are you interested in?
Comment: Welcome to ELU. I think I know what you're trying to express. But can you include context where the German idiom would be used. Please read the linked question [Any equivalent to this Persian proverb "The yellow dog is the jackal's brother"?](http://english.stackexchange.com/questions/320665/any-equivalent-to-this-persian-proverb-the-yellow-dog-is-the-jackals-brother). You don't need to write that long, but at least you need to explain to us when it is used.
Answer: "You can't have your cake and eat it, too."

"You can't have your cake and eat it, too" is a saying that describes the dilemma faced when you want one thing very much, but you are not willing to give up other things in order to have it. (Source: wordreference.com)

Wikipedia also lists Wasch mir den Pelz, aber mach mich nicht nass – wash my fur but don't get me wet as the German equivalent to "you can't have your cake and eat it, too."
Comment: I don't think this saying is close to what he is looking for.
Comment: @Ant You have a very common confusion and I think it's because of the word *have*. I interpret the idiom as being better worded, "*you can't **keep** your cake and eat it, too*". As in, once you've eaten it, it's gone. Or maybe it would be clearer with money: "you can't have/keep your money and spend it, too". Some people like to have a lot of money in the bank. They might also like to spend money. So they want to have it and spend it, but they can't. Modern people probably feel less security from having a cake in the cake safe than people did when this idiom was coined.
Comment: I am just making a note here, because this one seems to get the most votes, and I would dissuade that.
Comment: This idiom always struck me as inexplicable. What good is cake if you can't eat it? Taking a cake and eating it makes a lot of sense. Washing oneself without getting wet doesn't. (I'm not questioning your answer, as indeed this idiom is used in this way in english. It's just weird that it's an idiom :-P )
Answer: That freeloader wants _____ to be handed to him [on a plate].

give/hand something to somebody on a plate : to  let someone get something very easily, without having to work for it
You can't expect everything to be handed to you on a plate - you've got to make a bit of effort. — thefreedictionary.com
Comment: I also like the ["on a silver platter"](http://idioms.thefreedictionary.com/on+a+silver+platter) variant of this.
 "The Internet provides huge quantities of information on a silver platter"
Answer: Three idioms come to mind:

You can't have your cake and eat it too

Incidently, the wikipedia page on this phrase lists "wash my fur but don't get me wet" as the German equivalent.
Less abstract, but most precise:

Wanting something for nothing

Cambridge dictionary - something for nothing
Also applicable, but less specific:

Wanting the best of both worlds

Cambridge dictionary - best of both worlds
Answer: There's no such thing as a free lunch.
Although this is more of a response to wanting something for nothing, rather than meaning to want something for nothing
from wikipedia:

"There ain't no such thing as a free lunch" (alternatively, "There is no such thing as a free lunch" or other variants) is a popular adage communicating the idea that it is impossible to get something for nothing.

https://en.wikipedia.org/wiki/There_ain%27t_no_such_thing_as_a_free_lunch
Answer: Another related idiom is "free ride"

an opportunity or advantage that someone gets without having done anything to deserve it

Cambridge Dictionary ,  used for example in "He wants a free ride to success".
"Free ride" has similar connotations to "free lunch" and "something for nothing" mentioned in other answers.
Answer: "No pain, no gain" comes to mind...
I had to deliberate about this one since your description points toward the desire of wanting to do something without effort and still earn a reward.  However, if "You can't have your cake and eat it, too" is acceptable, then I believe idioms that correspond to the relationship of work and reward also apply.
The expression refers to the fact that some kind of sacrifice must occur before one can receive something of value in return.  Whether that sacrifice be time, energy, or funds is up to the discretion of the reader.
from Wikipedia:

Rabbi Ben Hei Hei says, "According to the pain is the gain."
  — Pirkei Avot 5:21 (aka The Ethics of Fathers)
NO PAINS, NO GAINS.
  If little labour, little are our gains:
  Man's fate is according to his pains.
  — Hesperides by Robert Herrick
Industry need not wish, as Poor Richard says, and he that lives upon hope will die fasting. There are no gains, without pains...
  — as reprinted in his The Way to Wealth (1758) by Benjamin Franklin
Answer: Two phrases come to mind, they are really versions of the same phrase, although the first one can be used literally as well
... not willing to pay the price
... won't pay the piper
but neither of these match exactly (imho) the German idiom quoted.
Also, I can envision circumstances where I would use
your mouth is writing cheques that your body can't cash,
but still not an exact match.
Phil
Answer: Not an idiom as such, but a single word that describes "wanting something for nothing" almost perfectly is "coveting".
From Wiktionary:

covet

(transitive) To wish for with eagerness; to desire possession of, often enviously.
(transitive) To long for inordinately or unlawfully; to hanker after (something forbidden).
(intransitive) To yearn, have or indulge inordinate desire, notably for another's possession.


What is the difference between low-density and high-density Polymethyl methacrylate (PMMA) on a molecular level?

Question: I know why Polymethyl methacrylate can be made to have a low or high density but i am unable to illustrate how they look like on the molecular scale. Can someone help me with a sketch please?
Comment: This might help : http://www.123rf.com/photo_20143793_methyl-methacrylate-molecule-poly-methyl-methacrylate-or-acrylic-glass-building-block-atoms-are-repr.html
Comment: @NilayGhosh no it doesn't that's just a monomer...
Comment: @DSVA if you know the monomer unit, you can easily figure out the polymer.
Comment: Also, I said "this might help". I did not actually gave the answer.
Comment: @NilayGhosh knowing how the (linear) polymer looks still won't explain the difference between LD and HD PMMA. It's not helping at all. This might be more confusing than anything else.
Answer: Low density and high density PMMA differ by density, which is given as the ratio of mass and volume.
Given that they are prepared from the same monomer, two polymers with the same number of monomers will have the same mass.
If the polymers differ in density, this must be due to the fact that they occupy different volumes.
Note that we are talking about polymers here and not the ordered packing of molecules in a crystal. Nevertheless, inter- and intramolecular interactions (and thus "packing") is important here as well.
As a rule of thumb, polymers with higher branching will "pack" less tightly and thus occupy a higher volume.
This results in a lower density.


How to get rid of subtle white pixel border on Eevee

Question: How can i get rid of white pixels borders on Eevee?
These are just appearing on the preview and render image.
The imported image sequence does not have these little white pixels on it.
If i move the threshold parameter (third image) it works like a fix, but what is the correct way to import/export the image to skip these white pixels?
Comment: Does changing the clip threshold have any effect?
Comment: yes! it kinda worked, but still feels like a 'patch', what i want is a direct solution to this.
Answer: I suggest you using openEXR instead of png. go on your image texture node and try to change linear to closest or to cubic
Then try putting color ramp in between and choose constant interpolation.
btw if you want to make a cirlce procedurally, here is the tree:
Comment: Thank you, if i conver the openEXR to png later, would it still have the same information on it? because i need to later import my render to another software.
Comment: EXR stores more information than png, so you would still retain the image information. Also this format is used in other softwares so it may be supported there too


When is it legal to castle moving the rook first?

Question: As a follow on from the question Is it legal to castle with a "ghost" rook: When is it legal (according to the FIDE Laws of Chess) to castle moving the rook first?
Answer: Unless this is a trick question, I'd say never:

3.8.2 [] This is a move of the king and either rook of the same colour along the player's first rank, counting as a single move of the king and executed as follows: the king is transferred from its original square two squares towards the rook on its original square, then that rook is transferred to the square the king has just crossed.

The word then implies the king moves first, and the rook second. Also,

4.4 If a player having the move:
4.4.1 touches his king and a rook he must castle on that side if it is legal to do so
4.4.2 deliberately touches a rook and then his king he is not allowed to castle on that side on that move and the situation shall be governed by Article 4.3.1

That would imply that touching both king and rook (but not moving them) commits the player to castling; then, he/she could then move the rook first and only then the king, since that would give the same position on the board as the only legal play at that moment. Still, if I would see that as an arbiter, I'd have a word with the player about this.
Comment: The "and" in "touches his king and a rook" can be read as "and then". Thus, the player touches the king, but does not move it (still possible to play Ke2 etc.), *and then* touches the rook with the same hand (now Ke2 is out and he has to castle). Just like if I touch an opposing piece that I can capture and then also one of my own pieces that can perform the capture, I have to execute that capture (in this case, the order of touching does not matter).
Comment: With big hands, a not too large board and a little practice, it's possible to castle (short) by squeezing the king and rook with your thumb and little finger and twisting your hand to make them change places between f1 and g1. I don't think it has any practical benefit, though.
Comment: @OscarBravo The rule doesn't say "simultaneously". But even if it did, you're being overly literal. If a player touches two pieces (with the same hand or not) in such rapid succession that you can't tell which was first, that would be classed as simultaneous.
Comment: Maybe it also covers situations where the player picks up the king, then touches the rook while holding the king. If it wasn't for 4.4.1, they would still have the option of just making a different king move, I think.
Comment: I'm perplexed by 4.4.1. How, physically, can a player touch his king _and_ a rook? He has to touch one first (even by a millisecond) and so that becomes the piece he _must_ move. I understood the procedure of castling to be: (1) Touch king (must now move king) (2) Move king two squares and release (normally illegal to move king two squares, _unless_ castling, so this commits to castling. (3) Move rook to other side of king. Touching any piece before the king precludes castling.
Comment: @OscarBravo: With two hands at once? But I thought that was against time control rules...
Answer: The 2019 Champions Showdown: Chess 9LX (aka Chess 960) currently taking place in St. Louis should have been a clue.
Here is the relevant extract from the FIDE Laws of Chess:

Guidelines II. Chess960 Rules
II.3 Chess960 castling rules
II.3.1 Chess960 allows each player to castle once per game, a move by
  potentially both the king and rook in a single move. However, a few
  interpretations of regular chess rules are needed for castling,
  because the regular rules presume initial locations of the rook and
  king that are often not applicable in Chess960.
II.3.2 How to castle. In Chess960, depending on the pre-castling
  position of the castling king and rook, the castling manoeuvre is
  performed by one of these four methods:
II.3.2.1 double-move castling: by making a move with the king and a
  move with the rook, or
II.3.2.2 transposition castling: by transposing the position of the
  king and the rook, or
II.3.2.3 king-move-only castling: by making only a move with the king,
  or
II.3.2.4 rook-move-only castling: by making only a move with the
  rook.

Here is one of the starting positions from yesterday's games which gives the possibility of rook-only castling on the queenside:
<code>[fen "nrkrqbbn/pppppppp/8/8/8/8/PPPPPPPP/NRKRQBBN w KQkq - 0 1"]
</code>
The kings are already on the queenside castling squares of c1 and c8. All that is required is for the d file rooks to move and castling can be performed by hopping the b rook over the king.
Answer: I think this is a bogus question. For the King to be in that position it must have already moved, so therefore cannot be allowed to castle. A standard rule is that if a player wishes to castle then the King must be moved first. By moving it 2 squares, which is an illegal move, the player is indicating that they wish to castle. If the rook is moved first then it could be that they're keeping their options open as to whether to castle or not.
Comment: See the accepted answer, which hinges on the "trick" part of the question involving the fact that FIDE has rules for chess variations including chess960.


Biological Coolant System for Massive Organisms

Question: The larger an animal, the harder it is to cool down. Ignoring the problem of bone/muscle strength vs size/weight and saying an animal could get to outlandish sizes, would a second cardiovascular system specifically for thermoregulation help it regulate its core body temperature? What would the fluid in question be, assuming this hypothetical organism is of terran biochemistry?
Comment: What's wrong with the regular blood circulatory system? What could a second fluid circulation system do which the normal circulatory system cannot? (This is an important question; you *must* find a compelling answer, or else you cannot justify evolutionary pressure.)
Comment: @SRM Assuming I have found a way around the square-cube law, in terms of bone strength to weight/size. Overheating is still a problem! I will edit the question to clear that up.
Comment: I don't understand this question. The problems of the square-cube law is the primary reason that large animals are impossible. If you ignore the law, you don't need a separate circulatory system... the heat won't build up. What am I not understanding?
Answer: Reality check both FAILS and PASSES the test...
Life As We Know It: Sticking with life as we know it on Earth, the likelihood for a parallel cardiovascular system to evolve is highly unlikely. Hasn't happened yet, but that won't stop us from considering other possibilities.
But in other worlds, other evolutionary pathways might be chosen. Now it happens to be the case that we Earthlings do have two circulatory systems already. One circulates blood. The other circulates lymph. It's not a closed system, though, but it hints that other parallel systems could evolve elsewhere.
Deluxe Closed System: Such a system could indeed help with thermoregulation. Instead of draining lymph to the core, this system would drain heat from the core to the exterior. An organ, possibly some sort of "lung" that would have lots of surface area, would exchange heat from the CV to the HE system. This latter would simply circulate high temperature fluid (perhaps water or glycol) out to some kind of radiator appendages. These could be fins or frills or wings or fronds. The thin skin of such appendages will facilitate transfer of heat to the environment.
This system could also be used in reverse. If the animal becomes too cool in its core, it could at first reduce its secondary heart rate and then escalate by reducing the surface area of its fronds or frills, perhaps by curling them up or folding them within a pouch of some kind. It could also seek out relatively warm surroundings and, extending its sails and frills into the warmth, would simply pump warm fluid back down to the core.
The heat evacuation system described above is entirely closed. This prevents predators, disease vectors, rubbish and crud of all sorts from gaining access to the animal's insides. It also allows for a more nuanced and quicker response to body vs environmental conditions.
Not so Deluxe Open System: As AlexP reminds us, life as we know it provides other sources of inspiration. Some animals don't mind if a little crud gets in, so we also find inspiration in the water vascular system of the echinoderms. In this system, water is drawn in through an orifice and pumped through vessels throughout the body as a means of locomotion. The WVS is multipurpose in sea creatures, much more like our circulatory system. This kind of system, parallel to the CV system,  could evolve in a large warm blooded creature for thermoregulation.
Water from the surrounding sea would be captured via an orifice and pumped through the thermoregulatory system's vessels perhaps via peristaltic action. This cooler water would pass through to the warmer core where it becomes warmed. Once the water is warm enough, it's expelled again through the same orifice and the process can be repeated as needed.
The heat evacuation system described above is an open system. Although safeguard are in place (baleen or hair like filters), some debris and a whole host of microorganisms can still gain entry. Small stones or debris can clog the vessels while microbes are brought into close proximity of vital organs. A more serious issue is that the animal would almost certainly be precluded from inhabiting warm waters: if it can only take in warm water, it will eventually suffer from hyperthermia, being unable to sufficiently regulate its core temperature.
Biological heat pump either way.
Comment: *"The likelihood for a parallel cardiovascular system":* See the [water vascular system](https://en.wikipedia.org/wiki/Water_vascular_system) of echinoderms which powers their [tube feet](https://en.wikipedia.org/wiki/Tube_feet). (And humans have a [lymphatic system](https://en.wikipedia.org/wiki/Lymphatic_system), with the fluid pumped by the contractions of the musculature.)
Comment: @AlexP -- I did make note of the lymphatic system. Thanks, though, for noting the WVS, that could work as well.
Answer: I don't see why a separate coolant system would be needed or would evolve.
Animals already have blood pumping around their system and already use it for cooling through panting (e.g. dogs) air cooling (e.g. elephant ears) or evaporation (e.g. humans sweating).
All that would be needed would be to run the vascular system through the cooling (through whatever mechanism) systems and then through the body. Potentially for very large creatures you would have a special arrangement where blood goes to the surface to be cooled, then goes through the body, then back to the surface, etc.
You could also have multiple hearts, multiple heat sinks, etc, so that for example each section of the creature uses one blood system with then links between those systems to equalize pressure. But it would all just be evolved from the very same systems life uses right now.
Answer: Air.
Let us assume this is a land animal.  Heat must be offloaded to the air.  Methods for doing this include increasing surface area, and harnessing the respiratory system to move dead space back and forth (panting).
A truly massive creature might aerate its interior by producing a system by which air is routed through the body and out.  This might be a second respiratory system which did not concern itself with gas exchange or maybe an adaptation of the digestive system, putting to use existing mechansims for taking in air.
The result would be a wind through the body of the creature.  A wet creature like us would probably also saturate this air with evaporated water, losing temperature to the phase change as we do when we sweat.

Acetone.
Another possible coolant is acetone.  Acetone is produced by biological processes including our own bodies - the ketogenic diet is named after the ketone acetone that our bodies make on this diet.  Acetone has a low vapor pressure.  A finger wetted with acetone will feel cold as the acetone evaporates, the phase change carrying away heat.  Acetone sweat would be a formidable coolant.  A problem is that the acetone costs carbon to make and then is lost, so using acetone to cool would be more metabolically expensive than using water.
Also a creature that sweat acetone would be flammable, but would probably go out quickly.


Pressure over time in a tank with variable volume and an orifice

Question: I have a tank whose one side can be moved, so we can change the pressure inside the tank by this movement. (In my main case this ig going to be a sinosoidal movement). We add an orifice to the tank, so I can't use the $pV=const.$ equation, since the air comes and goes through the orifice. I tried to describe the volumetric flow, one that comes from changing the tank volume and one that comes from the orifice.
The volumetric flow rate at the orifice according to Poiseuille's equation for an ideal isothermal gas:
$$
Q_1(t)=\frac{\pi r^4}{16\mu L}\cdot \frac{p_1^2(t)-p_2^2}{p_2}
$$
The other volumetric flow acquired from the movement of the side of the tank, which is known:
$$
Q_2(t)
$$
Where: $p_1$ is the pressure inside the tank, $p_2$ is the atmospheric pressure outside. From these I can write something like $V(t)=\int(Q_1(t)+Q_2(t))dt$ which gives me the volume of the air inside the tank, but I do not see how can I know the pressure from these data. One thing that came to mind is changing the volumetric flow to mass flow, but for that I think I would have to know the pressure. So what is the trick here  I could not find on my own?
Answer: After a few days I came up with a solution with the following equations.
The mass flow rate through the orifice:
$$
Q_m(t)=\rho(t) \cdot \frac{ \pi r^4}{16\mu L}\cdot \frac{p_1^2(t)-p_2^2}{p_2}
$$
The air density inside the box:
$$
\rho(t)=\frac{m(t)}{V(t)}
$$
The mass of the air inside the box:
$$
m(t)=m_0+\int_0^tQ_m(t)dt
$$
The volume of the box according to the linear displacement $x(t)$ of a certain area $A$:
$$
V(t)=V_0+x(t)\cdot A
$$
Finally from these, I can calculate the pressure inside of the box from time step to time step(I have calculated with constant $RT$):
$$
p(t)=\frac{m(t)RT}{V(t)}
$$


How to delete temp files created by Archive Manager?

Question: I used Archive Manager to extract files from an archive, but there wasn't enough free disk space. After the process crashed my disk remained full and I am unable to locate and delete what is filling up my hard drive. I cleaned up some disk space by moving some files to an external drive and then I attempted the same operation again. This time it succeeded, but again temporary files remained, clogging my hard drive. Where does this app store these files? I have been unable to find them in every way I have tried so far. I am also a complete newbie to Ubuntu (I use 14.10). Any help will be much appreciated.
Comment: it's probably somewhere in `~/.cache`. What does `du -hd1 ~/.cache` say?
Comment: How did you extract those files?
Answer: You can try to clean file-roller temporal folders with this command:
rm -r ~/.cache/.fr-*

The above command will delete all the file-roller temporary folders that can remain. Be careful and copy/paste! A typo can be fatal for your data!
The temporary folders of file-roller (it creates one for each archiver while contents are open) are stored in /home/$USER/.cache/.fr-somerandomcharacters.
Comment: @guntbert sorry, I wrote a fast reply from a tablet, now is updated.
Comment: They shouldn't be stored in `~/.cache`, unless it's a bug regression: [Launchpad.net: Bug 1](https://bugs.launchpad.net/ubuntu/+source/file-roller/+bug/245716), [Launchpad.net: Bug 2](https://bugs.launchpad.net/ubuntu/+source/file-roller/+bug/883628) and [Launchpad.net: Bug 3](https://bugs.launchpad.net/ubuntu/+source/file-roller/+bug/1186989)
Answer: Temporary files are usually stored in /tmp, and that's the case even for Archive Manager. Anyway it's not a good practice to batch remove them, since running applications might be using the folder to store temporary files necessary to their current instance to run (as it's the case for Archive Manager), and removing them could break the current instance. So you better either remove the files manually or just reboot, which automatically clears the folder.
Answer: Thanks you for all your answers. The files were not located in the temp or cache folders, so at the end I installed bleachbit and ran every possible cleanup option that I thought might help. At the end I parted with almost 9000 files and 5.5gb of data so I assume the files I was after are in that mix. Fortunately, the system is still runing fine after all that. Anyways, I appreciate everyone's help.


is there a way to make template for set of nodes?

Question: Is it possible to make a template for set of nodes in Drupal 7
for example page--node--[601-602-603-604].tpl
and if so what is it?
Answer: You can't do like you explain.
What you can do instead is to add a custom template suggestion for the specific nodes in the preprocess_node function to make the nodes use a specific template that can have any name.
Answer: I use this to style a page of nodes of a certain content-type or a node of certain type.
<code>function THEMENAME_preprocess_page(&$variables, $hook) {
   //some other stuff
    if (isset($variables['node'])) {
    $variables['theme_hook_suggestions'][] = 'page__type__'. $variables['node']->type;
    $variables['theme_hook_suggestions'][] = "page__node__" . $variables['node']->nid;
  }
}
</code>
Then you would have page--type--machine_name.tpl.php, etc...


Write to a binary file?

Question: Here is data structure with variables:
struct Part_record
{
    char id_no[3];
    int qoh;
    string desc;
    double price:
};
---
(Using "cin" to input data)
---
Part_record null_part = {"  ", 0,"                         ",0.0};
---
---
file.seekg( -(long)sizeof(Part_record), ios::cur);
file.write( ( char *)&part, sizeof(Part_record) );

The three variables, qoh, Id_no & price, write out correctly, but the "desc"
variable is not right.
Do I need to initialize Part_record some other way? It should be 20 characters in length.
If you have enough info here, please share your advice.
Answer: std::string keeps its data in dynamically allocated memory, not in structure Part_record.
Answer: You can't write std::string objects (or any of the STL containers) to a file in this way.  They contain internal pointers to their data which is allocated dynamically; you'll wind up writing pointer addresses to your file, instead of the contents of the string.
I'd recommend using the iostream library if you need to write std::string data to a file.  Failing that, you can access the character data directly with part.desc[0] to achieve something similar to what you're attempting:
fwrite(&part.desc[0], part.desc.size());

Answer: string data won't get written; you should use a char[20] instead, because string is a dynamic class which does not have a fixed size (technically it has a fixed size but contains a pointer to a dynamic, growable character array).
I say char[20] because you mentioned that the string should be 20 characters.  However, be sure to include an extra character for the terminating null byte.  Also, your example contained a string with 25 spaces, so in that case you'd want a char[26].
If you will have strings of any size and you don't know the max size, then you'll have to do something more complex than simply having all of your data in a struct.
Comment: The poster should read and write each element individually rather than using block I/O with the entire structure.  There are many holes in the block I/O, and a field with `std::string` is one of them.  For faster I/O, the members of the structure can be copied *contiguously* into a buffer, then the buffer can be written as one block.  Another hole in the OP's design is the fact that the compile can insert padding between fields.
Answer: std::string contains pointers to the real character data, and you're serializing the raw structure, i.e. the pointers.
Write each variable separately, with special handling for the string (i.e. use desc.data() and desc.size() to get the ptr and length of the string's data.)
Answer: Write the individual members to your output stream, or have the structure do this, or write the individual members to a buffer:
struct Part_record
{
    char id_no[3];
    int qoh;
    string desc;
    double price:
// Block I/O methods
    size_t  Size_On_Stream(void) const
    {
      size_t size = 0;
      size = sizeof(id_no) + sizeof(goh) + sizeof(price);
      size += descr.length() + 1; // +1 for terminating null character
      return size;
    }
    void  Store_To_Buffer(unsigned char *& p_buffer) const
    {
       std::copy((unsigned char *)&id_no[0], (unsigned char *)&id_no[3], p_buffer);
       p_buffer += sizeof(id_no);
       std::copy((unsigned char *)&goh, (unsigned char *)(&goh) + sizeof(goh), p_buffer);
       p_buffer += sizeof(goh);
       std::copy((unsigned char *)&price, (unsigned char *)(&price) + sizeof(price), p_buffer);
       p_buffer += sizeof(price);
       strcpy(p_buffer, descr.str());
       p_buffer += descr.length();
       *p_buffer = 0x00;
       ++p_buffer;
       return;
     }
     void Write_To_Stream(ostream& output) const
     {
       size_t buffer_size = Size_On_Stream();
       unsigned char * buffer = new unsigned char [buffer_size];
       unsigned char * p_buffer = buffer;
       Store_To_Buffer(p_buffer);
       output.write((char *)buffer, buffer_size);
       delete [] buffer;
       return;
      }
};

Since you have floating point values, integer values and text, I highly suggest you use an ASCII or text based format such as CSV or XML.  Binary versions of numbers (integral and floating point) may not be compatible across platforms, between OS versions or even compiler versions.  Also, variable length text is a pain to deal with in binary formats.

Write to a binary file?


Networked macs, .app installer help

Question: Im pretty new to macs and i know no one who can figure this out, I have a folder which has an .app client in it and a .app installer in it and a bunch of other files. I use software called filewave to send that folder out to various macs i have here. I need to make something like a script i can run at startup or just once to run the installer .app in silent mode. Or would it be possible to package up the folder with all this in and make it into a .PKG installer? any thoughts anyone i'm new to all that is mac and sorry if things sounds like i'm talking about windows.
Comment: Welcome to the site. I'll take a stab at answering an overall - how would a new system admin start to learn about OS X packaging options. Feel free to edit the question or ask a second more detail-filled question once you have a more specific question in mind.
Answer: Apple's software installation is a bit of a deep subject.

You could use a unix packaging system and script it with shell/bash/python/perl - whatever code base and language you prefer. Optionally ssh and AppleScript would allow you to automate running the code.
You could use a developer account and Apple's tools to build a proper install image with receipts and code signing so that your app is allowed on Macs with GateKeeper
You could use Homebrew (again a unix based tool) which has easy casks
You could use AutoPkg - an excellent tool for exactly what you ask - networked framework for installing software.

Since there are so many products you could make and package for OS X, it's hard to pick just a best solution for you.
Answer: You could invest ($100US) in the app Composer from JAMF.

Creating packages that are tailored to end-user configurations enables
  IT administrators to save their organizations time and resources.
  Packages are standards-compatible and available for deployment with
  Apple Remote Desktop, the Casper Suite, or any other patch management
  system. Better yet, the software arrives pre-configured and ready for
  end users to get started immediately.

I used it a few years ago when managing ~ 120 Macs. Simply put, it watches your development Mac when you install software and creates a .PKG from all the new & modified files|folders which result. When the .PKG installer is run, the files|folders are installed in the correct places. I used Composer in conjunction with Apple Remote Desktop, which can push a .PKG onto a Mac and install it silently.
If you are dealing with more than a Handful of Macs, this may be a (not inexpensive) way to go.
Presently, the Mac admins where I work use opensource munki:

Munki is a set of tools that, used together with a webserver-based
  repository of packages and package metadata, can be used by OS X
  administrators to manage software installs (and in many cases
  removals) on OS X client machines.
Munki can install software packaged in the Apple package format, and
  also supports Adobe CS3/CS4/CS5/CS6 Enterprise Deployment "packages",
  and drag-and-drop disk images as installer sources.
Additionally, Munki can be configured to install Apple Software
  Updates, either from Apple's server, or yours.
Munki is currently in use at organizations all over the world,
  managing software for tens of thousands of Macs.

Networked macs, .app installer help


What are the voltage & current ratings of output contacts of optocouplers ? whether they can withstand ac voltage or not?

Question: Currently I'm designing Voltage Stabilizer and I'm using three DC relays at the output of my AVR Controller, at the output of relays I have connected ac sources which is in the range of 190V to 280V and current ranges from 0.9A to 2A, whether I can use opto-coupler (opto-isolator) instead of relays or not ?
Answer: Devices sold as optocouplers generally have a an output that approximates a current source, with high output impedance, which is very different than a relay. Also they generally only pass current in one direction.
Depending on what you're actually trying to do, you might want to investigate solid state relays or SSRs.
Answer: What you most likely need is  an SSR. Do you really need 280 VAC rating? ..or do you just need to operate on 230-240 VAC?
If you only need 230 VAC, then look for "Arduino SSR" on Amazon or Ebay. There are lots ranging from single through to 8 channel that will likely support what you need.
Be aware that some are not using zero-crossing SSR's. However if you need to you can detect the mains zero crossing in your microprocessor and switch them on at the right times.
Some variants seem to use the Omron G3MB-202P (http://www.mouser.com/ds/2/307/g3mb_0609-298620.pdf) which is zero-crossing, but some product images show the G3MB-202PL which is not zero-crossing.
Answer: Devices we call "optical couplers" or "opto-isolators" are typically low-power, logic-level devices which are NOT SUITABLE for switching mains power.
Your description of the requirements are exactly what solid-state relays (SSR) are made for.  They are available in a wide range of ratings from small units the size of a large capacitor (as shown in Jack Creasey's photograph) up to larger "hockey-puck" style which are quite popular for microcontroller switching of mains power up to 20-30A, and even larger ones capable of handling rather large loads.  There are many SSRs for sale on Ebay at all times.
Your circuit description is sufficiently obscure and unusual to warrant additional caution to select appropriate SSR products as it doesn't sound like your typical mains AC control situation.


Is sodium ion an acid?

Question: As sodium ion has a 1+ charge and it can form the ionic compound NaOH with OH1-, hence it is a lone pair accepter (is this correct?). Therefore sodium ion should be an acid?
Comment: Yes, it's a Lewis acid, but a weak one.
Comment: But $\ce{Na+}$ isn't an acid in the Brønsted–Lowry theory, so *it depends...*
Comment: I thought sodium was in part of the alkali metals,but ions clearly don't work the way you think they're supposed to,but yes it's technically and "acid".
Answer: Sodium ion in aqueous chemistry is essentially nonacdic (contrast this with lithium ion, which displaces carbon dioxide when the bicarbonate is  "precipitated" and the precipitate is actually lithium carbonate). But in organic chemistry sodium ion shows some Lewis acid character, as demonstrated in the incompletely ionic structure and the solvation of sodium cyclopentadienide:

The nature of $\ce{NaCp}$ depends strongly on its medium and for the purposes of planning syntheses; the reagent is often represented as a salt $\ce{Na^+C5H5^-}$. Crystalline solvent-free $\ce{NaCp}$, which is rarely encountered, is a "polydecker" sandwich complex, consisting of an infinite chain of alternating $\ce{Na^+}$ centers sandwiched between $\ce{μ-η5:η5-C5H5^-}$ ligands.[1] As a solution in donor solvents, $\ce{NaCp}$ is highly solvated, especially at the alkali metal as suggested by the isolability of the adduct $\ce{Na(tmeda)Cp}$.[2]

Cited References

Robert E. Dinnebier; Ulrich Behrens & Falk Olbrich (1997). "Solid State Structures of Cyclopentadienyllithium, -sodium, and -potassium. Determination by High-Resolution Powder Diffraction". Organometallics. 16 (17): 3855–3858. doi:10.1021/om9700122.

Elschenbroich, C. (2006). Organometallics. Wiley-VCH: Weinheim. ISBN 978-3-527-29390-2.
Answer: According to the bronsted lowry definition of an acid, the sodium ion is not an acid. This is because the bronsted lowry definition of an acid states that an acid is a proton donor. The sodium ion is not a proton donor and so according to this definition it is not classed as an acid.
I hope this answers your question :)
Comment: But the question doesn't specify _Bronsted-Lowry_. It actually has descriptions related to Lewis and Arrhenius acids, so the Bronsted-Lowry definition is the least related to the question.
Comment: But in water the ion will be hydrated, and the hydrated ion can most definitely act as a (weak) Bronsted-Lowry acid
Comment: @IanBush exactly

Is sodium ion an acid?


Evaluate the definite integral

Question: Evaluate the definite integral $\int_\frac{1}{2}^1 \frac{x^2}{\sqrt{2x-x^2}}$ by first "completing the square" in the denominator and then making a suitable trigonometric change of variable by estimating the integral directly. Show that it is less than $\frac{1}{2}$.
Comment: So, what have you tried? You have been given nice hints already. It remains to see if you can apply them properly.
Comment: We have $2x-x^2=1-(1-x)^2$. Now is it clear what to do?
Answer: As Andre Nicolas wrote, $\sqrt{2x-x^2}=\sqrt{1-(1-x)^2}\Rightarrow\displaystyle \int_\frac 1 2^1\frac{x}{\sqrt{2x-x^2}}dx=\int_\frac 1 2^1\frac {x}{\sqrt{1-(1-x)^2}}dx$. We can substitue simply $a=(1-x)$ (and as follows $x=1-a,dx=-da$) so: $$\displaystyle\int_\frac 1 2^1 f(x)dx=\int_0 ^\frac 1 2\frac{(1-a)^2 da}{\sqrt{1-a^2}}=\int\frac 1 {\sqrt{1-a^2}}da+\int\frac{-2a}{\sqrt{1-a^2}}da+\int_0^{0.5}\frac{a^2}{\sqrt{1-a^2}}da$$ Here the calculating for each integral (in the last simply integrate by parts) is simple: $$=\arcsin(a)\mid_0^\frac 1 2+\sqrt{1-a^2}\mid_0^\frac 1 2+(\frac{\arcsin(a)-a\sqrt{1-a^2}}{2})\mid_0^\frac 1 2=0.5235987756+\frac{\sqrt 3}{2}-1+0.04529303685=0.4349172162<0.5$$ as required.
Answer: The integration procedure has been done in detail by Coargu Aliquis. We tackle the estimate only. If you have a graphing calculator, or know how to access a graphing program (there are free ones on the web), you might start by graphing $y=\frac{x^2}{\sqrt{1-x^2}}$, to see what is going on. You may notice that the function seems to be increasing in our interval, and reaches $1$ at $x=1$. We will show that indeed
$$\frac{x^2}{\sqrt{2x-x^2}}\lt 1$$
for all $x$ in the interval $\frac{1}{2}\le x\lt 1$.
 Equivalently, we show that $\frac{x^4}{2x-x^2}\lt 1$.
Equivalently, we  show that $\frac{x^3}{2-x}\lt 1$, that is, that $2-x-x^2\gt 0$. But this is clear, since both $x^3$ and $x$ are less than $1$ in the interval $[\frac{1}{2},1)$.
Thus our integrand is $\lt 1$ in the interval $[\frac{1}{2},1)$. Since the interval has length $\frac{1}{2}$, it follows that the integral is $\lt \frac{1}{2}$.
Answer: $$I=\int_\frac12^1 \frac{x^2}{\sqrt{2x-x^2}} =\int_\frac12^1 \frac{x^2}{\sqrt{1-(x-1)^2}}$$
Putting $x-1=\sin\theta,dx=\cos\theta d\theta$
When $x=\frac12, \sin\theta=-\frac12\implies \theta=-\frac\pi6$
$$I=\displaystyle\int_{-\frac\pi6}^0\frac{(1+\sin\theta)^2}{\cos\theta}\cos\theta d\theta$$
$$=\displaystyle\int_{-\frac\pi6}^0\frac{3+2\sin\theta-\cos2\theta}2d\theta$$
$$=\displaystyle\frac{6\theta-4\cos\theta-\sin2\theta}4\big|_{-\frac\pi6}^0$$
$$=\displaystyle\frac{-4-\left(-\pi-4\frac{\sqrt3}2+\frac{\sqrt3}2\right)}4$$
$$=\frac{3\sqrt3+2\pi-8}8=0.43491721623$$

Evaluate the definite integral


Copying object without dope sheet data

Question: How do I make a copy of an object without coying any of its dope sheet data? So the new object should have an empty dope sheet.
Answer: After copying, you can unlink the action fron the object, by turning the dopesheet into an action editor and pressing the X button near the action name to unlink it.

Copying object without dope sheet data


Approximating matrix with $n>1$ rank as outer product of vectors

Question: I know that matrix $M$ can be represented as outer product of two vectors (lets say $x$ and $y$) if it is of rank 1. Is there any way of approximating vectors $x$ and $y$ such that $|M - x * y|$ is minimal, when $rank(M) >1$ ?
Comment: We never say a matrix is minimal, but say the norm is minimal. Do you mean this? Then which norm do you use?
Comment: forgive me, i mean $M - x*y$ is "minimal difference" between $M$ and $x*y$. Maybe sum of differences between corresponding elements of $M$ and $x*y$ is good enough metric?
Comment: It matters how you want them to be close.  Do you want the two matrices to map a vector to two images that are close to each other in the euclidean metric?
Comment: yes, exactly! I need to have corespondent values in matrices as close as possible.
Answer: Yes. The singular value decomposition of
$$
M = U D V^t
$$
where $U$ and $V$ both have orthonormal column-sets, and $D$ is diagonal, with non-increasing elements down the diagonal, can be rewritten as
$$
M = u_1 d_1 v_1^t + u_2 d_2 v_2^t + \ldots
$$
When the diagonal elements $d_i$ are all distinct, the first term in this sequence is the rank-1 matrix that best approximates $M$ in the sense of the $L^2$ norm (i.e., $d(X, Y) = tr(X^t Y)$); the sum of the first two terms is the rank 2 best approximation, and so on.
When there are repeated singular values, you need to take some care... but not much. The only problem is that there are multiple rank-1 matrices that are all equally good approximations of $M$. (Think of the identity $2\times2$ matrix as an example.)


How do I check the process of mining, ie the percentage of a block to be finished?

Question: How do I check the process of mining, ie the percentage of a block to be finished ?
I have started the mining process, and the CPU is always 100%, I'm just wondering how far along that CPU work brought me to the goal of finding a block.
Where could I check the progress?
Thank you.
Answer:
...the percentage of a block to be finished?

It's not like a progression to completion, rather how many times you've tried to find a solution. If the network difficulty is 10, you'd likely find a block by the time you've tried 10 times, but you might find on the first try or any number of attempts.
If you want to track your luck, it's simply the amount of hashes you've tried divided by the network difficulty. If your hashrate is 20 KH/s, then 20,000 multiplied by the duration (in seconds) you've been mining gives you how many hashes you have tried.
Answer: The mining process is a memory-less one. Calculating a hash to see whether it yields a valid block does not bring you closer to the goal in any meaningful sense.
You can understand the process with a metaphor: imagine you are working QA at a plant manufacturing widgets, and you're trying to take defective widgets away before packaging. The manufacturing process will produce defective widgets with some small probability, and the only way you have to tell if a widget is defective is to try it.
Then you get to test widget after widget. But if you test a widget and it works fine, you don't get any closer to finding a defective widget. The next one you test is not more likely to be defective just because you the one you tested before was working. That's the same idea here. You don't progress towards a goal, though on average you'll find a defective widget every N minutes. Sometimes you'll find a defective one quick, and sometimes you'll get a long string of working widgets.


lcd 16x2 replacement and or interchangeability

Question: I need to replace a 16x2 LCD on a salt chlorinator display.
I searched the part number (GX1602KP) but can't find it.
I see alot of 16x2 lcd displays which look similar - are these lcd's interchangeable ?
Comment: Sometimes they are, sometimes they are not. It depends on the interface, pin layout, voltage levels, etc. Some modules may be compatible while others are not. They are not universally compatible though.
Comment: Timing varies sometimes too. Source: Replaced the 16x2 in a Siemens business phone and not all types worked.
Answer: This Chinese site found searching for GZ1602 makes it look similar - according to Google Translate.

Brand: GX Model: GX1602 Type: LCD screen Screen size: 2 (inch)
The character type liquid crystal display module is a dot matrix liquid crystal display module specifically for displaying letters, numbers, symbols, and the like. It is divided into 4-bit and 8-bit data transmission methods. Provides a 5×7 dot matrix + cursor display mode. A display data buffer generator CGRAM is provided, and CGRAM can be used to store font data of up to eight 5×8 dot matrix graphic characters defined by itself. Provides a wealth of command settings: clear display; cursor back to origin; display on / off; cursor on / off; display character flicker; cursor shift; display shift. An internal power-on automatic reset circuit is provided. When the external power supply voltage exceeds +4.5V, the module is automatically initialized and the module is set to the default display working state.
The display content is 2 lines, each line displays 16 characters, and each character size is 5×8 dot matrix.
  Character generator RAM can be customized according to customer needs, in Japanese, Russian and other 12 different countries.
The liquid crystal display module (LCM) has LCD colors of yellow-green, blue, and gray for customers to choose from.
The backlight color of the LCD module is yellow-green, orange, white, red, emerald, and blue, which can be selected by customers.
The use and storage temperature are: normal temperature (operating temperature 0 ~ +50 ° C, storage temperature -10 ~ +60 ° C); wide temperature (operating temperature -20 ~ +70 ° C, storage temperature -30 ~ +80 ° C); Temperature (working temperature -30 ~ +80 ° C, storage temperature -40 ~ +80 ° C), for customers to choose.
Comment: And the description is very similar to that of a display using a HD44780 controller chip.
Answer: There are a few types of LCD controller chips and some have compatible commands and some don't. If the controller or command set of the original display is known, it can be replaced with a display with compatible controller that has an identical command set. The command set should be easy to verify with a logic analyzer. Or just take the most common type of controller (HD44780 or compatible perhaps) and try it.
Answer: 99% of 16x2 displays have identical interfaces. The only 'variable' is the contrast setting.
These are cheap enough to buy and try. Just make sure the physical dimensions match where you have to install.


Energy lost in Capacitors

Question: Suppose there are two identical capacitors of capacitance C and one of them is charged to a potential V and gets a charge q. The energy stored in this capacitor is \$1/2cv^2\$ or \$q^2/2c\$ . Now this capacitor is connected with the uncharged capacitor. Now the net energy of this system will be \$q^2/4c\$ . How is the other half of the energy lost ? Where does it go ?
Comment: it go to the uncharged capacitor ? Energy is never lost !
Comment: Of course energy is lost in some form. We can say that from the above equations. I just want to know where the other half goes
Comment: Each capacitor will only have half the charge.
Comment: The only energy loss is in the resistance of the wiring - which is not being shown in the equations in the OP.  Meanwhile, the second equation applies to both capacitors, not just the second.  So, like `oldfart` says, the energy is split among both capacitors.
Answer: Mostly heat, typically in a real situation. Consider a non-zero resistance between the capacitors (and internal to them) and analyze what happens after the instant of connection. There will be a spark and some EM emission.
Even if the capacitors literally had zero resistance (superconducting) the energy would slop around because of inductance and eventually be lost because it was induced in lossy surrounding materials or emitted as EM waves.
Answer: To expand on Spehro's answer, let's assume a superconducting capacitor and wires. Then, when connection is made, charge will start flowing from the first cap to the second. When the voltage is equal, current will not, due to the inductance of the wires. Instead, the first cap will completely discharge, and the second will fully charge. At this point, the process will repeat in reverse. The result will be a sinusoidal oscillation with frequency $$f = \frac{1}{2{\pi LC}} $$ where L is the inductance of the entire system, including wires and internal capacitor structure.
This, of course, assumes no losses anywhere. If the wires are not superconductors, the oscillation frequency will be a bit lower, and the oscillation amplitude will (approximately) look like an inverse exponential. Even if there is no resistance, as Spehro notes, the circuit will radiate power as RF radiation (or whatever frequency is involved) and this will also serve to damp the oscillations.
When everything comes to rest, the two caps will have equal voltage and equal charge. Half the original energy will have been lost via the mechanisms noted.

Energy lost in Capacitors


Suggestions for WPF & WCF projects

Question: I am trying to work on a home project so I can get some practice working on WPF & WCF applications. Can anyone give out suggestions on a sample WPF and or WCF applications that I can develop?
Answer: A project I was thinking about was to help regulate my teenage son's internet usage.
Windows has a UI-based tool to control logon times.  A WPF front-end would be nice to duplicate or improve on that tool, but use it to set network usage times.  This way, kids could do school work (not prohibited from logging on their computer) but not be distracted by facebook.
The WCF portion would be a WCF service on your computer and WCF client on the kids' computers.  The kids' computers would periodically check for restriction updates.  If network access is current OFF, then the client (on the kids' computer) would turn off the network adapters (both ethernet and Wifi), turn them on every few minutes to check for updates, then turn them off again.
Just define a data contract for whatever structure/class you want to represent usage, and the service would have an operation contract with a single call, like:
<code>[ServiceContract]
interface INetworkControl
{
    [OperationContract]
    NetworkRestriction GetNetworkRestriction();
}
</code>
Maybe it would need more; that would be up to you (i.e., pass the computer name as a parameter, or perhaps logged on user if you wanted to control by user, who knows).
Answer: Maybe a peer to peer program ?
Answer: Not sure...I learned the 2 technologies by writing a facebook API based on WCF and writing a WPF frontend to browse the albums of my friends. My reasoning was that if WCF can do form-encoded POSTs with bare XML responses then it should be up for a lot of things.
Answer: I have bought an excellent program/tutorial here :
http://www.dofactory.com/Framework/Framework.aspx
I includes a program where WCF services are consumed by WPF (as well as by Windows Forms and a ASP.NET website).
It's about design patterns basically, but using services as datasupplier is a design pattern too of course.
(for the record : I really am not advertising for this company :-))
I think this might give you plenty ideas for your own programs, and if the aim is getting to know both technologies, it would be an excellent choice.

Suggestions for WPF & WCF projects


IRA yearly contribution limit

Question: With the yearly contribution limit of an IRA being $5500, are you allowed to open mutliple IRAs and does this make sense? I was curious what people who want to invest more into a retirement account but don't have a 401k usually do.
Answer:
are you allowed to open multiple IRAs?

Yes - but the contribution limit applies to all IRAs in total, so you cannot go over that limit by contributing to multiple IRAs.

I was curious what people who want to invest more into a retirement account but don't have a 401k usually do.

Invest in non-retirement accounts:

529 and other education savings plans are good alternatives if you have children that will be attending college
health savings accounts are pre-tax, and grow tax-free if they are used for qualified medical expenses.  The maximum tax deduction for HSAs for 2017 is $6,750 for family coverage.

Depending on your situation, you might also be able to open a spousal IRA, which will allow you to contribute to an IRA for your spouse in his/her name, meaning that the account is fully owned by them and not you.
Comment: It might be worth emphasizing the "all" in your first sentence and pointing out that the sum total of all IRA contributions (both Traditional and Roth) is subject to the $5500 annual limit ($6500 for people over 50); it is _not_ $5500/6500 for the Traditional IRA and another $5500/6500 for the Roth IRA.
Comment: Thanks. I didn't know the contribution limit was for all IRAs. That's good to know.
Answer: D Stanley's answer is good, but I'd add a couple of other things to think about:

If you're married, you can each set up an IRA which (provided you share finances) can effectively double the IRA limit (because you have one and your spouse has one).
If you're self-employed, set up an SEP-IRA which has much higher contribution limits if your income is high enough.
Comment: Am I correct in reading the SEP-IRA as saying that if you make too much to contribute to an IRA, you should change to self employed and hire yourself out to your current employer at the same rate but as an independent contractor, and then magically you will be able to contribute to an IRA?
Comment: @Michael there are many differences in being self employed than just retirement contributions.  you also meed to consider self employment tax and insurance consequences.
Comment: @Michael : As D Stanley says, "the same rate" will need to be thought about correctly to include the extra employment taxes (which you only play half of as a regular employee) and the availability of health insurance (don't get me started on the accepted serfdom of health insurance being tied to  your job and not being transferrable)... and any other benefits (vacation time,  stock options, bonuses, etc).  The company I left had a "benefits calculator" that showed everything in $$ terms; that was instrumental in showing me what I needed to do to be self-employed.

IRA yearly contribution limit


Get SFDC sessionID via access token

Question: As the title. I'm using username/password flow to request an access token. So how can I request a SFDC sessionID from that token?
Answer: The access token plays the same role as the session ID. Essentially the access token is the session ID for your web service.
Comment: Thank you for your help. I'm practicing on the example you gave.
Comment: But the token get expire after a period of time, right?
Comment: That's right, so does the session ID. You can set the expiry time in Setup -> Security Controls -> Session Settings (Timeout Value)
Comment: As you said. I don't need to request for sessionID, right? If true, how can I work with access token like sessionID? Could you give me any example?
Comment: Once you get the access token you need to stick it to the authoization header `Authorization : OAuth YOURACCESSTOKEN` and then you can make subsequent callouts from your environment to SF. A good java (based on your tags) example : http://stackoverflow.com/questions/9258653/salesforce-rest-api-login (DaSh's answer).

Get SFDC sessionID via access token


What is the penalty for the number of cites, for science and culture?

Question: I see on the KNOWLEDGE virtue, that "Networked datalink" and "Memeweb" reduce the penalty for number of cities for culture and science by 40%. what is that penalty anyway?
Answer: While I never cared for the specific numbers, science and culture/virtues are pretty easy to explain:

Basically you'll need x points to complete a research or develop a virtue.
While some means of gaining such points are global or unique (e.g. inherent to your sponsor or connected with wonders), most originate from buildings that can be built in all cities.
Due to this, the most logical step to achieve higher levels fast, would be to just build as many cities as possible:

Your second city would double your output, i.e. halving the time it takes to finish science projects or develop virtues.
The third city would still increase that output by 50%, etc.

To counter this, the game adds so called penalties. While I don't have actual numbers, imagine that completing a science project would take 60 science points. If you build a second city, you get a penalty and need 100 science points rather than just 60.

The whole thing can be explained with introduced overhead (let's assume scientists have to travel between cities, have to synchronize or compare their results, etc.) and it makes the whole effect far less extreme.
You still profit off your second city (assuming you build the apropriate buildings), yet it's more reasonable to avoid making it too attractive to just build cities an leave them underdeveloped. Just imagine someone establishing 10 cities with just the first few science buildings, since those are finished faster than fully upgrading just one or two cities.
The virtue mentioned by you lowers this penalty. So given the numbers above, rather than requiring 100 points for two cities, you'd just need 84 (40% less increase), making a faster expansion far more interesting.
Comment: It's declining the more cities you have. Otherwise it wouldn't cause any significant penalty for the second city (which would still nearly double your output).
Comment: Ok, I calculated it (for science): ARTIFICIAL EVOLUTION cost me 3,100 when I had 6 cities and when I build a new city it cost me 3,224- an increase of 4%. But I don't know if that increase accelerates or decelerates


ERR_INTERNET_DISCONNECTED whenever attempting to load page with developer tools open

Question: Chrome functions normally until I attempt to load a page with dev tools open. If I load a page and then go to view the console I can view console messages/inject javascript and the page doesn't crash. I have tried reinstalling as well as clearing all settings. Other users in my workplace don't have this problem. Dev tools on I.E work correctly.
Comment: Have you tried clearing chrome DNS cache, reset it or create a new chrome profile ?
Comment: Creating a new user fixed the issue.
Comment: Computer user account ?
Comment: No I made a new chrome profile like you suggested. Sorry for the ambiguity.
Answer: It is caused by hard-to-notice internet-connection-simulation setting in the developer tools.

Open developer tools in Chrome
Go to Network
Just below menu when you've selected Network, possibly next to "disable cache", there is a select option - if you are getting ERR_INTERNET_DISCONNECTED with seemingly no reason =>=> Offline will probably be selected.  This can be confusing and hard to find, because this select option doesn't have any label or title, only thing you see is the selected option with an arrow...
To turn it off open the select option and under "Disabled" select "No throttling"

&jBTW: Creating new chrome profile will, of course, work too, but that would be kind of an "overkill" :-)
Image Guide:
Comment: wow, nearly 10 years later and this is still the default. Thank you!
Answer: Open command prompt and type below commands,
ipconfig /flushdns
ipconfig /renew

The above CMD trick working for me.
More Solution of ERR_INTERNET_DISCONNECTED: http://www.wiknix.com/how-to-fix-err_internet_disconnected-error/


Can I open new tabs in Opera with a homepage loaded rather than empty?

Question: By default opera opens new tabs empty. Can I configure it so that upon opening a new tab the homepage is automatically loaded?
Comment: Actually, by default, Opera tabs come with the Speed Dial, if I remember well (or this is to activate, maybe).
Answer: First, set your Home page, which can be done via:

Tools > Preferences > General

Or Ctrl + F12 and then to the General tab.
Next, set all your bookmarks to open up in new tabs.
Now, call home with the home shortcut Alt + Home.
This will fire up a new tab set to your home page and skip showing the Speed Dial/blank tab.
Comment: Neat trick. Upside-down solution, I haven't thought of that.
Comment: If you were in space, it'd be right-side up.
Answer: Kadłubowski & Rads: Yes, you can tell Opera to open a new tab with your home page instead of the speeddial. Short summary; You can modify the keyboard shortcut and mouse gesture to do exactly what you want.
Comment: that link is dead


Injection of Besov spaces in $L^p$

Question: I believe that for $p\ge 2$, we have the continuous injection (for $p=2$, it is an equality),
$$
B^0_{p,2}(\mathbb R^n)\subset L^p(\mathbb R^n),
$$
where $B^0_{p,2}(\mathbb R^n)$ is the Besov space.
Is there a straightforward proof?
Comment: Here is a ``straightforward proof." Write the dyadic Littlewood-Paley characterizations of $B^{0}_{p,2}$ and $F^{0}_{p,2} = L^p$ and use Minkowkski's inequality to take the $L^p$ norm inside the $\ell^2$ norm. In any case, this is not really a research-level question.
Answer: Theorem 2.3.2 d) in Triebel says that for $- \infty < s < \infty$ we have (continuous inclusions)
$$B^s_{p,2}(\mathbb{R}^n) \subset F^s_{p,2}(\mathbb{R}^n) = H^s_p(\mathbb{R}^n) \subset B^s_{p,p}(\mathbb{R}^n) \quad \text{for}~2 \leq p < \infty, \\ B^s_{p,p}(\mathbb{R}^n) \subset  F^s_{p,2}(\mathbb{R}^n) = H^s_p(\mathbb{R}^n) \subset B^s_{p,2}(\mathbb{R}^n) \quad \text{for}~1 < p \leq 2.$$
The proof seems like a direct estimate for the norms in the respective spaces, which are the ones by dyadic decomposition. Maybe that qualifies as straightforward, at least where $s=0$?
Triebel, Hans, Interpolation theory, function spaces, differential operators., Leipzig: Barth. 532 p. (1995). ZBL0830.46028.

Injection of Besov spaces in $L^p$


Windows 10 and Archlinux Dualboot from encrypted drive

Question: A few days ago I bought a new notebook without an operating system. I am planning to install Arch Linux and Windows 10, because sometimes at university you get software you have to use which can only be executed with Windows. Since it is a mobile device, I want to encrypt the drive or at least the Arch partitions. If there is an easy way to encrypt the Windows partitions too, I would do that, otherwise it would be no big problem for me to have no sensible data there. Could you explain me shortly (or detailed, if you like to do so) what I can do to encrypt both operating systems? I want to use GRUB as bootloader since I never tried to use Microsoft's bootloader for dualboot.
Comment: Take a look at Veracrypt
Answer: Typical Linux encryption solutions appear to be per block device: this
means that you should probably look for separate solutions for each
operating system. Arch Linux has documentation about how to do this
(https://wiki.archlinux.org/index.php/Disk_encryption); it mentions
that some options are loop-AES and dm-crypt.
I can't comment on the Windows part of your question, but I assume you
will find a similar plethora of options.
Answer: Thing about TrueCrypt is that its development is discontinued, because of security problems with windows systems I think, I personally use VeraCrypt to encrypt, it is cross-platform I believe, and is very easy to use and similar to TrueCrypt.
I have pretty much exactly same setup as yours, but on Desktop, instead of notebook. I had some problems regarding grub on arch linux, I could not set it up, if you run into the same problem and if you have UEFI/GPT setup, I suggest you use systemd-boot(gummiboot) which works perfectly and is much simpler then grub(link - https://wiki.archlinux.org/index.php/Beginners%27_guide#UEFI.2FGPT).
Answer: TrueCrypt might work if you trust it and can find a copy somewhere.  Been a while since I've used it, but iirc, it supported both operating system classes and full hard drive encryption.