C++ code analysis tools

Question: I'm currently in the process of learning C++, and because I'm still learning, I keep making mistakes.
With a language as permissive as C++, it often takes a long time to figure out exactly what's wrong -- because the compiler lets me get away with a lot. I realize that this flexibility is one of C++'s major strengths, but it makes it difficult to learn the basic language.
Is there some tool I can use to analyze my code and make suggestions based on best practices or just sensible coding? Preferably as an Eclipse plugin or linux application.
Answer: Enable maximum compiler warnings (that's the -Wall option if you're using the Gnu compiler).
'Lint' is the archetypical static analysis tool.
valgrind is a good run-time analyzer.
Comment: +1 for valgrind. It finds many newbie subtile errors like off by one.
Comment: Beware that most version of lint are written for C and are pretty useless for C++. Gimple PC-Lint is an exception.
Answer: I think you'd better have some lectures about good practices and why they are good. That should help you more than a code analysis tool (in the beginning at least).
I suggest you read the series of Effective C++ and **Effective STL books, at least. See alsot The Definitive C++ Book Guide and List
Answer: For g++, as well as turning on -Wall, turn on -pedantic too, and prepare to be suprised at the number of issues it finds!
Answer: Tool support for C++ is quite bad compared to Java, C#, etc. because it does not have a context-free grammar.  In fact, there are parts of the C++ grammar that are undecidable.  Basically, that means that understanding C++ code at the syntactic level requires implementing pretty much a compiler front end with semantic analysis.  C++ cannot be parsed into an AST independently of semantic analysis, and most code analysis tools in IDEs, etc. work at the AST level.  This is part of the tradeoff you make in exchange for the flexibility and backwards compatibility of C++.
Comment: And this is exactly why I wanted to scream when I saw what new "features" the standards committee was going to add in C++0x!
Comment: c++ has a just-fine context-free grammar, and can be parsed just  without semantic analysis if all you want is a syntax tree (and some ambiguities).  You have to stop using weak parsing technology such as LALR (e.g., YACC).  See GLR parsers, and especially see Elsa www.eecs.berkeley.edu/~smcpeak/elkhound/sources/elsa/ and
the DMS Software Reengineering Toolkit
www.semanticdesigns.com/Products/FrontEnds/CppFrontEnd.html
Both of these tools also provide full "semantic analysis" in the sense of determining the meaning of symbols and removing ambiguities from the parse tree, if asked.
Comment: Yes, but the some ambiguities part was the point I was trying to make.
Answer: Turning on all compiler warnings (at least initially) and then understanding what they mean, how to fix the problems highlighted and which of the warnings represent genuine constructs that compiler writers might consider ambiguous is a good first step.
If you need something more heavy duty, you could try PC-Lint if you're on Windows, which is still one of the best lint tools for C++. Just keep in mind that you'll need to configure these tools to reflect your coding style, otherwise you'll get swamped with warnings and won't be able to see the wood for the trees. Yes, it costs money and it's probably a bit overkill if you're not doing C++ on a "getting paid for it" level, but I find it invaluable.
Answer: There is as list of static code analysis tools at wikipedia.
But warnings are generally good but one problem with enabling all warnings with pedantic and Wall is the number of warnings you might get from including headers that you have no control over, this can create a lot of noise. I prefer to compile my own software with all warnings enabled though. As I program in linux I usually do like this:
Put the external headers I need to include in a separate file, and in the beginning of that file before the includes put:
#pragma GCC system_header

And then include this file from your code. This enables you to see all warnings from your own code without it being drowned in warnings from external code. The downside is that it's a gcc specific solution, I am not aware of any platform independent solution to this.
Answer: lint - there are lots of versions but if you google for lint you should find one that works. The other thing to do is turn on your compiler warnings - if you are using gcc/g++ the option is -Wall.
You might find CppChecker helpful as a plugin for Eclipse that supports gcc/PC lint.
Answer: I think that really what you need to learn here is how to debug outside of an IDE. This is a valuable skill in my opinion, since you will no longer require such a heavy toolset to develop software, and it will apply to the vast majority of languages you already know and will ever learn.
However, its a difficult one to get used to. You will have to write code just for debugging purposes, e.g. write checks after each line not yet debugged, to ensure that the result is as expected, or print the values to the console or in message boxes so that you can check them yourself. Its tedious but will enable you to pick up on your mistakes more easily, inside or outside of an IDE.
Download and try some of the free debugging tools like GDB too, they can help you to probe memory, etc, without having to write your own code.

C++ code analysis tools


Obtaining a replacement UK driving licence

Question: I currently live overseas and have done so since 2010.  I previously held a UK driving license, but have somehow managed to mislay it.  Can you advise how I can get a replacement.  Thank you.
Comment: Where do you live?  If you live in the EU, you are supposed to replace it with a local license; but that may be hard if you've lost the original.  In the worst case you may have to retake the test locally.
Comment: That is also true elsewhere. A comment in a recent question quoted Maryland, USA as 60 days.
Answer: UK drivers licenses can be replaced, even from overseas, but only if the applicant resides in Great Britain. See this UK govt. page, which addresses license replacement, and contains the following text:
...To replace your licence you'll need to: be a resident of Great Britain (there's a different service in Northern Ireland), not be disqualified from driving for any reason pay £20 by MasterCard, Visa, Electron or Delta debit or credit card provide addresses where you've lived for the last 3 years.
Thus, to replace your previous license, you'll have to lie to DVLA about your residence. None of us would recommend that course of action.


Why does Ethereum plan to move to Proof of Stake?

Question: The initial version of Ethereum (Frontier) uses a Proof of Work based consensus algorithm, but I see that there are plans to implement a Proof of Stake based consensus algorithm called "Casper" in a future version of Ethereum.  What is the motivation for the move to implement Proof of Stake in Ethereum, when no other major blockchain is currently using this technology?
Comment: Decred is a major blockchain that currently uses PoS.
Comment: Cosmos is another blockchain using PoS (using Tendermint consensus).
Answer: The fundamental flaw of Proof of Work (PoW) is that the costs of attacking the system are equal to what is spent to run the system. High security thus can only be achieved at high operating costs. The idea is that the honest participants just outspend the dishonest.
This is already today highly inefficient, but it does work for Bitcoin. As soon as the block subsidiary starts reaching zero, the ratio between the Market Capitalization and the costs of attacking Bitcoin becomes critical.
Details are presented here.
Why Proof of Stake?

Costs

Proof of Stake (PoS) promises to solve this problem. An honest validator is expected to have very low costs, compared to the costs an attacker would incur.

Less Censorship

Another problem Casper tries to solve is to disincentivize censorship. The PoW schema of Bitcoin is, more or less, a zero sum game. This means, if a miner loses a block (it does not get included in the main chain/ it gets censored), all other miners benefit from their loss. PoS for Ethereum will not be a zero sum game but instead a coordination game, where the rewards for everyone are highest, if every participant can include their blocks.

Scalability

Finally some scalability problems can be addressed more easily with PoS.
Comment: Always provide the full form like this, when first introducing an abbreviation: Proof of Work (PoW)
Comment: I don't agree with this statement regarding Proof of Work algorithm "High security thus can only be achieved at high operating costs. The idea is that the honest participants just outspend the dishonest.". In order to compromise PoW you need a group of dishonest participants, that not only outspends honest ones, but also can reach and enforce full cooperation between themselves. This is much more difficult to achieve than just outspend honest ones, if not impossible.
Answer: There are two key motivations for the move to Proof of Stake:

Ethereum developers and researchers believe that consensus algorithms based on Proof of Stake (PoS) can provide a higher degree of security for a given amount of resource expenditure, compared with Proof of Work (PoW) consensus algorithms.
Ethereum developers and researchers believe that a new design called Casper resolves the important remaining issues with the current "state of the art" in Proof of Stake design.  These issues include imperfect decentralisation and vulnerability to certain types of attacks, as well as other economic and performance considerations.

Both topics touch on issues worth elaborating in their own questions and answers, so I'll be linking to other questions as I summarise the main reasons for these two motivations.
disclaimer:  I've contributed to the Casper research effort in a few small, oblique ways.  However I have no formal relationship with the Ethereum project and I think my answer here is fairly objective in any case.  Suggested changes are welcome.
Why would Proof of Stake provide more security for a given investment of resources than Proof of Work?
First, some background is useful.  The goal of a consensus algorithm in a public blockchain network is to let many different users agree on the current state of the blockchain even though they don't trust each other or any central authority.  This is a challenging problem, and until the Bitcoin network first solved it in 2008 by using Proof of Work (a.k.a. "mining", a.k.a. "hashing") no really good solutions were known.  So the "performance" of the algorithm wasn't originally that important--the fact that it could be done at all was impressive enough.
After Bitcoin showed that a solution to public consensus was possible, new ideas such as "Proof of Stake" began to pop up in its wake.  For a full explanation of the differences between PoW and PoS consensus, see here.  Once new algorithms were proposed, the question turned from "does it work?" to "does A work better than B?"
There are several different ways to answer this question.  One way to gain an insight into the potential promise of PoS protocols is to consider four factors in particular:

The cost to cooperating "honest nodes" in the absence of hostile attack
The cost to cooperating "honest nodes" during a hostile attack
The cost to attacking "hostile nodes" if their attack is unsuccessful
The cost to attacking "hostile nodes" if their attack is successful

By comparing these costs to block rewards and other potential gains we can estimate the amount of "honest node" resources required to both run the network and hold off an attacker of a given scale.  This provides a reasonably fair way to compare the level of security provided by two different consensus protocols.
Answer: That is very complicated topic.
Considered Proof-of-Work waste energy to maintain security of a public censorship resistant consensus ledger. Though there is a long standing debate about this point. You can see for yourself that Bitcoin consumes more than $1 mln of value per day. Energy consumption on hash calculations is estimated to be around Iceland's energy consumption. That is the reason why a lot of smart guys are trying to solve that with Proof-of-Stake. There is a long technical article written by Vitalik to understand this subject more deeply.
Comment: Aside the power consumption in PoW, we will also encounter another resource waste as the graphic cards used to mine in PoW will be trashed. As I agree that the problem is not directly linked to running PoS, looking at all aspects of the switch between PoW and PoS is necessary to be coherent with the ecologically friendly goal of PoS. See also http://ethereum.stackexchange.com/a/3541/405 about this problem.
Comment: @Malone at the time of writing I admit  I wasn't aware of Golem project. Have a look at it, it's a nice way to use GPU without wasting computing power.
Comment: @NicolasMassart Surely the graphics cards could be used to mine another cryptocurrencies and therefore do not need to be thrown in the trash?
Answer: The above answers contain good arguments about the drawback of PoW

scalability: PoW schemes require propagating new candidate blocks to all miners around the world, and occasionally miners will split and do work on a chain that ends up being orphaned / not the longest. This happens for brief moments all the time, and in Ethereum these "almost blocks" help secure the chain as "uncles" and distribute a lesser block reward to uncle-finders, as opposed to Bitcoin blocks which only have one predecessor and only reward the miner that finds the latest block.
environment / climate concerns: PoW schemes consume a lot of electrical energy, some of which is generated by burning fossil fuels which may contradict your social values

I'll answer your other concern:
why didn't Bitcoin use PoS from the beginning, and why don't most other coins use it?
Proof-of-stake is more difficult to implement and prove its correctness formally, in the theoretical computer science / mathematical sense. There is one coin, NXT (now Ardor) which uses proof-of-stake since 2014, but it has a small number of miners and is not as well-known as other chains. Proof-of-work itself was a big gamble and a big leap for 10 years ago, but if Satoshi Nakomoto had known how to implement proof-of-stake in a secure way for Bitcoin, he probably would have done so. Bitcoin was an unknown coin at the time worth fractions of a penny, so if the network were compromised with a 51% attack, very little was lost, so it's okay just to YOLO and ship your code out to the world.
The majority of all altcoins use a fork of the Bitcoin codebase and have changed very little about it other than swapping in a new PoW algorithm, changing the blocktime, etc. They benefit from a 10 year track record of security, but are also hesitant to "rock the boat" by adding anything significantly new, so they are also saddled with the problems and unintentional design problems of Bitcoin.
Ethereum is a multi-billion dollar network now, at current prices, so its governing foundation and users are more cautious and considering many more failure scenarios. That being said, there are at least 5 different teams working on compatible Ethereum 2.0 clients that recently (Sep 2019) were able to sync up on the same testnet in Ontario, with a target launch date of Ethereum 2.0 mainnet (the beacon chain) in January of 2020.
The Ethereum community has shown an ability to recover from hacks and failures in the past, so in my opinion, this launch will only be another period of continued testing, learning, discovering of problems, and improvement. In 10 more years StackOverflow users will be asking "Why do some cryptocurrencies stick with Proof-of-Work for so long when we now have a clearly better alternative?"
Answer: In order to validate transactions and create blocks, a forger must first put their own coins at 'stake'. Think of this as their holdings being held in an escrow account: if they validate a fraudulent transaction, they lose their holdings, as well as their rights to participate as a forger in the future. Once the forger puts their stake up, they can partake in the forging process, and because they have staked their own money, they are in theory now incentivized to validate the right transactions.
Proof-of-stake systems are more environmentally friendly and efficient, as the electricity and hardware costs are much lower than the costs associated with mining in a proof of work system. A greater number of people are encouraged to run nodes and get involved because it is easy and affordable to participate in this system; this results in more decentralization.


Is it OK to purchase cat food?

Question: Forgive a (possibly) silly question - but I have a cat as a pet, and of course I purchase cat food for him and feed it to him. Being a pretty recent participant of Buddhist thought and practice, I also understand that eating meat (something I admittedly still do myself) is frowned upon, but the thought occurred to me the other day - is it also frowned upon to buy my pet meat-based products? By doing so I participate in the killing of animals. On the other hand, cats are pretty much carnivores by nature, and trying to get a cat to go vegetarian would likely harm him.
Comment: There are many questions here about meat eating, it does vary from tradition to tradition, I also see as personal preference like Sankha said, you can look for those questions here if you want.
Comment: [Can domestic cats be healthy as vegetarians?](http://skeptics.stackexchange.com/q/23417/2703)
Answer:
I also understand that eating meat (something I admittedly still do
  myself) is frowned upon

It depends on the tradition and personal beliefs. If you follow Theravada Buddhism, you wouldn't have any issue with feeding yourself or your cat with meat products. In Theravada Buddhism, the word of the Buddha is valued higher than personal opinions. So you or your cat is less likely to get frowned upon, just for eating meat. :) Vegetarianism is usually treated as a personal food preference.
Comment: If i might kindly add to Sankhas answer. It is also important to look at the intention behind the action. Do you have any intention to kill or to harm living beings when you buy cat food? If you can answer "no" to that question then you have done nothing wrong. If you want to go deeper into the ethics about where the meat is comming from then you can do that but it is the intention behind the action that is the key here.
Answer: Looking more critically at karmic web is good, but the whole point is to reduce/diminish and ultimately end suffering, however it manifests in the world...
That said, it doesn't hurt to look into where you get your cat food from, getting it from more ethical sources.
We could go out and try and prevent every lion from eating a gazelle, but that would kill the lion and the gazelle, because the gazelle would overgraze and run out of food, and the lion would starve.
When synthetic meat is plentiful and cheap, then maybe we can have no ethical qualms about our feline's meals having meat in them, but until then, try and make the best decision with the information you have available.
Meat is not really the problem, the main issue is what happens to obtain the meat.  In whatever way we can minimize or avoid that, so much the better.  So perhaps you get cat food that's chicken from chickens that only ate corn instead of eating worms.  Honestly I do not know if such products exist or are at that level of transparency yet, but it's possible, depending on where you live.
Don't sweat it.  The intention you have to keep your furry roommate friend alive is more valuable than the other side of the scale.
Answer: As noted elsewhere, it's pretty much only Mahayana Buddhism (especially Chinese, Korean, Vietnamese Buddhism) where vegetarianism as an ideal is the norm. So I'm answering from that standpoint.
The Upaseka Precepts Sutra* does have something to say about pets. They essentially promote divesting of your animals, specifically singles out carnivores as unallowable animals to own, and suggests releasing them back to the wild. In practice, some lay followers donate the animals to temples, which let the animals live out their life on the monestary.
I'm a vegan, but out of accident of family history I own a cat, who kills mice in my apartment and eats cat food from a bag, the label says it is 20% plant matter, so which is 20% more than a cat would eat in the wild. Obviously I'm a pragmatist and prefer harm reduction over harm rationalization.
A random observation is that my cat loves corn. Some of the cat food brands he has eaten use corn gluten as the source of protein and he really likes the flavor of corn.

An Upsaksa is a lay person, this sutra is for lay people who takes on more than the 5 precepts, but fewer than the Bodhisattva Precepts or the vinaya precepts, which are for monastics.

ref: http://www.sutrasmantras.info/sutra33c.html

(16) If an upāsaka who has accepted this precept raises animals, such
  as elephants, horses, cows, goats, camels, or donkeys, and refuses to
  give them away to someone who has not received the [upāsaka] precepts,
  he has committed the sin of negligence.

ref: http://www.ic.sunysb.edu/Clubs/buddhism/bns/bnstext.htm

On Harming Sentient Beings A disciple of the Buddha must not sell knives, clubs, bows, arrows, other life-taking devices, nor keep
  altered scales or measuring devices. He should not abuse his
  governmental position to confiscate people's possessions, nor should
  he, with malice at heart, restrain or imprison others or sabotage
  their success. (82) In addition, he should not raise cats, dogs,
  foxes, pigs and other such animals. (83) If he intentionally does such
  things, he commits a secondary offense.
Answer: May be you could feed your cat egg products ? It minimizes the negative karma yet may also be a nutritionally complete meal. I don't have any cats and not sure they would consume eggs, but you can try feeding the cat part of your omelot. You can also try try tuna which may have less of a karmic repurcussion than something higher up on the food chain. It's been said the difference between killing a plant and killing an animal is that you can't hear the plant scream. Keeping this in mind you may want to choose a diet that minimizes the withdrawl from you and your cats karmic accounts.
Answer: Vajra Yana Buddhism ( Ref-Wikipedia) allows the followers to take meat and the Preachers ( Acharyas) to get married .   It came as a variant of Buddhism in India ,firstly as an attempt to combine Tantra System of Hinduism with Buddhism and later around 7th-8th Century AD to justify the use of Violence for Self-Defence and for protection of Buddhists from opponents of Buddhism --mainly Islam which justified the use of Violence for spread of Religion.  This form of Buddhism spread to other parts of the World and is known by different names in different regions.
Comment: That is interesting information. Seems pretty relevant in today's world.

Is it OK to purchase cat food?


F/OSS Optical Object Avoidance

Question: I am beginning work on a larger scale, 250-350 lbs wheeled robot and looking to use both optical and other means of object avoidance. I am concerned with a robot this large causing issues with running into things, including people as it has a top speed of 15mph and that would cause issues with safety. I am starting out with a remote control but am looking to have the robot become self contained. I have been loosely following the DARPA driver-less car project but will not have anywhere near the fiscal or power budget that they do for sensors and computers. Am I thinking to far afield with my idea of having a self-contained robot in the 250-300 lbs range that does not break the bank on optical object avoidance? Any comments or experiences will be greatly appreciated.
Comment: This is a really vague question. What kind of tasks do you want the robot to perform? What kind of sensors do you have access to (RGB, RGB-D, sonar, etc.)? Are you looking for a completely self-contained library (there isn't one), or are you comfortable with implementing this sort of thing on your own? By "avoidance" do you mean simply not running into things (by stopping), or actually trying to navigate around obstacles to perform a task?
Answer: Optical avoidance of people in an every-day (like) environment would be difficult, your best bet would be with sensing the range of things from the robot, rather than if it is a person or not. An Xbox Kinect could do the job if mounted in the right place. Alternatively you could use range finders, either the light or acoustic variety. I have used Ultrasonic sensors from these people before, and they are good at ranges from about 5cm to around 3 meters, although they have an unfortunately small field of view, but they work.
Alternatively, if you are able to have a controlled environment, such as an arena or room, you can use libkoki markers (or an alteration thereof) to define the edges or your arena and anything the robot must not go near. The libkoki libraries can be found here
Comment: Just something of an addition. If you are looking to use these sensors in a car in an outdoor environment, then you can scratch off the Xbox Kinect option as it works only indoors.
Answer: Yes, you are thinking too far afield. This is an open research problem (especially where people are concerned). Don't even think about the DARPA grand challenge, that's way out of a single person's league. However, there are some good starting points I can recommend.
A labmate has had good success tracking people using a Kinect with OpenNI. The kinect has range information, which makes it better than pure vision or binocular vision. Typically a vision-based solution uses Structure From Motion. Because this can be terribly sensitive to moving scenes, vision is probably NOT the way to go for this task. A more reliable method is laser scanner for close-in obstacle avoidance. However, Vision-based SLAM is possible, and can be implemented using the Robot Operating System.  The task becomes significantly easier if you have detailed maps before you deploy.
Start with ROS, aka the Robot Operating System, it will be much more helpful than implementing these things yourself. I can assure you from personal experience.
Answer: If what you are looking at is a research topic, not a ready-to-use solution, then maybe visual servoing techniques with occlusion handling, or path planning in the image, might be of some use. (Never tested, but know the names behind it: http://www.irisa.fr/lagadic/visp/visp.html)

F/OSS Optical Object Avoidance


Woocommerce: custom loop in product tabs breaks reviews tab

Question: I came across a weird issue, not sure whether it's a bug or something is wrong with my code.
Woocommerce allows to show cross-sale products only in the cart by default, so I had to make a custom loop to display them on product pages.
So I made a custom product tab for the product page that shows cross-sale products (up-sales or related products will not fit the requirements for that). it's all working fine except the Reviews tab. If I place it after the tab with cross-sales it shows wrong reviews (which seem like random). The reviews counter (the one that is next to the tab's name) is correct, but the list of reviews contains reviews of other products and not the current one. If the tab of reviews is before my cross-sales tab then it's fine. So I guess something in my code is breaking it, but I can't figure out what...
Here's the code that I run in my cross-sales tab:
$crosssell_ids = get_post_meta( get_the_ID(), '_crosssell_ids' );
$crosssell_ids = $crosssell_ids[0];

if(count($crosssell_ids) > 0) {
    $crosssell_args = array( 'post_type' => 'product', 'posts_per_page' => 8, 'post__in' => $crosssell_ids );
    $crosssell_loop = new WP_Query( $crosssell_args );
    echo '

Consumables for
«' . get_the_title($product->id) . '»
';
    while ( $crosssell_loop->have_posts() ) {
        $crosssell_loop->the_post();
        wc_get_template_part( 'content', 'product' );
    };
    echo '
';
}

I gave my loop a custom name to avoid any conflicts, so it should overwrite any variables that are used by reviews... I also tried to buffer the template inside the while loop and output buffered variable, but it didn't solve the problem.
The problem is that I'm required to put reviews after this tab by design, so I can't just leave it with reviews before (it's also because the first tab with product description should also contain a couple of these cross-sale products).
And here is my function for adding custom tabs and setting their priority:
// Custom tabs for product page
add_filter( 'woocommerce_product_tabs', 'my_product_tabs' );
function my_product_tabs( $tabs ) {
    // Add new product tabs for product page
    $detailed_info = get_post_meta( get_the_ID(), 'detail_info', true );
    if( !empty($detail_info) ) {
        $tabs['detail_info'] = array(
            'title'     => __( 'Detail info', 'woocommerce' ),
            'callback'  => 'my_tabs_detail_info_html'
        );
    }
    $crosssell_ids = get_post_meta( get_the_ID(), '_crosssell_ids' );
    $crosssell_ids = $crosssell_ids[0];
    if( !empty($crosssell_ids) ) {
        $tabs['consumables'] = array(
            'title'     => __( 'Consumables', 'woocommerce' ),
            'callback'  => 'my_tabs_consumables_html'
        );
    }
    $tabs['delivery_methods'] = array(
        'title'     => __( 'Delivery Methods', 'woocommerce' ),
        'callback'  => 'my_tabs_delivery_methods_html'
    );

    // Edit default product tabs for product page
    unset( $tabs['additional_information'] );

    // Tabs order
    if ( isset($tabs['description']) ) $tabs['description']['priority'] = 10;
    if ( isset($tabs['detail_info']) ) $tabs['detail_info']['priority'] = 15;
    if ( isset($tabs['consumables']) ) $tabs['consumables']['priority'] = 20;
    $tabs['reviews']['priority'] = 25;
    if ( isset($tabs['delivery_methods']) ) $tabs['delivery_methods']['priority'] = 30;
    return $tabs;
}

Comment: Looks like it's `$crosssell_loop->the_post();` line that's causing the issue...
Answer: I found the solution which is probably quite basic for experienced WP developers. I'm gonna post it here instead of deleting the question though, I hope this might help someone someday...
The issue was that the post data wasn't reset, so all I needed is to add a function call wp_reset_postdata(); after my while loop. Like so:
$crosssell_ids = get_post_meta( get_the_ID(), '_crosssell_ids' );
$crosssell_ids = $crosssell_ids[0];

if(count($crosssell_ids) > 0) {
    $crosssell_args = array( 'post_type' => 'product', 'posts_per_page' => 8, 'post__in' => $crosssell_ids );
    $crosssell_loop = new WP_Query( $crosssell_args );
    echo '

Consumables for
«' . get_the_title($product->id) . '»
';
    while ( $crosssell_loop->have_posts() ) {
        $crosssell_loop->the_post();
        wc_get_template_part( 'content', 'product' );
    };
    wp_reset_postdata();
    echo '
';
}


Are big miners a threat for Bitcoin?

Question: According to this graph, the biggest miner is so big that combined with two of the three runners-up they would have more than 50% of the hashing power.
Is that to be considered a threat to the bitcoin network?
Comment: They mantain market balance.
Answer: As others have mentioned, those are mining pools, not miners.
Large mining pools provide the benefit of allowing small miners to earn more regular income, which encourages participation in bitcoin mining and strengthens the bitcoin network.
They are also a threat because they can be hijacked or DDOSed by a party wishing to do a >50% attack.
A temporary >50% attacking from a large pool being taken over by a hacker or DDOSed is a much smaller threat to bitcoin than a party acquiring more than 50% of the network hash-rate through their own hardware and being able to conduct a permanent/long-term >50% attack, so mining pools, by increasing the contribution of honest miners to the network hashing rate, benefit bitcoin more than they threaten it.
Features could theoretically be incorporated into mining software to reduce the threat of hijacking and DDOS attacks too, like automatically switching a mining machine to a different pool if the mining software detects previously confirmed blocks becoming unconfirmed or the mining pool becomes unavailable, respectively.
Comment: Very nice suggestion the automatic switch.
Answer: Those aren't miners, those are mining pools.
There is the risk of disruption (e.g., rejecting all transactions) if a miner (or cartel) has 50% + 1 of the hashing power.  But the pools are dependent on individual miners using the pool.  If a pool were found to be cooperating in such an attack, miners would go elsewhere and that pool's hashing strength would disappear quickly.  Thus the 50% foothold would erode and be lost.
So there is a risk of temporary harm should your scenario play out.  Whether or not that could be permanent harm depends how determined the attacker is at controlling 50% + 1.  Doing so is not only not profitable, it would also require a tremendous outlay of money.  Attempting to attack Bitcoin with 50% could be performed only at a tremendous financial loss.
Here are more details on what the attacker could do:

https://bitcoin.stackexchange.com/a/662/153
Answer: Anyone holding a large amount of computing power can be seen as a potential threat to the Bitcoin Network. However, those pools have been around for a long while and their owners have earned their reputation in the Bitcoin community, so they can be more trusted.
Moreover, as it is not just one pool but three, such collusion is less likely.
There already was an incident where a single pool was holding a majority of the computing power of the Bitcoin network due to another pool shutting down for awhile and nothing really happened. If something was happening, one could probably pick it up quite early on and probably a lot of miners using those pools would put their computing power elsewhere.
The mining pools are largely financially invested in Bitcoin, meaning that they might be less likely to harm the Bitcoin community. However, the same could not be said about alternative cryptocurrencies, as it was demonstrated by Eligius attack on Coiledcoin.
If, however, you'd have a major mining farm held by one person or corporation whose main source of income is not Bitcoin, then you can start worrying. Those, however, would not appear as a mining pool.

Are big miners a threat for Bitcoin?


How is RF Power at Receive Antenna Output Terminals Calculated?

Question: Is the Friis equation sufficient to make this calculation?  Must other considerations also be evaluated?
Comment: Possible duplicate of [What does the Friis transmission equation represent and how is it derived?](https://ham.stackexchange.com/questions/1539/what-does-the-friis-transmission-equation-represent-and-how-is-it-derived)
Comment: The "opening post" really should be a question.
Comment: See Rev 2 above.
Comment: Is there anything of a technical nature pertaining to my posts on this topic that you wish to address?
Comment: "Friis" is a name, not an acronym.
Answer: Below is the output screen of a spreadsheet calculator using the Friis equation, displaying received r-f power based on transmit/receive system parameters when using a free space propagation path.  Numeric values in the yellow-shaded cells may be entered by the user.
The spreadsheet also automatically calculates and displays

the mid-path radius distance for clearance of the 0.6 Fresnel zone, as such Fresnel clearance provides the propagation loss of a free-space path
the r-f voltage present across a 50 Ω output termination of a loss-free matching network at the receive antenna output terminals.

This Excel-type spreadsheet is available at https://nofile.io/f/19jUxxDHCJE/Friis+Transmission+Equation+Speadsheet+(Fry).xls — free to download and free to use.

Next below is a graphic illustrating the effect on the e-field produced by insufficient clearance for the Fresnel zone with various heights above ground of the receive antenna, for the conditions shown there.

Next below to illustrate the significance of Fresnel zone clearance is the result of a Longley-Rice calculation for the path loss from FM broadcast station WIOG to a receive site in northern Livingston county, MI.
For those coordinates and antenna heights AGL and the frequency, the terrain profile plus earth curvature along the path shows blockage of the 0.6 Fresnel zone radius starting at about the mid-point of the path.
If the path geometry exactly allowed clearance of the 0.6 Fresnel zone for its entire length then the received field intensity would exactly equal that of a free-space, unobstructed path, and as based on the Friis equation.
In this example the 0.6 Fresnel zone obstruction contributes about 8.9 dB of additional loss to that LOS path.


DNS config for server host and cloudflare

Question: Ok so I have my registrar, webhost and cloudflare, now my domain currently points to my host and I want to add cloudflare, and none of this is making sense because my host says they don't support cloudflare usage on their plans so they can't help me and my registrar says to point my domain to cloudflare and from cloudflare to my host. Does this make any sense to anyone??
Comment: No, it doesn't make any sense to me that companies are selling services but abandoning the user and forgetting that all this is still about computer science. Too many people rely on point-and-click availability of everything without understand the why and how. I do understand that the cost of hiring a computer science-type is expensive, and these service companies can't find enough of them themselves (and too many are the same point-and-clickers mentioned earlier) but often the reality: non-professionals/amateurs trying to piece together all this together without understanding most of it.
Comment: Note that I am not casting aspersions on you or anyone else. Sometimes, [a baby's gotta do what a baby's gotta do.](https://www.youtube.com/watch?v=s71o6U7X3uI) ... :)
Answer: If your webhost is unwilling to help you, since you pay them for a service, you should definitively go somewhere else.
In summary you would need at your registrar to specify cloudflare nameservers after setting things up with them, and provide Cloudflare details about your webhosting.
This may be tricky, especially if you already have some live services. So you should definitively work with a webhosting company that is willing to help you set things the way you want them to be.


Is there any French equivalent for the English "thou"?

Question: I mean, in the same epoch that thou was most used in English. Like a contemporary equivalent, that is.
Answer: Yes, the equivalent is tu. A few centuries ago, English had the same distinction as French: thou when addressing people at a certain level of familiarity, you in a formal or upper-class setting. In English, you became completely generalized and displaced thou (except when talking to God). In French, the normal singular form remains in use. In some dialects (essentially, in France and in Switzerland), the syntactic plural vous may be used with a singular meaning, when speaking to a single person in formal situations. The limit between tutoiement (when to use tu) and vouvoiement (when to use vous) can be very difficult to grasp, it is a major difficulty for non-natives and is even occasionally awkward for natives.
Comment: @Sebas There are plenty of social differences and ambiguous situations. Do you say *tu* or *vous* to your neighbor? (Depends: *vous* in most of France, but *tu* in many *banlieues*.) To a colleague? (I think *tu* is more common but it depends heavily on the industry.) To a complete stranger? (Usually *vous* but often *tu* among younger people and online.) Does it depend on the circumstances? (Yes, e.g. it's always *vous* in the army if the two persons are of different ranks.) Every native has had awkward occasions where one person picked *tu* and the other picked *vous*.
Comment: @Sebas This isn't the place for this discussion, so this will be my last comment. Your summary is completely bogus. I respect plenty of people that I address as *tu*; it's not at all a matter of respect. Formality, yes, but the rules are intricate. There are plenty of contexts where one would say *tu* immediately (e.g. it's pretty common that the CEO of a company says *vous* to a *stagiaire* but *tu* to the newly-hired janitor.)
Comment: In Belgium, too.
Comment: What's so hard to catch about the `vouvoiement`? Formal, respectful and meeting an new person, use vous. Otherwise, tu.
Comment: I think your questions can be summarised as I mention before: Repect, new acquaintance, formal, use `vous`. Otherwise, `tu`. Regarding to the *banlieues*, this is not a place where any correct french rule applies **anyway**.
Answer: When thou was used as a colloquial singular second person
It was then used almost exactly as tu was at the same time in France, so you just have to map thou to tu and you to vous.
When thou is used as an overly formal archaism
I tend to follow the convention used by the translators of David Eddings' Belgariad: to add French-like tutoiement and vouvoiement with respect to the familiarity between the characters, and to use pronouns with a capital first letter for thou, thee, thine…:

Mets toute Ta force d'âme à supporter Ton mal, ô aimable jouvenceau, l'exhorta jovialement Mandorallen […]
La reine des sortilèges, translation by Dominique Haas

It was perhaps inspired from the classical pronouns referring to God in some French bibles or other religion-related work Il, Tu, Son… which translate to thou and such in King James' Bible.
Answer: If you're looking to convey the same archaic meaning as "thou" with a personal pronoun in French, there is no equivalent.
Of course, the direct translation of "thou" is "tu" and although it does completely translate the meaning of "thou", it does not have any of the archaic connotations.
Comment: Thank you for your comment. 'Twould be interesting to see how the Shakespearean play between _thou_ and _you_, often in the same line, is rendered in French without losing too much of the original quibble interplay.
Comment: I'm not entirely familier with Shakespeare but I assume, "thou" would be translated as "tu" and "you" would be translated as "vous"... "You" in some cases may be translated as "On", but this would be less likely as the equivalent of "on" ("one") was widely used in Shakespearian English (I think)


What kind of lawyer should I speak with about getting out of a lease on the basis of breach of contract?

Question: The apartment complex I'm renting from are shirking their obligations to me by blaming the issues on me.  Can I get out of these lease without paying the fee for early lease breaking?
Comment: Adding a jurisdiction to this question and being specific about the things that the landlord isn't doing will increase the chances that you'll get a good answer.
Answer: You want a lawyer who accepts tenant-side landlord tenant cases, usually a solo practitioner or small law firm or legal clinic. Medium to large sized law firms usually don't practice that kind of law at all, or only represent landlords, as a matter of policy.
The usual problem, however, is that lawyers are often too expensive relative to the amount in controversy to make sense to hire to fully represent you in a matter like this one. You might want to have a "limited engagement" such as a one time consult with a lawyer, rather than a full retention of a lawyer, over an issue like this one.
Answer: Your question contains no details as to jurisdiction, the nature of the "obligations" the complex is "shirking", what arguments the complex has that you are responsible, or what argument and evidence you have to support your claim. Most jurisdictions do impose minimal habitability requirements on residential leases. You would have to consult local laws to see what they are and determine whether your complex is failing to satisfy them. If they are, you can file a claim of constructive eviction. However, if the complex disputes your claim, you may have to defend your claim in court, which will likely involve legal expenses, and you will have to provide evidence. So you should be documenting whatever it is you think the complex is doing wrong.


ElGamal in a different group

Question: Can Elgamal be secure in $\bmod {n^2}$? Meaning instead of using a prime order group to use a group where DCR assumption holds?
Comment: With "DCR",  do you mean "Decisional composite residuosity assumption" form Paillier?. Then I would suggest it has nothing to do with ElGamal, because it relates a modulus $n^2$ to the _same_ exponent $n$.
Answer: There are a number of multiplicative subgroups in the ring of divisor classes modulo $n^2$. One particular subgroup (with easy logarithm) is generated by $(n+1)$. You would not want to use it for ElGamal. Other subgroup (of large enough order) are fine.
Answer: I don't know if anyone has looked at this question specifically. However, Diffie-Hellman modulo a composite $n=pq$ is actually as hard as factoring. See this paper by Biham, Boneh, and Reingold. It is worth seeing if a similar reduction can be proven for DCR.
Comment: Yehuda the link you provided does not work. Can you tell me the title? Thanks
Comment: I fixed the link. The title is: Breaking Generalized Diffie-Hellman Modulo a Composite is no Easier than Factoring. Regarding DCR and factoring, factoring is at least as hard as DCR (if factoring is easy then DCR certainly is; the opposite direction is not known). My suggestion is to try to prove that DDH is hard mod $n^2$ if DCR is hard. I don't know if it's true, but it's an interesting question.
Comment: So the general framework towards this would be to construct a PPT A to break DCR by using a PPT B who breaks DDH
Comment: Also with respect to DCR and factoring i was meaning what you wrote. My semantics were wrong  though. Wrong vocabulary to describe a common technical agreement. You need to know the right words to communicate your ideas, but not when you work alone on them :)
Comment: From "Extended-DDH and Lossy Trapdoor Functions": "This series of works generalizing DDH-based constructions suggests the heuristic
that "anything that can be done with DDH can be done with DCR or QR."
Like any heuristic it is not completely accurate, but it appears to provide the
right intuition"
Comment: Also something similar is proven in lemma 1 here http://eprint.iacr.org/2014/256.pdf

ElGamal in a different group


What to do with paper savings bonds?

Question: My kids get paper savings bonds from family members for holidays/birthdays/etc. Right now I do nothing with them besides putting them in a fire proof lock box but that can't be the best thing to do. What should I do with paper savings bonds?
Comment: Side note - read the rules on cashing in those EE bonds. I remember I couldn't cash in a majority of mine to pay for college but instead needed to do a regular sell. There's all kinds of rules regarding whose names can be on them, how long held, etc. I just cashed most of mine when I was po'.
Answer: The US Treasury has a way of converting paper bonds to electronic bonds: http://www.treasurydirect.gov/indiv/research/indepth/smartexchangeinfo.htm

SmartExchange allows TreasuryDirect account owners to convert their Series E, EE and I Bonds to electronic securities in a special Conversion Linked Account within their online account. With a TreasuryDirect account, you enjoy all the benefits of having online 24-hour access to manage your holdings, without having to keep track of paper securities.

What to do with paper savings bonds?


Specific items in a group social contract?

Question: Some gaming groups actually do a formal social contract, wherein they explicitly set some of the expectations and rules for the gaming group.  What items should a group considering doing a social contract of their own think about including?
Comment: @TrangOul Edits that are *only* about changing a personal preference in orthographic style aren't a good use of the edit feature. Please reserve editing for improvements in clarity and fixing content problems, rather than for changing one perfectly-fine style choice for another perfectly-fine style choice. Regarding titles specifically: I *personally* believe that sentence case is easier to read, but it's only appropriate to change as a minor extra while making much more substantial changes. Thanks!
Answer: The value of a formal contract is recording agreements among all participants to ensure everyone understands what is expected. Obviously, a long written contract will make most players' eyes glaze over and kill the fun. Maybe just have a discussion about some things. If you have a widely fluctuating set of players coming and going, a written contract can help new players assimilate quickly.
A formal social contract covers all details of play. Specifically, it is an agreement to play a certain game, at a certain time and place, with certain people, in a certain way. In other words: what, when, where, who, why, and how.
What

What game are we playing?
What version of the rules?
What house rules?
Can house rules be introduced later? By what process?

When

What is the game schedule? Weekly? Every other week? Monthly? Irregular?
What are the exceptions to the schedule?
What is considered "quorum" for a game? (Under what circumstances will you cancel a game?)
What is the process for formally cancelling a game?
How should players notify people if they cannot play? if they can play?
What is the process for formally inserting an additional game outside of the normal schedule?
How long do we play (per session)? Will that change often (extended games), or do we need to stop at a certain time?
How long of commitment are you expecting? One game? Three games? A year? Forever?
Is it cool to miss games? How often?

Where

Where is the game hosted?
Are hosting duties shared?
What is the address of the place where we play? Got directions?
Where do we park?
What are the special rules of the house? (take off your shoes, don't let the cat out, etc.)
What should people bring? (food, dice, books, miniatures, etc.)
Will we eat during the game? Who brings the food? How is paying for delivery food handled?

Who

Who is invited to play?
Who is excluded from play?
What is the process for inviting new members?
What is the process for bringing a friend or significant other to a game?
Are children or spectators or pets permitted as tag-alongs?
What is the process for correcting poor player behavior?
What is the process for expelling someone you don't like?

Why

What is the point of play for this group?
What is the general mood of play? (fun, serious, dark, etc.)
What is the general theme of play? are there any special tropes?
Is it okay for players (including the GM) to be competitive with each other? (up to killing each other's characters?)
Are there any limits about game content ("lines and veils")?

How

How do players create characters?
How do players advance characters?
What level of playing "in role" is expected of all players? What is too little? Too much?
What is the expectation around character death? Under what circumstances can it happen or not happen?
If a character dies, how does the player replace it?
How do players integrate characters into the setting?
How do players integrate characters into the game's situation or existing character group?
What kind of play behavior is considered annoying?

Also take a look at Chris Chinn's Same Page Tool.
Answer: While I won't speak on whether doing so is a good idea or not... some items I would suggest including... in no particular order:

Punctuality - What to do when a player is habitually late.
Attendance - What to do when a player misses a number of sessions.
Food - May wish to include a policy on eating while playing or at least establish group feelings on doing so.
Grievances - Establish an order on both who and when to talk to when someone else is getting on someone else's nerves.
Materials - Determine who is responsible for having what ready when you get together to play.
Behavior - Ground rules to define what type of behavior is unacceptable. (Everyone should be involved with this.)
Comment: Addedum to 6: Personal hygiene, a notable factor.
Comment: @ExTSR: Also, attentiveness and distractions. I think there will be a lot of sub-sections of "Behavior."
Comment: Phones. Roll damage for texting while playing. Definitely a behaviour thing.
Answer: Make sure to set lines and veils, as the story gaming crowd often calls it.  Everyone, including the DM, should set these--lines are things that no one can do in the game.  Some people may be very uncomfortable with the idea of rape, while others can incorporate it into a game and use it to advance an intense story.  Veils, on the other hand, are things you don't need to go into deep detail on.  It may be fine to do a torture scene in your game, but players agree that they don't need to go into excruciating detail on what happens--that just casually mentioning it, letting it hide mostly behind that veil, is the best idea.
It's not the only component, but it helps ensure that you've talked over some of the important issues that might come up in the game, and makes it less likely that you'll step on other players' toes.
Comment: To be noted that line and veils, when they were first introduced, were meant to come up during play (and nobody would expect you to have a comprehensive list of things you don't wanna, only to later play "this wasn't in the list so it must be ok")
Answer: In addition to Wolf's fine list we almost always include an agreement on Verisimilitude and expectations of genre, mood and theme. This borders on other material but we've found, especially in more hard to grasp concept games that laying out some group expectations and having a dialogue goes a long way to making sure there are no hard feelings or disagreements down the line. Just by having the conversation and documenting it it can help when issues come up that some at the table feel are not true to the shared world.
Answer:
I honestly do wonder, without wishing
  to be morbid, how I reached this
  present pass. So far as I can remember
  of my youth, I chose the secret road
  because it seemed to lead straightest
  and furthest towards my country's
  goal. The enemy in those days was
  someone we could point at and read
  about in the papers. Today all I know
  is that I have learnt to interpret the
  whole of life in terms of conspiracy.
  There is a sword I have lived by and
  as I look round me now, I see it is
  the sword I shall die by as well.
  These people terrify me but I am one
  of them. If they stab me at the back
  then at least it is the judgment of my
  peers." -- John Le Carré', The
  Honourable Schoolboy (1977)

Logistics
We play every week, at Jeremiah's house.
Dispute
All difficulties are solved via consensus
The Campaign
Genre
In the tradition of the contemporary realist school of spy novels, especially John le Carré's work, with special attention to the Karla trilogy and more recent novels like Absolute Friends. Depending on player direction the game may draw inspiration from Tim Power's Declare. The game will start with 1970s Cold War, move forward through the 80s, the end of the Cold War 90s and the modern day.
Style
The spy as detective and scholar meet the politics of espionage.
Through the course of this game one of the goals will be to develop a coherent and richly symbolic world to carry a major part of the thematic burden, while not overshadowing action and character.
For example, John Le Carre in his Cold War era novels depicts a Britain of moribund tendencies which are powerfully expressed through images of darkness, decrepitude, emptiness and coldness. His description reveals the rest of Western Europe to be in much the same condition, although at times a cold, efficient sterility has replaced decay. In both cases descriptive passages are replete with a sense of loss or absence that points to the superiority of the past. Satisfactory alternatives to a Western Europe "grown old and cold and weary" are not easily found. American landscapes appear to be bright and spacious but are in reality meretricious, vulgar and militarist; Eastern European communist landscapes are even colder and darker than those of Western Europe and fail to make the faintest gesture towards something new.
Le Carre does this through the careful repetition of certain set characteristics.
One of the intents in roleplaying over four decades is to attempt to give a temporal as well as spatial dimension to the campaign.
Mode
In the vein of espionage fiction, with its roots in novels by Joseph Conrad and Graham Greene, takes the spy -- an assumer of false identities and a trader in information, compelled by circumstances to betray his own values -- as an exemplar of the modern man or woman: just like us, only more so. As the world of espionage is one forever caught in a world of appearances and dense, undiscerned realities, an espionage game and the wainscot will have much in common; expect this relationship to be explored. Memory, personal and institutional, will play a key role in this game and will be reflected in the eventual mechanics.
Theme
A spy is above all a man of politics . . . He must have the breadth of thought of a strategist, and meticulous powers of observation. Espionage is a continuous and demanding labor which never ceases. – John Le Carré, "To Russia, with Greetings" (1966)
Professional spies are mysterious, unpredictable, omnipotent, admirable yet criminal. Are they honorable patriots who compromise themselves for a just cause? Or are they liars, thieves, "a procession of vain fools, traitors" who play on the weaknesses of others to gain information?
Emphasis will be placed on the institution, and the individuals place in relationship to it.
While John le Carré's plots are famous for their labyrinthine convolutions, they are perhaps not so well known for an even more striking trait.  The master key to all of his spy novels is a question which doubles as a vital clue to their realism:  "What has to happen before something happens?"  Le Carré's answer is historical research, a resort to the archives.  It is also what he means by secret intelligence.
By starting in the seventies and moving forward to the modern day one of the goals of this game will be view the cold war as passing into history. To approach the common memory of it--and, more to the point, how individuals have have been marked by it.
Tinker, Tailor, Soldier, Spy opens ironically with "the truth is," whereas the novel contradicts this certainty by concluding that it was "after all, a dream." The novel turns on the divergence of dream, folklore, and prosaic fact. Despite their contingency, dreams and myths (illusions) are essential, but without awareness of their social construction they can be dangerous. Smiley's disillusionment leads to painful self-awareness. The first half of the game could very easily shadow this pathway to self-awareness.
Design Parameters
Scale
This game shall be played in the realm of geopolitics. The structural road map of game will be drawn by geography. The locus of action will be constantly changing, stretched out to represent the entire globe.
Scope:
At the beginning the characters will be agents operating under others orders. One aspect of this game will be a progression up through the labyrinth of intelligence, advancing in the career while balancing one's humanity.
Austerity:
This campaign is fairly severe as the characters will operate in the midst of an intelligence service. More importantly this game shall play up the moral and psychological, and yes the spiritual, consequences of the work the characters undertake.
Boundaries:
Intelligence has a global mission and this campaign will reflect that.
Veils: Sexual content and violence are behind the veil. They happen, they will be involve in plots, we don't describe them in detail. We respect people's requests to stop.
For another game we included language like this:

This game functions in an atmosphere
  of complete openness. That is, there
  should be no time that players aren't
  allowed to see "behind" the scenes of
  other players scenes. This means that
  they can always appreciate the context
  of all the character's predicaments.
  This avoids those moments where
  something special happens, but only
  the player who has the character
  realizes it.
Comment: This was the one I found first on my thumbdrive.


What liqueurs can be paired with a particular movie?

Question: I enjoy watching movies with friends as a group and was hoping that some of you could possibly come up with a recommendation and pairing of a liqueur or two with a particular movie?
Answer: Most Hollywood blockbusters are well paired with beer. For example boxing scenes from Rocky fit Budweiser.
Hollywood classic may differ. In my opinion, Gone With The Wind requires Bourbon, and My Fair Lady is all about Campaign. Forrest Gump should fit Dr. Pepper but you can improve the drink with Bourbon or Whiskey. And of course Zorro must go with Tequila. Jesus Christ Superstar best fit to red wine and dry bread as a snack ("This is my blood and this is my body. Remember this every time you eat and drink.")
Some movies do not match a single drink. For example, National Lampoon European Vacation require Scotch for British episode, cheap red wine for French, Bavarian beer for German, and Cinzano for Italian.
And never forget pickle juice for the next morning. ;)
Answer: I am going to make the following recommendation for the "Harry Potter" series.
Mandrágora Liqueur from the Basque region of Spain.

This liqueur from Navarra (in Spain) contains mandrake extract – a plant whose medicinal properties are the subject of many myths and legends.  Alkaloid, an active component contained in the plant, can supposedly initiate hallucinatory experiences.
The legend goes that a mandrake elixir was consumed by witches who were learning how to fly.  Mandrake is also a key ingredient in many of the magical elixirs present in the famous "Harry Potter" series.
In Harry Potter, as well as in other more traditional myths, mandrake root is portrayed with human characteristics since the root itself is said to resemble a human body.

Liquor Mandrake "Mandrágora"


Bass Guitar rasgueado?

Question: How does Victor Wooten do that super-fast tremolo plucking? It looks like his fingers are always curled and right on top of the strings. Is he slapping with 3 or 4 fingers rapidly or is he plucking with fingertips?
Comment: Probably both. And thumb up and down. And fretting hand tremolo. Incredible. Proves what happens when you practise...
Answer: Victor Wooten thumb slaps and plucks lower strings on down and up strokes, as you would expect, but he uses a range of techniques with his fingers:

plucking
rasgueado
slapping

A lot of his technique is aimed at rapid and precise percussive impacts.
It's worth watching the 4 YouTube videos he did on technique, but he has a wide range of training materials if you are really interested.
Comment: +1 for the video link, which nicely answers the question! Don't think there's any technique or idea that he DOESN'T use!
Comment: I reckon he uses thumb on each and every string on occasion.
Answer: Alright, after watching the videos carefully, I think the specific trick I was after is basically the same as a classical guitar tremolo, like in Recuerdos de la Alahambra, ie. p-a-m-i, but all on one string (the high G). And, of course, it's a lot fleshier than on the guitar. All apoyando, no nail.
So basically, you pinch the string with all three fingers and the thumb, and snap each one off, quickly in sequence. Or you could slap the thumb.

Bass Guitar rasgueado?


fsck and disk integrity checks for Linux systems that are rarely rebooted

Question: Like most Linux systems, my systems rarely need to be rebooted ( if ever).  How do you handle disk integrity checks and filesystem maintenance if you don't reboot?  Do you schedule periodic reboots for fsck to run?  EXT4 CentOS 6.3
Answer: I personally schedule reboots at least 4 times a year to apply kernel security updates. Why 4 times a year, you ask? Because my company has production maintenance windows 4 times a year. Dev and test systems get updated a bit more frequently, and the last dev/test cycle before the quarterly maintenance gets a kernel update and reboot.
Answer: Most of the companies that I have worked for see Linux/UNIX systems as an "always up" resource.  Thus they are hesitant to allow any reboot that might in any way cause any UNavailability for the user community.
Thus the only time that I usually get to do validate a filesystem is when the system crashes and it basically is an automatic process.
Interestingly, most companies I see out there pursue basically immediate Windows patching, yet  do not see the need on the Linux/UNIX side.  Their concern is that the upgrades and patching breaks things too much that the user community relies on.  Yet, in many cases, Windows patches cause significant problems. Thus a problem in perception here between the two OSen.
I have tried, generally w/o success, to get a known one day a month where Linux maintenance could be performed.  Users/management still bulk even if this is downgraded to once every three months.
Answer: Filesystem, by nature, is quite stable. And in distros like rhel/centos, the e4fs-progs package which comes, have been valiantly tested by lots of other users when they were in vanilla kernel. Therefore, it comes with implied stability.
I have never seen filesystem integrity problems if you don't have a storage problem or underlying disk problem. That doesn't mean that fs is immune to panic or problem, but core fs panics/problems, are much lesser than other subsystems. Eric Sandeen recently wrote a blog post about the no of patches committed in various subsystems over a merge window or a year but the link is not opening now. I will post it when it is online.
Comment: I've seen a lot of ext3 problems when coupled with old kernels. It's caused a lot of unnecessary downtime in some environments. But more updates are the fix for that.
Answer: The linux world suffers far too much from macho attitudes to time between reboots. Most systems can and should be rebooted far more often than is absolutely necessary. Reboots aren't a bad thing. Reboots that you don't know will succeed... that's an entirely different story. Responsible administrators will schedule a trial reboot after various kinds of upgrade. This isn't failure, it's professionalism. So yes - you should schedule reboots.


Get Information About Cylinders, Heads and SPT From CD Image

Question: I want to boot a CD-ROM image at Bochs, but I need it's cylinders, heads and the Sectors per track. But how I can get this values from the disk image(*.ISO)?
I'm on Windows, but I have Cygwin installed
Answer: Since it's a CD the number of physical heads is 1 (one), cylinders is 1 (one) and tracks is 1 (one).  I'm assuming you need to lie to some software god to make something work.  Since a sector has 256 bytes, just get the number of sectors by dividing the size of the CD.iso by 256 and make up values for cylinders * heads * spt that equal that number.  It won't matter what you pick as long as the final value of the multiplication is equal to iso_size_in_bytes/256.
Caveat: I'm not a Bochs user (yet) but I'm assuming you want to create a virtual HD to load this iso onto and the Cyl/trk/spt info is going to be used to specify the virtual HD size.
Added: From your data I calculate 583440 sectors, which would give as one possible organization : 2431 cyl, 15 hds, 16 spt.   2431 * 15 * 16 * 256 is 149360640 which equals your iso size.
Comment: No, what I'm trying is a TinyXP disk image. But English isn't my mother language, then it's very difficult to understand you. Could you be more specific? The size of the image is **149.360.640 bytes**.
Answer: As far as I know, you only need the CHS (cylinders/heads/sectors) counts for disk images. Just be sure to change Type of ATA device from disk to cdrom.


Composing longer pieces

Question: I am actually a published composer, a couple of small things for brass (not "self"-published.) A few more that have been played locally and elsewhere and gotten good reviews. And one that has been played by a local well known concert band (a march.) I am a classical musician, and that is the genre I write in.
But here's the rub: I know I have good material, but I haven't a clue how to "lengthen" a piece. I tend to write little ditties that last a minute or a few, and despite a degree in music and having taken a couple of college courses in composition (useless; it was "bring in what you wrote so we can comment on it") there is a piece of the puzzle I'm missing. I don't want to write a symphony but I'd like to be able to take themes I know are good, and incorporate them into a piece longer than three minutes. The only thing I can think of to date is to take a piece I like, and literally copy the composer's structure using my own material, but it feels like plagiarism to do that. I am proud of the things I have in print, but the march in particular was an exercise to see if I could write a march, and it is, in my mind, "very" mediocre and was put in concert band form because the brass quintet version sounded pretty good and the band director asked me to arrange it for band. I want to be able to take things I'm proud of and make them longer.
Comment: Copying someone else's structure with your own content is absolutely not plagiarism. How do you think the sonata form, the rondo form, or the fuge were invented? By people imitating other people's structures, of course. After centuries of Western music tradition, you're almost certainly not going to find an innovative macrostructure for a middle-sized piece anyway.
Answer: First take encouragement in the fact that many movements clock in at under three minutes. Look at early classical pieces or baroque string concertos for examples.
Using a great composer's structure as a guide seems legitimate. It was recommended by Czerny through a quote attributed to Haydn.
But I think the basic answer is to gain an understanding of the various forms and the typical duration you get with them.
A sixteen bar minuet with repeats gives you maybe a minute, minute and one half. Extend that simple dance form to 'da capo' or ternary form and you can get something around 2 and a half minutes.
6 variations on a 30 second theme, there you have 3 minutes.
Take a sixteen bar dance form, insert a few extra bars of themes grouped into tonic/dominant areas, write a recapitulation after the double bar repeat and you have a sonatina. That will give you a longer duration.
The point here is various forms suggest different sizes. Maybe study up on the larger forms like sonata or ternary. One book I suggest is "Classical Form" by Caplin. http://a.co/5XScBSI. It takes the reader through various forms starting with small forms and gradually building up to larger forms. Also, "Fundamental of Musical Composition" by Schoenberg may be helpful. http://a.co/4mUWnSc.
Answer: Making things longer usually means variations and inversions of a theme, structures, progressions, etc.  This is where compositional theory can really help you.  Try taking what you have written and then weaving it into an inversion that follows.  Or a counterpoint.  Or a key change or diatonic shift.  These are all devices that composers use to vary their material.
Beethoven's Fifth is really just 4 notes when you boil it down to essence.  But listen to how he took those 4 notes and expanded them throughout the instrumentation and variations in the first movement.
Answer: Four suggestions:
You could always create a suite. You've already done most of the hard work.
If your themes are strong, repeat and reharmonise them.
Sonata form is a wonderful structure: it is a principle, a lattice and even a set of instructions. You could do worse than giving it a go.
Since servants went out of fashion we've become more time-poor.People don't seem to go in for powdered wigs,big shoe buckles, petting spaniels and 'off with his head' if a piece is under 20 minutes long. I wouldn't be in too much of a rush to crank out epics just for the sake of it.
Answer: Copying structure from existing works is an EXCELLENT idea!
With brass groups and concert bands you're working for an audience that appreciates a 'good tune' rather than cleverly developed themes.   Nothing wrong with that.  My definition of Purgatory might include listening to 'art music' performed by a community concert band (and if it was one of the crack military ensembles it wouldn't be a lot better)!
Maybe not a good idea to go further 'out' than the Holst or Vaughan Williams suites.  If you're American and don't know these, listen, enjoy and learn!
Comment: Thanks for the feedback. I was at one point planning to write a chaconne based on the structure of Holst's in Eb, but figured it would be SO obvious what I did that I'd be laughed out of the room or accused of having no talent except to copy. Any conductor would figure it out right away, and most of the musicians too. That is where I kind of came to a halt. Lack of motivation is a big factor, and it will take a fire built under me to undertake such a project at this point in time. Meanwhile I'll keep reading other people's  posts and commentary.

Composing longer pieces


Should you intentionally take long to fold after somebody raises to hide your bluff?

Question: If you are playing a hand and you've been largely bluffing through it, and somebody (re)raises all-in, should you fold immediately, or should you pretend to think about it in order to hide the fact that you were bluffing?
Answer: In order to not give any hint/tell, it's worth using always the same routine, no matter which cards you played, which moves (right or wrong) you made, how good or bad you played the hand : always do the same things. They'll have to figure out if you were actually bluffing or sorting out a tough decision.
For pretty much standard hands not requiring extra thinking, and even if you think/already know that you should fold/call/raise, and no matter what your final move will be :

look (or don't) at your cards (*)
take the same 5 to 10 seconds to think about it.
make your move.

(*) it's all about image, so it depends on whether you want the other folks at the table think you were bluffing or not. You can have a very decent hand, then believe you're behind, but played smart and make a good fold, but still, you want to mislead them, and have them think you were caught bluffing. It'll help later, never know...
Answer: As said, it is not considered bad etiquette to do so, so it is acceptable.
However, if you observe top players playing on TV they almost never do it. They usually fold instantly, giving their opponent the credit for the good guess, which is kinda nice if you think of it.
Ex. Dwan vs Ivey preflop bluffs
It has nothing to do with balancing your game/image, as in both cases the result is the same (i.e. you fold), so your tendencies and betting patterns are not affected. After a while, even a rookie player will notice that you do it (no one can tank fold all of his hands because he never bluffs and "always has sth"). So basically, it is up to your manners and respect, just that.
Answer: It is not wrong to tank before you fold after a bluff. This is completely understandable and is not bad etiquette.
It is up to you if you want to do it though, considering your image.
Answer: A reach but it can give away live tells.
Raiser can think about they did different when you snap fold versus think about it.
Table can think about what you did different when you snap fold versus think about it.
It indicates you did not have at least a bluff catcher.
My advice is look at your hand and pretend you had second pair and you decided it was not good.  Always look at your hole cards as some times you will want to look at your hole cards.
Hoyt Corkins used to tank to punish you for looking him up and he rarely got the clock called on him.


How does the computer determine whether a number is smaller or greater than another?

Question: It might sound like a stupid question but I'm really curious to know how a computer knows that $1<2$? Also, how does a computer know that the order of integer is $1,2,3,4,5,\ldots$ and alphabet is A,B,C,D,...? Is it somewhere stored in the hardware or does the operating system provide this kind of information?
Comment: In order that this question may be answered satisfactory, we would have to know how much Ricky Stam knows about computer architecture. From the question it looks like very little, so none of the fancy answers below will be comprehensible to him.
Comment: @AndrejBauer: Actually, he hasn't logged on since asking the question. Maybe he now knows all he needs to.
Comment: @AndrejBauer Hehe I hope so! To be encouraging to those who answered, I want to point  out that whether Ricky Stam ever saw this answer or not isn't too important! The goal of Stack Exchange is to create a repository for humanity containing quality questions and quality answers! Even more purely, it's a place where we can ponder quality questions and provide answers. That we've participated is enough! That others have seen the discussion is even better. (:
Answer: First your integer numbers are converted into binary numbers. For example, the integer 2 is converted to 0010.
The CPU uses a digital comparator:

A digital comparator or magnitude comparator is a hardware electronic
  device that takes two numbers as input in binary form and determines
  whether one number is greater than or less than or equal to the other
  number.
Comparators are used in central processing units (CPU) and microcontrollers.
Source: https://en.wikipedia.org/wiki/Digital_comparator

In comparator hardware some gates are used (AND, OR, NAND, NOR, XOR, etc). These gates take binary inputs and give result in binary. The output can be seen from a truth table.
Inputs           Outputs
A   B     A>B    A=B    A<B
0   0     0       1      0
0   1     0       0      1
1   0     1       0      0
1   1     0       1      0

Here 0 & 1 are  electronic voltages for the gate.
1 - Represents some threshold voltage which indicates some positive voltage. 0 - Represents the voltage below than the threshold.
E.g. suppose a comparator works on 5 volt (it is consideration for explanation) then:
Voltage more than 3 volt can be considered as binary-1.  Voltage below than 3 volt be considered as binary-0
If a gate gets one input as 3.5 volt and another input as 2 volt then it considers as, it takes one input as binary 1 & another input as binary 0.
These sequences of 1's & 0's are provided very fastly through the switching circuit.
The operation of a two bit digital comparator can be expressed as a truth table:
 Inputs                            Outputs
   A1   A0  B1  B0  A>B    A=B   A<B
    0   0   0   0    0      1     0
    0   0   0   1    1      0     0
    0   0   1   0    1      0     0
    0   0   1   1    1      0     0
    0   1   0   0    0      0     1
    0   1   0   1    0      1     0
    0   1   1   0    1      0     0
    0   1   1   1    1      0     0
    1   0   0   0    0      0     1
    1   0   0   1    0      0     1
    1   0   1   0    0      1     0
    1   0   1   1    1      0     0
    1   1   0   0    0      0     1
    1   1   0   1    0      0     1
    1   1   1   0    0      0     1
    1   1   1   1    0      1     0

To quote from Wikipedia:

Examples:
  Consider two 4-bit binary numbers A and B such that

  Here each subscript represents one of the digits in the numbers.
Equality
The binary numbers A and B will be equal if all the pairs of significant  digits of both numbers are equal, i.e.,
 .  .   .
Since the numbers are binary, the digits are either 0 or 1 and the boolean  function for equality of any two digits  and >  can be expressed as

  is 1 only if  and    are equal.
For the equality of A and B, all  variables (for i=0,1,2,3) must be 1.
  So the quality condition of A and B can be implemented using the AND operation as

  The binary variable (A=B) is 1 only if all pairs of digits of the two numbers are equal.
Inequality
In order to manually determine the greater of two binary numbers, we inspect the relative magnitudes of pairs of significant digits, starting from the most significant bit, gradually proceeding towards lower significant bits until an inequality is found. When an inequality is found, if the corresponding bit of A is 1 and that of B is 0 then we conclude that A>B.
  This sequential comparison can be expressed logically as:
Comment: Whoa, what's going on here?
Comment: "First your integer numbers are converted into binary numbers"... wrong, there is only binary numbers in the memory at the first place, its all 1's and 0's in the machine level, so there is not a "convertion" , 2 is represented as 10 from start to end..
Comment: When copying material from other sources, you must provide proper attribution for your sources.  See [here](https://cs.stackexchange.com/help/referencing) and [here](https://meta.stackexchange.com/questions/83955/plagiarism-should-be-addressed-specifically-in-the-faq/134715#134715).
Comment: The two bit digital comparator table is incorrect. http://www.ijesi.org/papers/Vol(2)1%20(version%202)/C211324.pdf
when A1, A0 are both zero but B0 and B1 are 0, 1 A>B will be 0, for example.
Answer: It doesn't just "know", it checks every time. Basically, it does the same thing you would do: in order to compare, it checks (from the left) which number has the first digit that is larger than the corresponding one in the other number. Of course you have to add leading zeroes to the shorter number.
Letters are just numbers for the computer. Humans have assigned numbers, e.g. ASCII or Unicode, to letters so that number comparisons give the "correct" order for letters, too.
Comment: Also, this is usually termed "[lexicographic order](http://en.wikipedia.org/wiki/Lexicographical_order)". We can usually think of it as first ordering by length (shortest to longest), then alphabetically.
Comment: @usul That reminds me that the particulars of comparing integers obviously depends on the particular encoding; what I describe works for "naive" binary numbers which may be far from what an actual CPU uses.
Comment: Yep, absolutely. I've been thinking about Turing Machines too much recently :). Real machines don't quite fit what we've said here all the time....
Answer: It's not the operating system that compares integers, the CPU is taking care of it.
It's made on logical gates level, please refer to these slides to see how it can be done.
About the alphabet, in ASCII alphanumeric and other special characters are represented as integers so comparing them is also an integer comparison operation, which is performed by the CPU.
Answer: Actually, and in order to obtain the full image of it, I think it would be quite helpful to see with your own eyes the datapath of an actual CPU, for example MIPS:

As you may see, there is actually a second output from the ALU, which is a signal called Zero. It exists in order to perform fast branch operations, after determining whether the two operands of the comparison are equal to zero or not, as most comparisons within a program are about branches. Therefore, when you create a branch possibility in your code like:
if(a < b) {...}
This is translated into machine code, in mips for example: blt s0,s1,If $~\Rightarrow$ if a < b execute the instructions in the brackets, else continue with the execution outside the if{}. Specifically this instruction is a pseudo-instruction, which means that is translated into two other (simple) MIPS instructions $~\Rightarrow$ slt at,s0,s1 and then bne at,zero,If (slt: Set Less Than & bne: Branch on Not Equal).
Notice that signal zero is one of the inputs of the AND gate that determines where the Program Counter (PC) will take its value from:
Assuming that Branch signal is '1', as we have a branch operation

Zero = 0 $\Rightarrow$ The result of the subtraction was not equal to zero, so the Multiplexer will choose the address from Branch target and the execution will continue from the instruction that the branch leads.
Zero = 1 $\Rightarrow$ The result was 0 (a = b) and so the MUX chooses the address from the adder where is calculated the address of the next instruction in normal execution (serial). No jump is executed as the condition (a < b) is invalid.

Hope I helped you see "under the bonnet". Feel free to ask for further analysis on this matter. Many things we take for granted, CPUs do them in a very fascinating way!
Comment: Ethan, how does "less" operation work on this datapath? As I understand, you described operation "not equal". What does "slt" instruction?
Answer: If you want to know about how an actual CPU does it, it's something like this.
A CPU operates on numbers of only up to a certain size. Nowadays that's usually 64-bit integers (we'll ignore floating-point numbers; the idea will be similar).
So we should recognize that

A CPU is storing numbers up to (say) 64 bits long in binary, in some format (probably 2s-complement but it doesn't matter too much what).
A CPU can't natively do anything with numbers bigger than that. We have to write software algorithms if we want to compare bigger numbers.

OK, so say we have two numbers that each fit in a normal-size 64-bit integer. Say $a$ and $b$. How does the processor compare them? Usually, it will subtract one from the other (that's a single native operation that is implemented in hardware).
Now the processor has stored a single number $a-b$. Again, this number is at most 64 bits, so it fits in a "register" that's 64 bits long, which is where we store our numbers for calculation. Now it just checks if $a-b$ is less than zero. It does this with a single native operation that could work, on the circuit level, like the comparison algorithms that the other answers have described. It will look a lot like those, but all implemented in circuits (because the number is at max 64 bits, this is a certain-size circuit that we can hardwire and stick on the CPU.) Depending on how the CPU stores numbers, it might be even faster because it might be that all negative numbers have the first bit set to one, or something like that. Either way, there's only 64 bits total, so we can definitely check if this number is negative.
If it is, then we know $a < b$; if not, then we know $a \geq b$.
Now, for bigger numbers, we have to implement something in software that will use these small comparisons as subroutines.
Answer: To answer this question let me first point out that there are at least two levels on abstraction for the comparison numbers on a computer, the machine-level, and the software level.
Comparing numbers on the machine level
In today's computer the CPU has a rich set of instruction. These instructions include for example loading a memory cell into a register, incrementing a register, adding two registers, and many many more. There have also to be instructions for conditional jumps. For example the processors in Intel's x86 family support the instructions jnz (jump if not zero), jne (jump not equal), and so on. If those would be missing then the CPU would not be Turing-complete. The variables from which the  conditional jump depends are stored in the registers. Thus, these instructions are hard-wired in the architecture of the CPU as a circuit build from logical gates. This is the only way how the CPU can compare two numbers.
Comparing numbers on the software level
If you compare two numbers, say in a c++ program, then this is translated into machine code and therefore carried out on the machine level. However, such an comparison can be more complex. It really depends on the data type you used how the comparison is translated into machine code. Just one example, the numbers you want to compare are from the 64 Bit words but your machine has only works with 32 bits. Then this number does not fit in a register, hence the compiler will break down the comparison into a sequence of comparisons on the machine code level. The same applies for more complicated data types/data structures, representing for example rational numbers, or strings, or characters. Hence when you have to compare two characters, this is to translated by software (operating system, compiler, interpreter,...) into machine code. The actual translation depends on the encoding of the character/number.
As a final remark I want to point out that standard CPUs can also work with different representations of numbers (signed integers in 1- or 2-complement representation, floats). Also comparisons might be carried out in other parts of the computer such as the GPU.
Answer: other answers are good, just throwing another one out there for further consideration/insight with a CS flavor/twist. one can construct an FSM, a finite state machine, that can compare two binary numbers of any length, starting pairwise from the most significant bits and working to least significant bit (LSB). it can also be used to conceptualize the digital comparator given in another answer, yet the FSM does not require finite length binary numbers. it can even work on integers with binary fractions after the LSB. it has an inductive and recursive flavor and can be proven correct by simple induction. it runs as follows:

input the top two binary digits as a pair (a,b)
if a=1 and b=0 the left number is larger.
if a=0 and b=1, the right number is larger.
otherwise the numbers are "equal up til now", advance to next pair.

in other words the largest number is the one with the first occurrence of a bit that is one and the other is zero, after an initial run of zero or more identical 1's. a finite-length digital comparator made of gates or 1-bit comparators can be seen as based on fixing the length of this FSM operation to some fixed number of bits. (yes there is a strong correspondence between all finite circuits and "fixing the length" of FSM computations.)
this may seem like a theoretical exercise but actually, the logic in software to represent arbitrary precision numbers operates something analogous to this FSM, except encoded in a computer loop that can be seen as looping over or simulating the steps of the FSM (an efficient implementation might track via an index the location of the MSB).

also, lets reasonably interpret/generalize this question as not limited to integers. the question refers to integers but the title only refers to numbers. surprisingly nobody else mentioned floating point arithmetic so far.
basically that works by comparing the exponent and the mantissa where a number is in the form $a \times 10^b$, $a$ the mantissa, b the exponent. the mantissa can be normalized to a number where the first digit is always nonzero. then to compare two numbers the logic first compares the exponents $b$, and if they are unequal, it can return a result without comparing the mantissas (using say the comparator circuit). if the exponents are equal, it compares the mantissas.


Extracting relationship status from Facebook in Python running on Google App Engine

Question: I'm working on a Facebook application. It's written in Python and running on Google App Engine (GAE).
I know how to get the relationship status of the users network, but the way I do it is running way to slow. There is a time limit on GAE in order to reduce CPU usage which is about 60 seconds. Using the following code I can get the relationship status of about 200 persons in that time frame, before getting the "DeadlineExceededError". Of course that is not good enough, since many/most people have a higher amount of friends on Facebook.
What I do now, is to get the friend list of the user, and then making an API call for each one asking for the name and relationship status.
The code I use:
for f in friends:
    friends_info[f] = facebook.api('/'+f, {u'fields': 'name,relationship_status',
    u'access_token': facebook.access_token})

And then I get the data with:
rel_status = friends_info[f][u'relationship_status']

What I need:
Suggestions for optimization or other ways to extract the relationship status of an entire network.
Thanks in advance :-)
EDIT :
The answers seems to be all good ways to solve my problem. Though, I couldn't find any good tutorials for batch request in Python, so I ended up using a FQL call. By using the following it takes 1-2 seconds to get the data:
Q = 'select uid, sex, relationship_status from user where uid in (select target_id from connection where source_id = me())'

And the actual data is retrieved by:
data = fql.query(Q,facebook.access_token)

which call this function:
def query(self,Q,access_token):
    ENDPOINT = 'https://api.facebook.com/method/'
    params = dict(query=Q, access_token=access_token, format='json')
    url = ENDPOINT + 'fql.query'
    return self._fetch(url, params=params)

def _fetch(self, url, params=None):
    conn = urllib2.urlopen(url, data=urlencode(params))
    try:
        return json.loads(conn.read())
    finally:
        conn.close()

Hope someone can make use of it as well!
Comment: In addition to the two answers below, you should run your code in a Task Queue task, which has a limit of 10 minutes, not 60 seconds.
Answer: Each app engine instance can have have max 10 parallel HTTP queries, so you could potentially make this 10 times faster with create_rpc & make_fetch_call. There are scenarios where this doesn't work either, so you need to split the job to several tasks and let them run in parallel.
Answer: You can use the facebook graph batch query API to query up to 20 users at once


Boolean Modifier not working with Solidify Modifier

Question: I am currently in the process of making a plane in blender. To cut out the windows I am using the Boolean modifier, and to add thickness to the windows I used the Solidify Modifier. I would first solidify the cylinder I am using as the body of the plane and then apply the Boolean. I ONLY apply the Boolean whilst my mesh is not shaded as smooth otherwise errors occur. When I have finished using the Boolean and shade the cylinder as smooth I get a problem where there are strange cut outs in the cylinder as shown in the picture. IF anybody could help it would be greatly appreciated.
Many thanks.
Comment: That is caused by bad normals splitting which is the consequence of the inproper topology - tiny long triangles or tiny long quads and / or Ngons composing that surface. The windows should be surrounded with one edge loop and avoid the kind of geometry with stretched faces.
Comment: Yeah, avoid booleans at all costs, they are a lazy way of modelling, and will only lead to problems down the road.
Comment: This may help http://topologyguides.com
Comment: How would I go about adding edge loops around the windows?
Answer: I would do two things to try and fix this. Firstly, you can try switching the order of which modifier is first.
Also, I'd try playing with the "offset" in the solidify modifier to see if that fixes it
Comment: Didnt seem to work just makes the same old shape and this time created a indent in the area around it.
Answer: This happened to me. It fixed its self up when I switched it from "Blender Internal Render" to "Cycles".
There was nothing wrong with the normals.
Answer: Switching Solidify Mode from Simple to Complex (with Thickness Mode: Fixed) did the trick to me.