Where can I download the latest 64-bit edition of Sonicwall SSL-VPN NetExtender for Windows 7?

Question: Does anyone know where to download the latest edition of the 64-bit version of SonicWall SSL-VPN NetExtender for Windows 7?
Comment: Do you have a mysonicwall.com login? The download should be available there.
Answer: As mentioned, WWW.mysonicwall.com has what you need.  Hit the downloads link, then the 'free downloads' tab.   The dropdown should then have an option for netextender.
Comment: It looks like this is no longer accurate.
Answer: You need to select your device in the dropdown in the download center. Then you should get a list of NetExtender versions. You will use the same version for 64-bit version of Windows 7 as 32-bit version btw.
Answer: As of August 27, 2015 it can not be downloaded from http://www.mysonicwall.com/  On the mysonicwall web site, the netextender has been replaced with Global VPN Client which does not have the same options and will not connect to the VPN server I need it to.
I was able to succesfully get installed, but, it was very complicated.
The method that netextender uses for installing is by hacking your computer through web browser, I know this sounds bizarre but, I was able to get it installed.
Chrome has been patched so this hack will not work, so you need to use a browswer were security is not important.  Obviously Internet Explorer is the best choice for this.
From Internet Explorer go to the gateway address provided by your adminstrators, log in using your vpn credentials, then you will be offered an option for netextender.
My Internet Explorer was from a fully updated Windows 7 fresh install.  This version of windows was ubable to install directly, but, there was an option for "all downloads" where I was able to download a normal installer and install the netextender just like it was not a peice of shit.
I hope that someone can re-write my installation instructions in a politially correct way.  I realize that calling sonicwall a piece of shit is not friendly, but, since I've been looking and looking for instructions and all of the politically corrrect folks have been unsucessful, you get when I offer.


How can I change the order of vertical tabs?

Question: More specifically, I am using Location in Drupal 7 to allow people to add location to nodes, but I want it to appear at the top of the vertical tabs fieldgroup.
Comment: I just implemented knight approach and uploaded it to github: https://github.com/rogercodina/customize_vt I think knight approach is much better solution than using Renderable Elements because this module says in its home page that is very experimental.
Comment: My module has evolved and is now on drupal.org: https://www.drupal.org/project/vertical_tabs_config
Answer: An alternative to user842's answer (for those who are interested in a more code-based solution) is to set the weights on all the form items whose group is "additional_settings". The idea here is, higher the weight, lower the tab will appear, where the default is the one with the lowest weight (or one whose weight is not set).
To do this without modifying core code, create a module with a very large weight (see weight module for a module-based, or this post for a DB-based approach). Specifying the weight is important so that the module can be executed later than other modules which may change the order of the tabs. In this module, implement hook_form_alter, or hook_node_form_alter, which exposes the $form array.
At this point, you can look at the $form array, and pick out the indices that correspond to the vertical tabs whose order you wish to edit. One way to look at the $form array is by printing it out (via drupal_set_message($form) in the hook_form_alter or hook_node_form_alter). This array is huge, so you may want to run some kind of browser search to find the items that you want.
The indices that correspond to items on the vertical tabs are items with #group set to additional_settings (so you can search for the string "additional_settings"). For example, you may see the following when you print out the $form array:

Array
(
   ...
   [path] => Array
        (
           ...
           [#group] => additional_settings
           [#weight] => 314159265359
           ...
        )
)

and this is showing that path which corresponds to the location tab in the vertical tabs has a large weight 314159265359, which might be the reason that it is showing last in the vertical tabs.
With this info, you can now change the order of this tab in your hook by decreasing the value of the weight:
// set a small weight for the path tab
$form['path']['#weight'] = -1;

in your hook. Notice that weights can also be negative. You can do this for some/every tab (by going through and changing their weights).
This unfortunately doesn't work for all situations. If the #weight of some vertical tab is unset, somehow, that tab will bubble to the top. You can fix that by giving the tab. The source-code might look something like
/**
   Implements hook_form_FORMID_alter, hook_node_form_alter.
   Changes the $form array to reorder vertical tabs.
*/
function reorder_vertical_tabs_node_form_alter(&$form, &$form_state, $form_id)
{
   // move 'location' to the top (as the default)
   $form['path']['#weight'] = -1;

   // move 'themekey' under 'locations'
   $form['themekey_ui_themes']['#weight'] = 0;

   // move 'published/unpublished' down
   $form['options']['#weight'] = 100;
}

From experience, I do not think you can change the order of the vertical tabs by setting $form['#after_build']. At that point, the order of the vertical tabs are already set.
Answer: The Renderable elements module enables you to will make (additional) elements (such as anything in the vertical tabs) available of existing entities on the manage forms/display screens so you can rearrange the fields through Field UI.
Comment: No Drupal 8 version. It's also a "very experimental"module, so I have reservations about using it on a production site.
Answer: You can simply use the Vertical Tabs Config module.

This module allows you to:

Hide vertical tabs on add/edit node pages depending on content type    and role.
Decide vertical tabs order.

Warning
You may need to clear drupal's and/or browsers cache if you don't see any changes after modifying vertical tabs order.
Comment: I tried vertical_tabs_config - even after clearing caches, the order doesn't change. And my custom tabs don't show up on the list.
Answer: Drupal 10 change order for form Configure block

/**
 * Implements hook_form_alter().
 * Set\change VerticalTabs order (Configure block /admin/structure/block/manage/...)
 */
function wt_plus_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
    switch($form_id){
    /*Set\change VerticalTabs order*/
        case 'block_form':
            $order = ['request_path', 'user_role', 'php'];
            foreach($order as $key => $value) if( isset($form['visibility'][$value]) ) $form['visibility'][$value]['#weight'] = -(100 - $key);
            break;
    }
}


Why can't I break blocks in Minecraft: Education edition?

Question: I've been playing Minecraft (Education edition) for a while and I'm not able to break blocks. I'm in creative mode and I am not holding a sword. I've left clicked so many times!
Answer: If this is a world that you are an operator on then just use the command /wb for yourself. If you want to unlock the world for everyone, use /immutableworld false. If there are deny blocks involved then the /immutableworld command won't work.
Answer: I assume you used it at school, your teacher probably placed deny blocks or you didn't had worldbuilder permission


Replicate a database with a subset of data offered by custom queries

Question: As seen in this question I can use the following sql command:
CREATE DATABASE newdb WITH TEMPLATE olddb;

In order to replicate a database into my machine. But in my case my new database only to contain a subset of the data used in the first database offered by custom queries.
Lets suppose that in my current db has an existing tables:
|- ohimesama:
|-- id PK SERIAL
|-- name VARCHAR(100)
|
|-oujisama:
|-- id PK SERIAL
|-- name VARCHAR(100)
|
|- ohimesama_oujisama_suki:
|-- ouji_id FK oujisama
|-- ohime_id FK ohimesama

And In my database I want to be able to keep only the records from the tables ohimesama and oujisama that maches the current queries:
SELECT * from ohimesama where id in (SELECT ohimesama_oujisama_suki JOIN oujisama where oujisama="WILLIAM");

SELECT * from oujisama where id in (SELECT ohimesama_oujisama_suki JOIN oujisama where ohimesama="MARRIE");

My database is rather large (~100GB) so truncating or deleting rows from the whole database is rather time consuming. Do you have any Idea how to solve that problem?
As you can quess both of the databases are in the same server. The reason why I want to do that is because I want to keep a subset of data for software development.

Follow up: I have issues setting up the JDBC driver. I get the following error:
No suitable driver for jdbc:postgresql://

...though I have installed the PostgreSQL JDBC driver via gnu/linux apt command and specified the correct directory.
Comment: In the end the issue regarding jdbc was because I did not specify correctly the database name even though I have specified the other connection parameters correctly.
Answer: I have been through the same problem recently and can comment on some attempts and my conclusions after a lot of research into it.
In my case I had to partition some data that would be distributed in different databases. But note that we are dealing with the same fundamental problem that is partial data migration.
The first problem is regarding data extraction, pg_dump does not provide any dynamic and consistent partial data extraction mechanism.
You can do a full backup and try to erase data you don't want to use, but as you have already realized, this is a costly task and demands a lot of runtime for large volumes of data. And depending on the complexity of your database structure, assembling the delete scripts can be quite difficult. What's more, if your bank is constantly evolving this method is not reusable if you want to extract partial data later.
You will find many suggestions from people saying to use the COPY feature, but all in all I can say that it is extremely limited to the complexity of this task. Because it would be necessary to assemble a data select from all tables consistently and then execute them in a single transaction. Again, since your bank is dynamic and constantly evolving, this method is not reusable either. Because you would have to rewrite all selects every time you were extracting partial data.
Usually the partial data migration comes from a specific table that will restrict the other data, we will name it as a restrictive table. That said we can consider some more possibilities.
Let's assume a case where your primary bank has a table called user (restrictive table) with 100 records and you want to migrate all your bank records that link to the first 10 records in that table.

We can only dump/restore the structure.
We can generate a sql with the data from the 10 user table records
we need and insert it into the database.
Then we can dump all data in simple sql disregarding the user table.
We can run this sql script without transaction block and let the key
constraint check do the dirty work.
As in the previous case, this can take a long execution time
depending on the volume of data, but this solution is functional and
replicable.

Note that your database cannot contain cyclic key problems (This is the condition to dump data only correctly).
Also note that the dependency level of your restrictive table must be the lowest minimum, otherwise an adaptation would have to be made to this methodology, which I will not write because the text is already getting too large.
That said, what really worked for me was using the Jailer tool. This tool is developed in java and using ORM it can map the key constraint set of your database and assemble a data extraction model as you configure it.
The output is a simple sql script with partial data consistent with the restrictive rules that have been set.
If you have any questions about its use I can help you understand and set up your configuration environment.
A similar question was asked in Stack Overflow.
Answer:
I have issues setting up the JDBC driver

Jailer already ships several database JDBC drivers (PostgreSQL, MySQL, MSSQL, etc.).
They are located in the "lib" subdirectory. So there is no need to update unless there is an issue.
The PostgreSQL JDBC driver shipped with the current Jailer version should be new enough to handle the task (it's this one: postgresql-42.2.0.jre7.jar).
After adding and naming your data model (jailerGUI --> "Database subsetting tool"), and click "Analyze Database" you get the "Connnect with Database" dialog, where you add a new connection string.
After hitting the "New" button, a dialog pops up where you select the database. Scroll down to "PostgresQL JDBC Driver 42.2.0" (the one shipped with Jailer v8.8.4 released 2019-08-20) select the line and hit the "OK" button.
You now get the dialog to enter your connection string, username, password, etc.
Here The JDBC Driver jar should be preselected (on Windows "lib\postgresql-42.2.0.jre7.jar" or on Linux "lib/postgresql-42.2.0.jre7.jar").
So you only need to fill out the last three rows of the dialog (your DB-URL, the Username and the Password).
When done you can test the connection by hitting the "Test Connection" button.
It should work except for possible restrictions from where the database accepts the connection (check --> pg_hba.conf).
If you still think you need the latest version of the JDBC driver go to https://jdbc.postgresql.org/ and download the latest PostgreSQL JDBC driver directly from the source (Currently: postgresql-42.2.6.jar; or one of the other versions for older JREs).
You may want to directly drop the driver in the "lib" sub-directory of the Jailer installation directory.


How to start slideshow

Question: I used the answers - how to start slideshow in Mac, but it does not work. I have iMac and may be somebody can help me. I open my pictures in the finder and then use one to start the slide show using the View and then  Slideshow.
Nothing work
Comment: Can you add a link to the instructions you've followed? Also, in which application do the pictures open? What exactly *does* happen if you select View->Slideshow?
Answer: To be clearer - if you actually open all the relevant images in the Preview app, the slideshow option inside the Preview app will work.
If instead you highlight the files in Mac OS Finder, and then click Option+Spacebar, you will Quick Look these inside Finder, which will include a slideshow option as well - this is the far faster approach in most cases.
Here are two screengrabs of the Quick Look function in Finder: one showing per-image-view, the other a grid view.
Notice that in both cases I have all the files highlighted in Mac OS Finder, and then click the Quick View keyboard shortcut:

As you can see in the screengrab, if I want to, I then have the option to open any one of these images in the Preview app, should I want to adjust colour curves, print, annotate or other such tasks.
Comment: Both methods work, but both have their problems. Using quicklook, the images are not zoomed to full screen if they're small. Using Finder, they're zoomed, but look terribly pixelated. On the other hand, if you've set up your screensaver to run a slide show, the images look great. I wish there was a way to run a slide show that looks as good as the screensaver.
Answer: You can use Option+Spacebar to open a Quick Look slideshow.
Alternatively you can open the image in Preview and use the slideshow function from there.

How to start slideshow


what is the elementary Lab devices (and their specifications) for building superconducting qubits?

Question: suppose I want to build a superconducting qubit, how can I find the Lab Devices and specifications which are nessecarry to build it?
Answer: I'm not an expert of superconducting qubits, but I work around some. A non-exhaustive list of what you would need includes:

Some sort of photolithography system to create patterns for the structures of your SC qubit
A wet bench to develop those patterns, and to initially clean your samples
A method of depositing material like a sputtering system or electron beam evaporator
Some sort of plasma etcher to remove material and clean surfaces

Ideally, you'd do all of this inside of a cleanroom to minimize contamination. For more information, you could check out the supplemental information of SC qubit papers because they usual describe their fabrication process, although maybe not to the level of detail if you're just getting started.


Making cement look glossy

Question: I'm trying to paint my porch, but I was wondering how to make the cement kind of glossy. I want it to look like marble. What can I do?
Comment: Be careful that the surface does not get too slippery...especially when wet.
Comment: You will not be able to walk on it with certain shoes when dry , and not with any shoes or bare feet when wet , ( slippery! )
Answer: The most important thing you need to do is prepare the surface properly, which means removing all existing coatings and/or foreign material from the concrete surface then etching it with acid. if you are comfortable undertaking this yourself, there is a lot of online information and tutorials. Follow the preparation instructions for the coating you choose to the letter.
After thorough prep you would use epoxy concrete paint. It is a specialty coating requiring special application techniques. There are concrete paints available that are designed to look like marble when applied properly. Use your Google-Fu, check this link: marble floor coating kits, then go to a reputable paint store to gather even more information.
Comment: I agree I wanted a smooth shop floor so oil spills would be easy to clean. BIG MISTAKE! I spilled some antifreeze and I could not walk on it because it was so slippery trying to flush with water and squeegee it out was even worse my son thought it was funny though. They make a special sand like powder that can be added to epoxy paint that keeps it from being so slippery and it did not change the look much. Added another coat with the additive but it was spend. +
Answer: I don't know that you could make it look like marble, but what you can try is one of the garage floor sealer kits. They typically have paint, paint chips and a gloss finish.

Making cement look glossy


Bank Draft vs. Certified Cheque - when is it appropriate to use one or the other?

Question: Bank drafts and certified cheques are similar but have different costs associated with them.  When is one more appropriate to use vs. the other?
Comment: Interesting question; I've always just used whatever was required but never thought about the difference :)

Would there be country-specific answers for this question?
Answer: From a user perspective, my standpoint is to use the cheapest available to me, that the receiver will find acceptable.
Comment: I think the question is more interested in the breakdown of the pro/cons and general intended purposes of the two instruments that seem to serve an identical function.
Answer: In the US, these terms are covered by the UCC.
The distinctions between various forms of drafts were more important when the settlement periods were longer and options for money transfer were limited. Today, these various special forms of checks are antiquated, and unless you have a specific requirement to do otherwise, select the cheapest option. (A big exception is with real estate closings, where you are often required to bring a certified check due to lender or regulatory requirements.)
From the UCC Article 3, Section 104

(f)  "Check" means (i) a draft, other than a documentary draft, payable on demand and drawn on a bank or (ii) a cashier's check or teller's check.  An instrument may be a check even though it is described on its face by another term, such as "money order."
(g)  "Cashier's check" means a draft with respect to which the drawer and drawee are the same bank or branches of the same bank.
(h)  "Teller's check" means a draft drawn by a bank (i) on another bank, or (ii) payable at or through a bank.
(i)  "Traveler's check" means an instrument that (i) is payable on demand, (ii) is drawn on or payable at or through a bank, (iii) is designated by the term "traveler's check" or by a substantially similar term, and (iv) requires, as a condition to payment, a countersignature by a person whose specimen signature appears on the instrument.

From Article 3, Section 409

(d)  "Certified check" means a check accepted by the bank on which it is drawn.  Acceptance may be made as stated in subsection (a) or by a writing on the check which indicates that the check is certified.  The drawee of a check has no obligation to certify the check, and refusal to certify is not dishonor of the check.
Answer: 4 BANK DRAFTS
4.1 Introduction
A bank draft is an order to pay a sum of money on demand and addressed by a banker either to itself or to another banker and drawn on its head office or at a branch.11  Bank drafts are issued and then signed by two authorized signing officers of the bank; one being a "counter signature". Once "signed", bank drafts become a statutory obligation of the signing bank and are irrevocable.12
4.2 Particulars Required
The date, amount payable, and payee's name must be typed on the bank draft prior to its delivery. It can be payable to a customer or creditor. Once the bank draft is purchased, the amount paid is placed in a special reserve account. When presented for payment, funds are withdrawn or collected from that account.13 The item is then collected through the ACSS.
4.3 Not a Guarantee of Payment
Although bank drafts are substitutes for cash, they cannot always be converted to cash immediately on deposit to a holder's14 bank and are not a guarantee of payment. A collecting bank must be certain that the signatures are genuine and authorized.15 Funds are not realized until actual collection. The larger the amount of the draft or the greater the geographical distance between the place of issue and deposit, are factors that can increase the time of collection.16 Many devices exist for discovering counterfeit banknotes; however no corresponding devices exist for the discovery of forged or unauthorized signatures on a bank draft or certified cheque.17
5 CERTIFIED CHEQUES
5.1 Introduction
"Certification" is the name given to the marking of a cheque by a bank to show
that its customer has an existing account with sufficient funds to meet the drawn amount.18Certification is demonstrated by a mark on the cheque, typically a stamp marked "certified."19 It must be signed by a bank or other financial institution.20 Certified cheques are not a guarantee of payment; items bearing forged endorsements can be returned for up to six years.
5.2 Particulars of Payment
Certified cheques are typically drawn by a bank's regular customer21 and payable to a creditor or an endorsee.  They are payable on demand and collected through the ACSS. The customer's account is then debited and the amount set aside into a special suspense account. When presented for payment through the ACSS, the amount is charged to that account.
5.3 A Direct Promise to Pay
The courts have held that certification amounts to an acceptance of the cheque by the bank and puts the payee22 in possession of something equivalent to cash. There is no difference at law in the treatment of a cheque certified at the request of the bank's customer and one certified at the request of the payee. A bank may be able to refuse payment on a certified cheque, if it can be demonstrated that a payee would be unjustly enriched by payment.23  Certification therefore is a direct promise of a bank to pay, independent of a customer's obligation to pay, even where a bank has mistakenly certified a cheque.24
5.4 Verification is Required
Whether funds are direct deposited by bank draft or certified cheque, there is no appreciable difference in risk in comparison to closings in the past.25  Remember however that financial institutions may not post funds to a trust account until the next business day and sometimes later if the other lawyer's financial institution is not one of the major institutions, or, if a cheque is drawn on an account in another region of thecountry.26 Verification of both items is necessary as the ACSS does not guarantee payment by bank draft or certified cheque.
Comment: I think this is a quote if so I think you need to attribute it correctly.


Is Optimal Swap Sorting NP-Hard?

Question: Given an array of integers with duplicates, find the minimum number of swaps to sort the array. According to this question, the problem is NP-Complete but the reference given proves NP-Completeness for a more general case where the target array is unrestricted. Is there a reduction from the unrestricted case to the sorting case?
Comment: May be I'm missing something, but it seems to me that the reference *does* prove NP-completeness of the sorting problem. In the paper, NP-hardness comes from a reduction from the maxDCD problem. Now, in the reduction of maxDCD to the interchange distance problem in Lemma 1, you can freely choose the order in which you enumerate the edges. If you enumerate the edges so that they are sorted according to the source vertex, the string $y$ will be sorted.
Comment: @EmilJeřábek Oh, I see! I think you are right, the authors mention that the order can be arbitrary so the edges can be sorted by their origin vertex and then transformed into the two strings where one string is sorted. Do you mind posting it as an answer?
Answer: Even though the authors do not explicitly formulate it that way, the paper [1] (the reference mentioned in the OP) does actually prove the NP-completeness of bounding the minimal number of swaps needed to sort an array.
Their proof of NP-hardness of the interchange distance problem goes by reduction from the maxDCD problem. Now, the reduction in Lemma 1 allows one to choose freely the ordering of the edges (as mentioned there); if you choose it such that the edges are sorted according to their source vertices, the target string $y$ is sorted.
[1] Amihood Amir, Tzvika Hartman, Oren Kapah, Avivit Levy, Ely Porat: On the Cost of Interchange Rearrangement in Strings, SIAM Journal on Computing 39 (2010), no. 4 (2010), pp. 1444–1461, doi 10.1137/080712969.

Is Optimal Swap Sorting NP-Hard?


Ubuntu server boot without keyboard/monitor

Question: Hope someone can help me with this unusual problem. I installed Ubuntu 12.04 server on a Gigabyte GA-H61M-USB3 motherboard. This all went well. I subsequently installed Apache, MySQL and PHP. This also went well. I am using the UFW kernal firewall instead of the recommended Shorewall (could not find the repository during installation). I thought I had a working server until I relocated the box and attempted to log in using PuTTY. Turns out that the server does not boot without a monitor and keyboard connected. I don't believe there is anything in the motherboard that is preventing the boot. Has anyone else seen this behavior and what was your fix. Thanks.
Answer: Have you verified that the system does not boot? For example add something like
<code>    date>>/iamalive
</code>
to /etc/rc.local and check that file after reboot.
Are you using the correct IP to connect via Putty (static vs dhcp configuration)?
Comment: Yes, it is not fully booting. I don't know how far into the boot process it is getting to before it fails. I can try your suggestion to be sure. When I reconnect the monitor and keyboard it works fine. I am using a static IP in the server. PuTTY works fine when attached to the monitor and keyboard through a KVM switch.


Our cat is still scared and suspicious of us

Question: We adopted Carsi when he was eight months old. As far as we know, he was left behind by his owner as she moved and he was taken care of by nice people, but lived on the streets. When we adopted him, he was in the vet's office being treated for pneumonia.  It took him several weeks to get closer to us but he did.
Now, after more than one and a half year, he comes to my lap once or twice everyday.  However, whenever we stand up and start walking in the house, we observe that he is really scared and starts taking shelter under the couch or the table. We feel disappointed that he still does not feel like at home and threatened by us even though we speak very softly to him and act very affectionately.
Do you have any suggestions for us so we can have a relaxed and happy cat?
Comment: I'm guessing he was kicked or stepped on at some point in the past, eithet accidentally -- occupational hazard when cats are too insistent about being underfoot -- or on purpose, and is afraid it will happen again. The only cure I know is time, but if you talk to your vet some stress-reducing medication might be appropriate. CAVEAT: This I'd only a guess, based on insufficient information.
Comment: My cat is like this too. He's been here for 3 months and I have not been able to get close enough to pet him. Recently he has started meowing like a baby when I try talking to him. I see that as progress. He eats, uses the litter box and sometimes observes me from a distance, but he hides in a bedroom closet or under the couch nearly all day. The apt is large and I think he is overwhelmed. I have sprayed some pheromones, played cat calming music, and made two refuges with boxes, pillows, and baby blankets, and also a comfy spot by the window so he can get sun. He continues to hide where it's d
Answer: You should be patient and understanding.
Some cats have very easily broken heart. I am speaking figuratively, of course. Some events leave permanent scars in their souls, shock can be never forgotten, that affects the behaviour.
Cats can't talk, they don't have therapists who could help them to overcome their problems.
I guess that  betrayal of his first owner, living in the street (which equals being almost homeless), illness and a lot of manipulations that vet did with him to cure - all these left a scar in his personality. Taking shelter under the table or sofa is kind of an unconscious response.
You shouldn't be upset. This is him. Sometimes even old former homeless cats become domestic and tender very quickly. Sometimes, once betrayed pets can never become "normal".
I would recommend you keep trying to "protect" him. If your house is big, buy him a special cat's house, small place, where he could feel safe and comfortable. Keep touching, talking (yes!) and streaking him. If you are persistent but soft, you'll be successful. But be ready that he'll stay fearful. It won't mean that he doesnt love you or feel unsafe or he's unhappy. It just means that the past can't leave him. Only love (he feels it) and patience can help you.
Good luck.
Answer: I've been in that situation myself; here's what I found helpful.
First, realise that your cat's behaviour doesn't mean that he doesn't trust you. Clearly he does love and trust you; he shows that by wanting to be in your lap. So when he hides from you when you're standing up and walking around, think of it as an involuntary reflex that has nothing to do with his feelings for you.
Next, try to break the association between your action (standing up and walking around) and his response (hiding). One way to do this is to keep treats handy, and toss one on the floor when you're standing still. Gradually he will learn that good things happen when a human is standing still. Then move on to walking very slowly around the room and tossing treats. Eventually you should be able to walk normally. But make the training process gradual, and if at any point he goes back to hiding, go back to the previous stage for a while.
Another way to break the association is, next time he's on your lap, make a small movement as if you're going to stand up, but stay seated. The goal is to move just enough so that he's alert, but not enough so that he runs off. Over time, make the movement bigger. Eventually you should be able to stand up, and all he does is move off your lap and onto another part of the sofa.
If you don't already have a cat tree, I recommend you get one. It will encourage your cat to spend time high up, which is associated with feelings of confidence, rather than slinking about under things. A nice high one with a shelf where he can be at shoulder level would be ideal. This will allow him to feel less threatened when you're walking around the room. You can try approaching him when he's on the shelf, and offer him a treat or praise.


Coherent state vs. classical world

Question: I am very curious as to how the classical field theory emerges from quantum field theory. In free quantum field theories, coherent states have classical properties, namely that the observables' uncertainties could be made relatively small: $\Delta \phi << \langle \phi \rangle$. So this is one notion in which you could associate classical behavior to a QFT state. But if a QFT is interacting then a state that starts out coherent loses coherence in the future. But we clearly observe classical electrodynamics which is an interacting theory. So, how does classical behavior emerge from interacting QFTs?
Comment: This is a classic question, answered in many many textbooks, usually called decoherence, or quantum to classical transition. So please be precise about what you misunderstood in the quantum to classical transition. A coherent state is not really quantum. It's at the border between quantum and classical : it's the most quantum of the classical state (it cannot be described by a classical field), and the most classical of the quantum state (it cannot be destroyed, being the eigenstate of the annihilation operator).
Comment: $$\hbar \rightarrow 0 $$ of coherent state path integral leads to classical field equations.
Comment: @confused, thanks...could you provide a reference where this calculation is explicitly done?
Answer: Suppose free quantum system. It can be well described in terms of creation-annihilation operators $\hat{c}_{\mathbf k}^{\dagger},\hat{c}_{\mathbf k}$. The classical description is good approximation of this quantum system if the number of particles $N$ in this system is macroscopical, i.e. for the system treated  and the state $|N\rangle$ we have
$$
\hat{c}_{\mathbf k}^{\dagger}|N\rangle = \sqrt{N+1}|N+1\rangle \approx \sqrt{N}|N+1\rangle + \mathcal{O}(N^{-\frac{1}{2}}),
$$
$$
\hat{c}_{\mathbf k}|N\rangle = \sqrt{N}|N-1\rangle \approx \sqrt{N}|N+1\rangle \Rightarrow
$$
$$
[\hat{c}_{\mathbf k},\hat{c}_{\mathbf k}^{\dagger}]|N\rangle = \mathcal{O}(N^{-\frac{1}{2}}) \to 0 \ \ \text{ as } \ \ N\to \infty
$$
Then the creation-annihilation operators can be treated as ordinary c-numbers. The coherent state is just a state on which the equality $[\hat{c}_{\mathbf k},\hat{c}_{\mathbf k}^{\dagger}] = 0$ is exact. Parametrizing it by the number of particles $N$, $|N\rangle_{\text{coh}}$, we have
$$
\tag 1 |N\rangle_{\text{coh}} = e^{-\frac{N}{2}+\sqrt{N}\hat{c}_{\mathbf k}^{\dagger}}|0\rangle
$$
In this case
$$
\hat{c}_{\mathbf{k}}|N\rangle_{\text{coh}} = \hat{c}^{\dagger}_{\mathbf k}|N\rangle_{\text{coh}} = \sqrt{N}|N\rangle_{\text{coh}},
$$
the quantum system can be equivalently described in terms of classical variables after considering the VEV on the coherent state of all the quantum operators. Say, for the field operator
$$
\hat{\phi}(x) = \sum_{\mathbf k}\frac{1}{\sqrt{2\omega_{\mathbf k}V}}(e^{ikx}\hat{c}_{\mathbf k}+e^{-ikx}\hat{c}^{\dagger}_{\mathbf k}),
$$
where $V$ is the volume of the system and $\omega_{\mathbf k} = \sqrt{k^{2}+m^{2}}$, the VEV on the coherent state $(1)$ for, say, $\mathbf k = 0$ is
$$
\langle N|_{\text{coh}}\hat{\phi}(x)|N\rangle_{\text{coh}} = \sqrt{\frac{N}{mV}}\cos(mt)
$$
Let's now turn on quantum interactions, assuming for simplicity that they're sufficiently small, i.e. parametrized by dimensionless couplings $\alpha << 1$. Then the interactions can be viewed as a perturbation around the coherent vacuum. Their destruction of the coherent state (and therefore the classical description) can therefore be described as decays and rescatterings of the particles from the coherent state, because of which the particles leave the condensate. Deriving the corresponding reaction rate $\Gamma$ (using Fermi golden rule for this), one can then estimate the time $t \simeq N\Gamma^{-1}$ for which the quantum interaction will lead to decay of the condensate. If this time is sufficiently large (often this is the case) in compare to time scales relevant for description of classical processes, then approximately the classical description holds.
Comment: I thought OP's question was about recovering classical electrodynamics (i.e. Maxwell's equations) from QED, not recovering the classical particle interpretation.
Comment: @SolenodonParadoxus : at least the large part of the question was about the decoherentization, which is the topic of my answer. Moreover, as for the Maxwell equations, many phenomena, for example, quantum theory of dispersion of light, within which the EM field is treated as classical field because of macroscopically large number of quanta, are also related to the coherent states.
Comment: Well I'm not saying that what you wrote isn't useful, just that OP (and me) was hoping to get an answer for a slightly different question, which is – how does classical field theory (equations of motion) arise as a $\hbar \rightarrow 0$ limit of the interacting QFT. Maybe you can extend your answer to also answer this?
Comment: @NameYYY, thanks for your answer. I have 3 questions: 1. what is the justification for approximating the state of a condensate with a large particle number by \ket{N}? 2. In what sense are \ket{N} and \ket{N+1} approximately the same for large N, because in the Hilbert space, they are orthogonal states. Moreover, does your answer imply that we only see the classical behavior of "weakly" interacting QFTs because otherwise the decoherence time will be very quick for the classical description to remain good throughout a typical classical process?
Comment: @arvinshm : 1,2. The justification is just the requirement that the quantum field $\hat{\phi}(x)$ has non-zero condensate in the given quantum state (see, for example, superconductivity BCS theory). If, instead, we would use the "usual" $N$-particle state $|N\rangle$, then due to orthogonality of $|N\rangle$, $|N'\rangle$ we'll obtain zero condensate. 3. This depends on the details of the theory. In particular, as long as interactions are not weak, you can't start from the free theory expansion of $\phi$.

Coherent state vs. classical world


cocos2d for iPhone - Touch no longer works correctly after scale

Question: I am rather new to using Cocos2d for iPhone and I am having an issue with touch locations. At the moment I am simply trying to touch and move a sprite on the screen, this works fine when the layer is unmoved as well as when I translate the layer (changing self.position in X direction in my case) however, when I scale my layer (example: self.scale = .5) the touch no longer moves the sprite. I have done a lot of forum searching/google searching and I think my issue has to do with my coordinate transforms (node space/world space etc.) But I am not 100% sure. I did notice that when I scale, if I click the location where the sprite would be without the scale, then I could move the sprite. This leads me to believe that my transforms are not taking the scale into account.
Here is the coordinate transform code I am currently using to get touch locations:
- (void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    UITouch *myTouch = [touches anyObject];
    CGPoint location = [myTouch locationInView:[myTouch view]];
    location = [self convertToNodeSpace:location];
    location = [[CCDirector sharedDirector] convertToGL:location];
}

Here is the code that is checking if the location (same location variable as above) is touching a sprite, although I feel much more confident that this code is correct, who knows!
for (CCSprite *sprite in movableSprites) {
    if (CGRectContainsPoint(sprite.boundingBox, touchLocation)) {
        NSLog(@"Woohoo, you touched a sprite!");
        break;
    }
}

Let me know if you need anymore information and thanks for reading!
Comment: Hmmmm I think you need to use convertToWorldSpace there as you want the location not transformed to the layer's space (which is scaled). Could be wrong though.
Answer: I think you should double the bounding box with the scale
   for (CCSprite *sprite in movableSprites) {
    if (CGRectContainsPoint(sprite.boundingBox*sprite.scale, touchLocation)) {
       //touch sprite action
    }
}

About converting the point, if I need an absolut screen point I always use:
convertToWorldSpace:CGPointZero.

I'm not really sure why you need this on your touch location, I would usually do this on sprites when I need to disregard their position in a parent node.
Other then that, If your game is not real multi-touch game you better use ccTouchBegan and not ccTouchesBegan.
Answer: Use this function to get sprite rect.
-(CGRect)getSpriteRect:(CCNode *)inSprite
{
    CGRect sprRect = CGRectMake(
                                inSprite.position.x - inSprite.contentSize.width*inSprite.anchorPoint.x,
                                inSprite.position.y - inSprite.contentSize.height*inSprite.anchorPoint.y,
                                inSprite.contentSize.width,
                                inSprite.contentSize.height
                                );

    return sprRect;
}

- (void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    UITouch *myTouch = [touches anyObject];
    CGPoint location = [myTouch locationInView:[myTouch view]];
    location = [[CCDirector sharedDirector] convertToGL:location];

    for (CCSprite *sprite in movableSprites)
    {
       CGRect rect = [self getSpriteRect:sprite];
       if (CGRectContainsPoint(rect, location))
       {
           NSLog(@"Woohoo, you touched a sprite!");
           break;
       }
   }
}


How to place an anchor point exactly between two others in Photoshop CC?

Question: In such a situation,
how can you center the middle point?
Comment: If you have found any of the answers below to have answered your question please make sure to mark it as the accepted answer.  If the answers do not answer your question please make an [edit] seeking clarity.
Answer: You may also solve that problem by simple geometry trick :)
Create a circle with a center at the end point of line segment and a radius a little bit greater than a half of the line segment. Then put a copy of the circle at the other end of it. The circles will intersect at two points. When you connect that points with a straight line it will intersect your line segment exactly in the half way. I attach a picture to make it more clear.
I know it's quite time-consuming and inefficient, but dealing with life by doing math is cool B)
Answer: Unless that changed in the CC version you need to do it manually - figure out the width in px and move the anchor point either by dragging it or using the keyboard. Photoshop is not the greatest at dealing with vectors.
Answer: You might also try using the Rectangle Tool (since you can snap a guide to the exact center) or use a Grid (view>show>grid) with Snap to Grid (view>snap to>grid). Place a rectangle and snap a guide to the center then remove any extra anchors. Obviously not ideal, but a bit faster than trying to count pixels.
Answer: Adding my method in case it helps. This is in Illustrator CC 2019--I can't say much about older versions. I had an object where I wanted to add a single anchor point on one small straight path, equidistant from either of the two surrounding anchor points.

Use the Scissor Tool (C) and cut the two anchor points between which you want to add a new anchor point; this gives you a completely separate line segment.
Select the now-disconnected line segment (easiest for me to use the Layers panel and select it there since it's not really visible at this point--I didn't have any stroke in my example).
Click Object > Path > Add Anchor Points; this adds the one anchor point exactly between the other two.
Use the Direct Selection Tool (A) and drag over JUST ONE of the corners where the anchor points were cut in step 1.
Use Ctrl+J (Cmd+J on Mac) to join the anchor points.
Repeat steps 4 and 5 for the other anchor points cut in step 1.
*Edit: By the way you can use the Selection Tool (V) instead, select the whole object, and use Object > Path > Add Anchor Points, but this adds one anchor point between all existing anchor points, which is not what I was after. I tried using the Direct Selection Tool and just selecting the one segment I wanted to manipulate but it still added anchor points on all the segments in the object instead of just the one.
Comment: The question is about Photoshop CC


InvocationException on connecting to MBean server from Spring

Question: I am trying to connect to MBean server from my Spring application. Below is the code:
public void connect() throws Exception {

    MBeanServerConnectionFactoryBean bean = new MBeanServerConnectionFactoryBean();
    bean.setConnectOnStartup(false);

    Properties environment = new Properties();

    environment.put("java.naming.factory.initial", "com.sun.jndi.rmi.registry.RegistryContextFactory");
    environment.put("java.naming.provider.url", "rmi://18.104.22.168:9308");
    environment.put("jmx.remote.jndi.rebind", "true");

    bean.setEnvironment(environment);
    bean.setServiceUrl("service:jmx:rmi://18.104.22.168/jndi/rmi://220.127.116.11:9308/agent/EODServer");
    bean.afterPropertiesSet();

    MBeanServerConnection server = (MBeanServerConnection)bean.getObject();

    System.out.println("test"); // After bean.getObject() - Debug pointer on this line.
}

The debug pointer is set after bean.getObject() method call.
On debugging above code, I am getting below value for MBeanServerConnection server:
com.sun.jdi.InvocationException occurred invoking method.
Values of Environment and ServiceUrl of MBeanServerConnectionFactoryBean are set correctly then why it's not connecting to MBean Server?
Answer: I'm not familiar with that particular utility, but it looks like there is some weird overlap between the JNDI and JMX configurations. Why don't you simplify and just use the JDK's own JMXConnectorFactory ?
import javax.management.*;
import javax.management.remote.*;
...
JMXConnector connector = JMXConnectorFactory.connect("service:jmx:rmi://22.214.171.124/jndi/rmi://126.96.36.199:9308/agent/EODServer");
MBeanServerConnection connection = connector.getMBeanServerConnection();

Technically, if you need to, you can add an environment map into the mix by using:
JMXConnector connector = JMXConnectorFactory.connect("service:jmx:rmi://22.214.171.124/jndi/rmi://184.108.40.206:9308/agent/EODServer", environment);

...but it seems to me that the environment you are using is already implied by the default connector and the contents of your JMXServiceURL.
Answer: It's get resolved after setting java.rmi.server.ignoreStubClasses system property to true.
System.setProperty("java.rmi.server.ignoreStubClasses", "true");


Manually modifying ArcGIS Server Geoprocessing Parameters Data Type?

Question: In ArcGIS 10.5, when I publish a Python Toolbox result as service, the parameters such as GPRasterDataLayer become GPString if these parameters are unfilled when running the toolbox on Desktop. This causes errors when using these GPString parameters as they are supposed to be GPRasterDataLayer. Is there any way to go to the server arcgisserver\directories or any folder and modify the data types?
Comment: Can you provide a test.pyt that contains just enough code to illustrate what you have tried and where you are stuck, please?
Comment: This applies to all toolboxes I tried. If you try any toolbox you have, you will face the same problem.
Comment: Modifying a deployed service by hacking the folder contents in the config store can't be a supported methodology. I doubt Tech Support would go there, though they might have a different solution.
Comment: @Vince true but there is no option to modify parameters from an interface. Absence of this is the reason why modifying the the config is needed.
Comment: No, modifying the config is not an option. Publishing from an execution with all the parameters is a better solution.
Comment: @Vince I tried that but it fails to publish in that case. What is the maximum number of parameters accepted?
Comment: I don't think I've exceeded 12 parameters on a GP service, but I only used `GPString`, and validated appropriately (using ArcObjects Java). I really do think this is an XY Problem, and that you should focus on a different solution.
Answer: As pointed out in the comments, you're trying to fix a problem by addressing the unexpected end behavior, when in fact you should be trying to fix the problem causing the issue. You should not try to modify the parameters from the tbx/pyt inside the arcgisinput directory. Actually, you can't. This information is baked into the binary files inside the service. (You could technically hack the code in the .py or .pyt, but you can't 'hack' the service as asked in your question)
I'm not really sure why you're seeing a GPRasterDataLayer parameter get turned into a GPString, but your comment on this only happens when you don't supply an input. The seemingly obvious answer here is to provide the tool with a raster dataset when you run it, before publishing. The result from your execution will know and honor the GPRaster input when creating the service. Running the tool on desktop in the same way someone would use it as a service, prior to publishing, sets the service up to be well defined and avoids these problems of unexpected executions/parameter types/etc.
Thinking about your situation, you're talking GPRasterLayer -- does this mean you want a hardcoded set of layers the user will choose from at execution time? Or do you want to allow the user to send a raster of their own to the GP Service? If the later, you'll need to change your input parameter type from Layer to Dataset. This scenario is all about having a good, well defined tool, so when creating a service you get that same experience.
Comment: If it is in a binary file, then there is no hope for me. Regarding `GPRasterLayer` vs `Dataset`. I am using already published image services. There is an option to Upload, even though not working. When it works, I want to publish the uploaded image as image service so that users can see the map of course ArcGIS Rest API refused to work too so I might go to the Dataset Route. Thank you for the input!
Comment: Why doesn't ArcGIS server creates the same parameter data type as provided in python?
Comment: Geoprocessing Services only support a sub-set (10-12) of the full parameter list. The reasons don't really matter, because it is what it is and you need to work within the list of supported parameters. The thing to note, if a parameter type is NOT supported, it is either mapped to CONSTANT (hardcoded) or STRING. This might be what you're seeing.
Comment: All of that said, you can use image service layers **in** a gp service (not as a true parameter, but referenced inside the code) and you can use raster layers and raster datasets. So I'm not entirely sure where you're running into problems.
Comment: The tool I failed to publish has about 60 parameters.
Comment: The number of parameters doesn't matter. You could have 1 million (although the more you have, the harder the tool is to use, and slower it works). The 10-12 value I'm referring to is for parameter types. (gpstring, gpboolean, gpfeatureset, etc)


Comparison of two $GL_N(\mathbb{Z}_\ell)$ Galois representations

Question: I have a question about comparing two $\ell$-adic Galois representations. Suppose we have two irreducibible Galois representaions
$$
\rho_1,\rho_2: Gal(\overline{\mathbb{Q}}/\mathbb{Q})\to GL_N(\mathbb{Z}_{\ell}).
$$
If $\rho_1$ is not isomorphic to $\rho_2$, then there must be a largest integer $a$ such that
$$tr(\rho_1)\equiv tr(\rho_2)\ (mod\ \ell^a).$$
Similarly, there is a largest integer $b$ such that up to a conjugation by an element in $GL_N(\mathbb{Z}_{\ell})$, we have
$$
\rho_1 =\rho_2 \ (mod\ \ell^b).
$$
It is obvious that $b\leq a$. I am wondering is there any known conditions to ensure that $b=a$?
Comment: $N=1$ for instance. You want all other coefficients of the characterstic polynomials, like $\det(\rho_i)$ to be congruent , too.
Answer: This is not true if the representations are residually reducible. Suppose that $N=2$, then $b$ can be strictly less than $a$. Let $\bar{\rho}_i$ for $i=1,2$ denote the mod $l$ representations. Then if $\bar{\rho}_1$ is diagonal and $\bar{\rho}_2$ is upper-triangular with the same diagonal entries as $\bar{\rho}_1$ but not isomorphic to $\bar{\rho}_1$ it would follow that $a\geq 1$ and $b=0$.


Is there a name for adjectives like "beautiful", "incredible", "amazing", etc.?

Question: Is there a name for adjectives like beautiful, incredible, amazing, etc.? Adjectives that are often generically substitutable when, say, describing vacation resorts, or the like. Preferably a name that doesn't sound salesperson-ey, but I'm curious to know those too, so do comment.
Comment: Meaningless? Boilerplate? Cliché? Marketese? Boring? Fluff? Insubstantial? Run-of-the-mill? Superfluous? Not really sure what you're after. (On a side note, arguably *all* adjectives in marketing are like that. Nobody would ever say, "our beer tastes bad", or "we use the unfinest ingredients", or "our rooms are cold and hideous".)
Comment: Fungible quasi-synonyms, hyperbolic tokens, hyper-hogwash, and baldfaced lies?
Comment: It's not clear what direction you're looking for. 'Generic', 'hyperbole', 'lies', 'euphemisms','subjective'. Something else? What general direction are you looking for? This needs more examples and context.
Comment: Apologies to everyone for responding so late! @Mitch - This was part of a tongue-in-cheek trip description, _"Walk ancient streets, travel through mountains, ride a camel into the Sahara, venture across 300-foot sand dunes, and spend the night under the stars, hours away from civilization. We didn't even need the [extra adjectives] for this one."_ (The other trips frequently use words like _beautiful_, _incredible_, _amazing_, etc.) I was looking for a commonly-known word to replace [extra adjectives]. Regardless, I learned a lot from this thread, so thank you, everyone who responded!
Answer: Words like those that have been stripped of semantic content and are used in a vain attempt to add emotion are usually called intensifiers.

intensifier  a word, esp an adjective or adverb, that has little semantic content of its own but that serves to intensify the meaning of the word or phrase that it modifies.

See this entry.
Comment: They become so through overuse and when merely used as filler.
Comment: Is beautiful really an intensifier? AFAIK words like "very" or "most" are intensifiers
Answer: They're Polar predicates. They lie at the pole of a semantic cline, like freezing and boiling:

freezing - cold - cool - tepid - warm - hot - boiling

They're not the only ones, of course. The semantic test for them in English is use of absolute(ly), which is limited to use with polar predicates.

It's absolutely freezing in here.
*It's absolutely cold in here.
*It's absolutely cool in here.
*It's absolutely tepid in here.
*It's absolutely warm in here.
*It's absolutely hot in here.
It's absolutely boiling in here.

Absolute(ly) also distinguishes the polar 'crazy' sense of mad from its non-polar 'angry' sense.

He's mad about the horses. (ambiguous: either 'angry' or 'crazy')
He's absolutely mad about the horses. (unambiguous: 'crazy')

Thus, note the grammaticality of

absolutely beautiful
absolutely incredible
absolutely amazing

and of course

Absolutely Fabulous.
Answer: When used to the extreme exaggeration, "Hyperbole" comes to mind:

From the Wikipedia Dictionary:
hy·per·bo·le (/hīˈpərbəlē/), Noun
Exaggerated statements or claims not meant to be taken literally.
  Synonyms: exaggeration - hyperbola - overstatement

From the Merriam-Webster Online Dictionary:
Latin, from Greek
  hyperbolē excess, hyperbole, hyperbola, from hyperballein to exceed,
  from hyper- + ballein to throw First Known Use: 15th century
Answer: The word I use most often is "nondescript". I use it with writers in discussing words that poorly describe their subjects, but it is generally a good description of your cohort of adjectives.

nondescript (adj.):

belonging or appearing to belong to no particular class or kind : not easily described
lacking distinctive or interesting qualities
Answer: If those words were about a person, it would be empty flattery. Maybe trite adjectives would serve for your purposes? I don't think there's a single word term to describe these words. Easier to come by are terms to describe the act of using overstated but meaningless adjectives and terms to label a person doing this. Depending on situation examples are: gloating, over-stating, being over-the-top, stupendifying (?), facecious, suck-up.


Schedule each entree so that all entrees are completed in the shortest amount of time

Question: Lets say we have plenty people to dress up entrees, but only one chef to cook them. Each entree $E_i$, takes $c_i$ time to cook and $d_i$ time to "dress up". The dressing up of entrees can occur while other entrees are being cooked and dressed up, but we can only cook one entree at a time. How would you go about creating an algorithm to schedule each entree $E_i$ in a manner that they all get finished in the shortest amount of time?
Comment: The "greedy" approach would appear to be to cook the one with the longest dressing time first.  My gut says this is optimal but a proof escapes me...
Comment: https://cs.stackexchange.com/q/59964/755
Comment: I just wanted to mention that the statement of this problem seems contrived but I thought of a quite realistic way of phrasing this problem.  There is one expensive piece of equipment at my university that many scientists need to conduct their research.  The process for each scientist's experiment is to use the instrument for some time, and then go off on their own to do data analysis with the machine's output.  The university might be interested in scheduling the uses of the instrument so that all experiments are finished, at the earliest time possible.
Answer: The link suggested by @D.W. above put into words exactly what I was looking for, an "exchange lemma" that proves the optimality of the greedy strategy. Here it is:
Suppose we cook in the order $1,2,\ldots, n$. Let $i \in \{1,2,\ldots,n-1\}$ be the smallest integer such that $d_i<d_{i+1}$. We claim that altering the order of the cooking of dishes $i$ and $i+1$, and changing nothing else, results in an equally good or better finishing time. Let us denote $ft(k)$ as the time when dish $k$ is finished under the original ordering (and all dishes are finished at time $\max\limits_{1\leq k\leq n} ft(k)$). We also denote by $ft'(k)$ the time when dish $k$ is finished under the altered ordering.
In general, we have
$$
ft(k) = \sum\limits_{j=1}^k c_j + d_k
$$ since we need to finish cooking dish $k$, which happens after $1,2,\ldots, k-1$, and then finally we dress it.
For the altered ordering we have
\begin{align*}
ft'(i+1) &= \sum\limits_{j=1}^{i-1} c_j + c_{i+1} + d_{i+1}\\
ft'(i) &= \sum\limits_{j=1}^{i-1} c_j + c_{i+1} +c_i + d_{i}
\end{align*}
(the funny ordering is just to emphasize the order in which the dishes are cooked).
The following three facts are easy to prove:

$ft(k)=ft'(k)$ for all $k \neq i, i+1$
$ft'(i)\leq ft(i+1)$
$ft'(i+1)\leq ft(i+1)$

These three together imply that $\max\{ft'(i),ft'(i+1) \} \leq \max\{ ft(i),ft(i+1)\}$ and hence $\max ft'(k) \leq \max ft(k)$ which proves the greedy strategy.


Does repeating a second course to bring my GPA up 0.05 points help or hurt for graduate admissions?

Question: So, I previously repeated an undergraduate course and I am graduating next semester with only two courses left to take. I recently realized that if I repeat another course from my first year, I can bring my GPA up from 3.85 to 3.90 and graduate summa cum laude, but I wonder if repeating too many courses for GPA (two in this case) would reflect badly, so is it worth it?
Comment: _bring my GPA up from 3.85 to 3.90...is it worth it?_ — **No.**  Your GPA is already high enough that other factors (research experience, recommendation letters) matter far more.
Comment: Speaking only for myself, if I noticed at all, I would be mildly positively impressed if you immediately retook an important class in your major field where you got a C- or worse, and the second time you got an A.  Otherwise, I might think you're too obsessed with grades to be a productive graduate student.
Comment: Are course repeats of this type frowned upon by grad school admissions offices though?
Answer: As an admissions-committee person for an R1 math dept, this would look to me like an obsessive-compulsive waste of time.
For most people the years they're in undergrad school are an enormous transition, and things that happen freshman year are (hopefully, and, mercifully) not strongly related to what happens later. People understand this, and often look with some interest on the very contrast between "freshman year" (and maybe sophomore) and what happens junior and senior year.
While it might seem virtuous to "go back and repair" a bad performance early on, this is a vastly sub-optimal investment of one's finite time and energy. Look forward, not back. Learn new things, don't worry about perfecting things that really don't need perfecting.
And, indeed, grad admissions people exactly try to appraise candidates' sense of "forward" rather than "back"...
Answer: No. It is not worth it.
If I were reading your application, the difference between a 3.85 and 3.90 would be invisible. If I caught you repeating a freshman course you'd already gotten a decent grade in, I'd peg you as a tunnel-visioned gradegrubber and look for excuses not to admit you.
On the graduate level, gradegrubbers are usually Not Admired. Personally, I do my best to avoid them as students or advisees.
Comment: I'd much rather see a student in this situation take an extra elective course in his/her field then retake a freshmen level course just to improve his/her GPA.
Comment: If communications is unrelated to whatever you want to go to grad school in, admissions committees will not care much about your grade in it. You'd help yourself much more by taking an advanced elective in your chosen field.
Comment: Well, I don't know if that changes anything, but I got a C+ in a communications class because of an oversight from the professor that I didn't appeal in time.
Comment: It's unrelated, I am a CS major.
Answer: Repeating courses should be left to the following:

Courses where you failed
Courses where you received a C or lower
Courses that have no followup course to hone skills
Courses relevant to the field you are applying to

It is much more powerful to take an additional followup course that shows that you mastered the information than to retake a course.  In general, it is bad practice to retake multiple courses during your undergrad, as the other posters have mentioned already.


What was Moshe Rabbeinu's argument against the angels?

Question: Breishis 18:8 says that Avraham served the angels milk and meat together. Rashi in the name of the Medrash says that it only seemed like they were eating. Medrash Shocher Tov Tehilim 8 says that one of the arguments Moshe Rabbeinu had why the Torah should be given to the Jews and not stay in Shamayim is that the angels ate milk and meat together. According to this Rashi they did not eat, so what was the argument?
Comment: For starters, Rashi's observation reflects an ancient Jewish tradition, which predates even his own time by several centuries, since it is mentioned in the pious, but extra-biblical, [Book of Tobit](http://www.sefaria.org/Book_of_Tobit.12.4). Secondly, angels are *spiritual* beings, so their actual *eating* is not *technically* like ours, i.e., with *physical* teeth, and tongue, and stomach, etc.
Answer: The simple answer is that that wasn't one of the arguments of Mosheh Rabeinu: It isn't mentioned in the gemara (Shabbas 88b-89a).
Addition: I saw that you added the source in the Midrash Shocher Tov which I previously hadn't seen. According to this, I think there is still room for two answers:

Rashi chooses contradictory midrashim (the approach often taken by the Mizrachi, e.g. in his commentary to the beginning of Bereishis)
Maybe the problem was מראית העין (though on the other hand, they didn't look like angels anyway).
Comment: Interesting. Gershon, do you have a source that such was one of Moshe's arguments?
Comment: http://hebrewbooks.org/pdfpager.aspx?req=14127&st=&pgnum=66
Answer: Edit:
I just learnt a Maamar of the Lubavitcher Rebbe as printed in the weekly Dvar Malchus booklet (see p5) and there, the Rebbe points out that it is mashma from the Zohar [Parshas Toldos 144a] that the angels actually ate , because:
1) The Midrash which Rashi cites [Bereishis Rabba 48:14] learns a lesson from the angels that when you come to a city - you should follow the customs of that city, and then ends:

but were they really eating? no, they only looked as if they were
  eating.

however the Zohar - after learning the same lesson omits the end (but were they..etc.)
2) The Zohar compares the angels eating to Yaakov's wrestling with the angel, where there too the wrestling was physical even though angels are spiritual.
----- (end edit) ----
@Gershon, I just looked at the link you provided, and there it states

כשעלה משה לקבל פעם שניה את הלוהות ־ אמרו מלאכי  השרת רבש׳׳ע והלא אתמול
  עברו עליה שכתבת ב־ (שמוה כי) לא יהיה לך אלהים  אהרים (כ) אמר להם
  הקב״ה בכל שעה קטיגטין ביני ובין ישראל והלא אתם כשירדהם  אצל אברהם
  אכלתם בשר בחלב שנאמר(בראשית י״ ח )  ויקה המאה והלב ובן הבקר .

so firstly: it was actually Hashem that made the argument for the Jewish people as to why the Torah should be given to them.
Secondly:
I don't think you have to say that the 2 Midrashim are contradicting one another.
Rashi mentioned that the 'men' were actually angels. So in order to answer the question that a 'ben chamesh leMikra' would ask himself: "since when do angels eat??" ... Rashi brings the Midrash that it only looked like they were eating.(So to a regular person - it looked like they ate...but what actually happened to the food.... that's another story ;))
But as far as Hashem is concerned [by Hashem - Emes - there's no 'kunsim'] (as per Midrash Tehilim) even though the food may not have been digested like regular human beings..... they are considered to have eaten it.
Answer: One should give a poor the food poor person wants, not the food the host has or wants to give (Ketubot 67b. Avraham, master of (guest) hosts, obviously followed this rule (Avraham knew how to read people, see Beur Yashar Breshit 23:16).
When the angels came they were still more spiritual so Avraham only offered some water, then they became more interested in the physical so he offered bread and eventually got to butter and tongue (Breshit 18:4-8). When angels come down here they don't tend to do too well and end up worse than humans (See Pirkei d'Rabbi Eliezer 22).
Even according to Rashi, one can say that although the angels didn't "eat" the food, they desired the sin. The Jews only sinned after being tricked by Satan (Shabbat 89a).


How do I reduce the brightness of an automotive lamp?

Question: I would like to know how to reduce the brightness of the running lamp in the tail lights of my tow car. It is a MINI Cooper and each tail light contains one single filament running lamp. These lamps also act as the brake lights in normal(not towed) driving. I believe the car's electronics change the voltage from say 5.5v as a running light to 12v as a brake light although I haven't confirmed this. Since I will tow this car with my RV, the running light feed from the RV will range 12v-14.6v. This high of a voltage will appear that the brake lights are illuminated and also create unnecessary heat within the tail light. I don't know how to calculate the proper size resister to safely reduce the brightness to say maybe half. There are two lamps, 21w each that are fed from one line. I have diodes in the circuit so there won't be any type of back feed into the car's electronics. Thank you for your help. Howard
Comment: get a lower power lightbulb ... or use external lights that attach to the tow car
Comment: The Mini Cooper's rear lights I've seen are a normal rear light cluster. The brake light is brighter than the running light because it is a separate element. on a different wire. Which MINI Cooper do you have?  And a normal single filament light will need at least half voltage -- if you are correct, it's more likely to be 7 than 5.5V.
Comment: It is a Countryman. Each tail light has a reverse lamp, turn lamp and two additional single filament lamps which illuminate at the same time as running and brake lights. The tail light wiring harness has separate running and brake light wires that operate the same lamps. This is known as separate wiring whereas the RV is combination wiring, the turn and brake are on the same wire. It's just the running light power from the RV will be full voltage which are too bright and hot for short or long periods of driving. This is why I need to reduce the voltage. Thanks.
Answer:
I don't know how to calculate the proper size resister to safely
  reduce the brightness to say maybe half. There are two lamps, 21w each
  that are fed from one line.

The relevant formulas are \$R = V / I\$ and \$P = V * I\$ (where V = voltage in volts, I = current in amps, R = resistance in ohms, and P = power in watts).
Calculating the required resistance for an incandescent lamp is a little tricky though, because the filament resistance has a positive temperature coefficient so it reduces at lower voltage (causing higher than expected power draw), while the light output spectrum shifts more towards infrared which is less visible. So you might have to experiment with different resistor values to get the exact effect you want.
Another option might be to simply wire an identical lamp in series. Each lamp should then drop half the total voltage, and you could use the 'ballast' lamp as an indicator that the tail light is on.
So how much current and power would each lamp draw, and what would be the equivalent resistance to do the same job? I tested a 12 V 15 W festoon lamp on a range of voltages from 0 to 12 V, and this is what I got:-

At 12 V the lamp drew 1.22 A, so its resistance was 12/1.22 = 9.84 Ω. At 6V it drew 0.86 A, ~70% of the current at 12 V (a fixed resistor would draw 50%). Its resistance at 6 V was 6/0.86 = 6.98 Ω, ~70% of the value at 12 V.
We can expect that a 12 V 21 W lamp would act similarly. At 12 V it should draw 21/12 = 1.75 A, and the resistance should be 12/1.75 = 6.86 Ω. 70% of that is 1.23 A and 4.8 Ω. So a 4.7 Ω (standard value) power resistor should drop the voltage from 12 V to ~6 V. It would dissipate ~6*1.23 = ~7.4 watts, so should be rated for 15 W or higher (derated 50% to keep surface temperature down), and kept away from anything that doesn't like high temperatures.
So you could put either a 4.7 Ω 15 W resistor or a 12 V 21 W lamp in series to reduce the tail light voltage to ~6 V.
Comment: Wow, thanks Bruce. That took me back to my years in electrical school learning Ohms Law and series/parallel circuits. Your answer was clear and concise and exactly what I was looking for. Would a 10 ohm 30w resistor do the same job if I use one resistor prior to both lamps? Thanks
Comment: If you feed both lamps from a single resistor then it will have to pass twice as much current, so the resistance needs to be halved. Power loss will be doubled, so the calculated values are 2.4 ohms and ~15 watts. A 2.2 ohm 30W resistor would be close enough.
Comment: Great, thank you Bruce. I would have responded earlier but since I'm new to this site, I didn't know where to look for your responce if you had one. Thanks again.
Answer: Would it be safer to wire across the Mini's brake light switch, using a relay controlled by your RV's brake light? Then you don't have to break into the Mini's wiring loom (always a bad idea when dealing with a BMW product.) The brake light circuit should be working regardless of the car's key switch position.
Comment: Thank you for your help. Apparently I cannot use the brake light switch since it is not active without the key on. It's too bad because part of the tow braking system involves an air cylinder attached to the brake pedal that is actuated by the RV's air brakes. That would have illuminated the brake lights if it wasn't so computerized.
Answer: Diodes might be more effective in reducing the voltage and current (and therefore power) through your bulbs.
Each diode would drop about 0.7-0.9V, so you would need about 5-8 pieces.
You might need to use 3A diodes, especially if using the same diodes for both bulbs.
A better solution would be to get lower wattage bulbs or replace the bulbs with LEDs, which would use a lot less energy (about 10 times less) and would be easier and less wasteful to control.


Contraction of Solids

Question: AS the water is cooled down below 4 deg C it starts expanding ( Anomalous Expansion of Water).it becomes solid and form the ICE. My question is once it becomes ICE, does it follow the behavior of solids? Will it start contracting as the temperature is reduced further? Will the volume of ICE reduce and become heavier?
Answer: The normal pattern for most compounds is that as the temperature of the liquid increases, the density decreases as the molecules spread out from each other. The ice structure takes up more volume than the liquid water molecules, hence ice is less dense than liquid water.
The volume of ice will increase and its density will decrease if kept for a longer time at 0 degree Celsius or below it. However, the mass remains the same.
The liquid state in many other substances is caused by the fact that their molecules have more kinetic energy and want to spread out and flow AWAY from each other. When they become cold, they freeze to a denser solid state because their molecules lack the kinetic energy to drift away from each other and flow, so they get stuck close together. In water, the hydrogen bonds are actually causing the water molecules to be attracted to each other, so when they have kinetic energy and can flow, they want to flow CLOSE to and right past other water molecules. When water freezes, its molecules lose energy and get stuck in a lattice structure in which they are farther apart from each other than in their liquid state, thus making ice less dense than water. The water molecules' low energy in their solid state prevents them from fulfilling the attraction of the hydrogen bonds and moving close to each other.
Comment: My question is -why does the ICE does not behave as a solid, which should contract as the temperature is reduced below 0 Deg C. If there is a contraction of ICE then its density must increase and it should sink.!
Comment: @MohanMone Good question! I've edited the answer, hope that helps.

Contraction of Solids


prove that there is no k such that $x^2-x+k$ divides $x^{135}+x+2016$

Question: how would you prove that there exists no $k \in \Bbb{N}$ such that for all
$x\in\Bbb{Z}$ the integer $x^2-x+k$ divides $x^{135}+x+2016$? I started off with contradiction by assuming that there exists a k such that $x^2-x+k$ divides $x^{135}+x+2016$
then $(x^2-x+k)r=x^{135}+x+2016$ for some $r \in \Bbb{Z}$ but from this point im finding it really hard to draw a contradiction.
Comment: @Skrrrrrtttt: if $x^2-x+k$ is a divisor of $x^{135}+x+2016$ for every $x\in\mathbb{N}$ in particular that holds for $x=0$, hence $k$ is a divisor of $2016$. Evaluating at $x=1$ you get that $k$ has to be a divisor of $2018$, too, so there are not so many chances, and they are simple to rule out.
Comment: You "only" have to check the divisors of $2016$.
Comment: A $k$ with the desired property must divide $2016$ because the trailing coefficient of a product of polynomials is the product of the trailing coefficients.
Comment: what do you mean?
Comment: cant you just say that if kr=2016 and kr=2018 this is a contradiction since a the product of k and r cannot equal the same thing?
Comment: Your initial attempt at a method doesn't really work since $r$ would be a polynomial, not a number.
Comment: Is it stated that Polynomials must have integer coefficients?  I personally would not assume that.
Answer: Assume the contrary that there is a $k \in \mathbb{N}$ such that
for all $x \in \mathbb{Z}$, there is a $r_x \in \mathbb{Z}$ such that
$$x^{135} + x + 2016 = (x^2-x+k) r_k$$
For $x = 1, 0, -1$, we have
$$2018 = kr_1,\quad 2016 = kr_0\quad\text{ and }\quad 2014 = (2+k)r_{-1}$$
Since $k(r_1 - r_0) = 2018 - 2016 = 2$ and $k \in \mathbb{N}$, $k$ can only be $1$ or $2$. However,

$k \ne 1$ because $k+2 = 3$ and $2014 \equiv 1 \not\equiv 0\pmod 3$.
$k \ne 2$ because $k+2 = 4$ and $2014 \equiv 2 \not\equiv 0 \pmod 4$.

As a result, there is  no $k \in \mathbb{N}$ which can make $x^2 -x + k | x^{135} + x + 2016$, even only for these three $x$.
Comment: why does it have to make it even?
Comment: @Skrrrrrtttt the "even" in last sentence doesn't refer to even-oddness of number.  it is used as an adverb "used to emphasize something surprising or extreme."
Answer: More can be said: there is no nonconstant polynomial $f(X)$ of degree $< 135$
with integer coefficients such that $f(x)$ divides $x^{135} + x + 2016$ for infinitely many integers $x$.
Let $g(X) = X^{135} + X + 2016$, and let $f(X) \in \mathbb Z[X]$ be a polynomial of degree $d$, $1 \le d < 135$.  Then there are $q(X), r(X) \in \mathbb Z[X]$ with $r(X)$ of degree $< d$ such that $g(X) = q(X) f(X) + r(X)$, and $f(x)$ divides $g(x)$ if and only if it divides $r(x)$.  Now since $r(X)$ has lower degree than $f(X)$, we have $|r(x)| < |f(x)|$ if $|x|$ is sufficiently large.
Thus the only way $f(x)$ can divide $g(x)$ for  infinitely many $x \in \mathbb Z$ is if $r(X) = 0$.  Thus
$f(X)$ would have to divide $g(X)$ as polynomials.  But it turns out
that $g(X)$ is irreducible over the rationals.  Therefore there is no such $f(X)$.
BTW: It's also true for $2017$ and $2018$, in fact for $X^{135} + X + y$
for all integers $y$ from $3$ to at least $3018$.
Comment: so essentially you show that g(x) is irreducible and cannot be divided by any other polynomial?


What animals did South East Asians ride in the Middle Ages?

Question: I just got curious, what animals were used by Asians (peasants and rich people) for riding in the Middle Ages? In the west region of the Earth people rode horses, but I guess horses were not common in Asia, or am I wrong? Thailand/Vietnam/Laos/Cambodia... this region interests me most.
Comment: The title and the body text do not match. *South Asia* means the Indian subcontinent, which has had a [long history of horses](https://en.wikipedia.org/wiki/History_of_the_horse_in_South_Asia); Thailand, Vietnam etc are in *Indochina*, which is part of *South* ***East*** *Asia*. These are not the same regions, nor should they be referred to as generic "Asia", because Asia is a massive place. Hence, `but I guess horses were not common in asia` - *domesticated horses probably originated in Central Asia*.
Comment: Along that line...  "the west region of the Earth" are the Americas, which had no horse population at all during "the Middle Ages" - which is another fuzzy term that primarily describes a period of European history which did not occur in the same way in other regions of the world.
Comment: If you are including the masses, "none" seems a likely answer for most of humanity prior to the 21st century.
Comment: Given that the Mongols were running roughshod over most of Asia in the middle ages, I'd say horses were pretty well known there.
Comment: Also in Europe, IIRC, donkeys were much more widespread than horses during the Middle Ages (but maybe most of them were not used for riding).
Comment: @AlexanderZhak - Can I ask for which period, if any? The entire period of Middle Ages is a long period and the animal**s** could be quite a bit. Can I help you refine your question?
Answer: Given that the stirrup was invented in Asia, horses were not a rarity in Asia. Look at Asian art work, and you'll see that horses were not rare at all, but common.
What animals were used in Thailand, Vietnam, Cambodia and Laos? Horses were common riding animals. So were donkeys and mules. The most common draught animal was probably the water buffalo. Even today a lot of Thai farmers use water buffaloes in their fields. More so in lesser developed Laos and Cambodia.
I'm not too sure about elephants. They certainly weren't common riding animals. Catching, training and keeping elephants is difficult and expensive. In all southeast Asian countries you're interested in royalty was associated with elephants. Elephants were used to haul heavy items, but definitely weren't used as common riding animals. Only royals and those approved by royals did that.
In Thailand, which is relatively flat (at least in the plains) with lots of rivers, riverine transports were very important. Thailand still has many canals. They were used for transporting large and heavy goods, and for transporting troops. Many canals were not dug for civilian purposes, but because of military needs.
I don't know if this also applies to the medieval period, which roughly translates to the periods of Sukhothai and Ayutthaya. After the fall of Ayutthaya, when king Taksin regained the kingdom, many canals were dug on his command to make military transports possible. I assume that this was also the case before the fall of Ayutthaya, perhaps to a smaller extend.
In any case, riverine transport was the mode of transport for anything. Most cities didn't have roads, they had canals. Every form of long distance transport was done over water. Only when this wasn't possible, animals were used.
Jeremias van Vliet was the local (Dutch) VOC director in Ayutthaya from 1629 to 1634. It took Jeremias 30 days to travel from Bangkok, which was a small port at the time, to the court in Ayutthaya. He used various modes of transport, from walking via oxcarts to elephants, but mainly he was transferred by boats and barges. Using the same route, it took us 4 leisurely hours in an air-conditioned coach.

http://www.siamese-heritage.org/jsspdf/1904/JSS_007_1b_Ravenswaay_VanVlietsDescriptionOfTheKingdomOfSiam-2.pdf
Answer: Horses were omnipresent in Asia at the same time periods that we call the Middle Ages in European history.
In the 13th century, the Mongols were riding roughshod over all of Asia, and given that they were probably the best riders in history (certainly of the time), any area they conquered (all of China, much of the Middle East and India) can be assumed to have the horse as a major component of its society.
In regards to Southeast Asia, wiki states:

The Yuan Chronicle reports that only 700 men defeated a Burmese army of 40,000 to 50,000 with 10,000 horses and 800 elephants. It also reports only one Mongol was killed, in trying to catch an elephant.[17][18] According to Marco Polo, the Mongol army consisted of 12,000 mounted archers, and the Burmese army numbered 60,000 men with 2000 elephants,

So we can see that the Burmese at the time used both horses and elephants.
Another major country the Mongols was unable to conquer was Japan.  According to wiki again the horse arrived in Japan around the 4th century AD.  It was certainly a major component of Japanese society in the middle ages.
Of course, jungle terrain is far less conducive to the use of horses than the open plains of Mongolia, so you likely saw much less usage in places like Laos, Cambodia and Vietnam, but the animals were certainly known throughout the region, given that the horse is one of the animals in the Chinese Zodiac and that the entire region of Southeast Asia looked to China for much of their scientific and philosophical knowledge.
Comment: While all true, if we are talking Mongols then no answer is complete without mentioning the [Asiatic wild ass (or onager)](https://en.wikipedia.org/wiki/Onager). Athough primarily a beast of burden, it can also be ridden.


How to demonstrate failure of CLT in R?

Question: I was assigned to demonstrate the Central Limit Theorem (CLT) in R in my statistics class. I already made some progress with simulation using simple.sim in R. I want to prepare 3 examples of the CLT with continuous distributions (rnorm, rt and rf) and 3 examples with discrete distributions (rbinom, rpois and rtriangle for triangle distribution). I also want to demonstrate the failure of the CLT.  I realized that this could happen when the variance of the distribution does not converge. I can't find any discrete distribution that has non-converging variance and is implemented in R.
Comment: A minor point: The Cauchy distribution does *not* have infinite variance; in fact, it does not have a variance *at all* !!
Comment: Let $X$ be a discrete random variable taking values in $1,2,\ldots$.  Setting $\Pr[X\le k] = 1-1/(k+1)^2$, $k=1,2,\ldots,$ defines a probability distribution easily shown to have finite mean but whose variance does not converge.  The simple expression for its CDF makes it easy to sample from this distribution (take the floor of the reciprocal of a uniform(0,1) variate).
Comment: Before you accumulate more questions, please edit this one so that people can make sense of it.
Comment: How could I generate random samples of the distribution with pdf like you mentioned before in R?
Comment: I cant actually understand you about the CDF function. How could I get one? I am not good with inverse transform sampling, but as far as i know i need to take $\int 1-1/(k+1)^2 dk= k + \frac{1}{k+1} $. Then i have to find a inverse function for this, which i dunno how. Then i will have to apply this function for every element in for example runif(100, min=0,max=1) ?
Comment: My first comment, wherein I also gave the inverse CDF, specifies the algorithm.  Note that I gave the CDF, not the PDF, and the distribution is discrete, not continuous.
Comment: Thanks for answer. But I have few questions.
$(1-\frac{1}{(k+1)^2})'=\frac{2}{(k+1)^3}$ Then $EX=\sum_{k=1}^{\infty}\frac{2k}{(k+1)^3}$ No doubt this sum will converge. 1)since CLT requires to know the mean i have to know at least the rounded number.
2) $DX=\sum_{k=1}^{\infty}\frac{2k^2}{(k+1)^3}-(\sum_{k=1}^{\infty}\frac{2k}{(k+1)^3})^2$ is it like this? how can you show that variances diverges? $2k^2\leq(k+1)^3$ am i doing something wrong?
Answer: If you want to take a different approach to when the CLT does not apply, you could focus on the method of sampling rather than the distribution being sampled from.  This approach could either impress your professor or violate the rules of the assignment (so read the assignment carefully).
The CLT mainly applies to an SRS (simple random sample) and some other similar cases.  But, what we often skip over in the intro classes (and later classes) is what happens with other sampling schemes.  For example consider doing a random-digit-dialing sample for a phone interview where one of the variables we are interested in is household income, since higher income households are also likely to have more phone numbers on average this will be a biased sample (unless you use a weighted mean).  So you could demonstrate sampling from a normal population (or other distribution), but with the probability of being in the sample related to the outcome of interest, then show how the unweighted mean and weighted mean behave.
You could also look at cluster sampling or stratified sampling or other forms of sampling and show how the parameter estimates behave under a naive approach compared to the proper approach.
Comment: That's very interesting approach..
Answer: Well it's hard to know if you're "doing everything correct" without actually seeing what it is you're doing.
You are correct in that the cauchy distribution is a case where the CLT doesn't apply.  I don't know what you're looking for when you say " a uniform distribution with infinite variance" because any uniform distribution needs to be bounded and any bounded random variable will have finite variance.  If you're looking for a uniform distribution over the entire real line then I'm afraid you're out of luck since that distribution isn't actually a distribution.
Another way to derive a case where the CLT doesn't hold is by instead of considering independent and identically distribution random variables you could consider a sequence of independent random variables where the variance is getting larger (in a specific way) with every new draw.
Comment: Actually a CLT *does* apply to the Cauchy, just not the usual one. The Cauchy is its own domain of attraction under means!
Comment: Jacobian, what people are struggling with is that you seem to be using "uniform" in a non-standard sense.  The CLT *does* work with uniform distributions.  No Poisson distribution is uniform.  So what distinction are you really trying to make where you write "uniform"?
Comment: yeah my mistake about the variance. To be precise the question should sound like this: I want to demonstrate with some descrete distributions that CLT doesn't work. What I found out from your letter is that to make this work i should take for example poisson distribution and every simulation i should increase λ by one, and then the it wont follow CLT?

How to demonstrate failure of CLT in R?


find out the current location

Question: I want to dispaly the current location in my application not in map.
    I want the current palce using current lattitude and longitude .
For Ex some 'x' person i want to know his location.but i want to know his location using his current lattitude and longitude.
When i use the below code it`Context context;
                    Geocoder geoCoder = new Geocoder(
                            getBaseContext(), Locale.getDefault());
                    List<android.location.Address> addresses = geoCoder.getFromLocation(17.385044,78.486671, 1);
                    String addr = "";
                    if (addresses.size() > 0)
                    {
                        for (int k=0; i<addresses.get(0).getMaxAddressLineIndex();
                             k++)
                           addr += addresses.get(0).getAddressLine(i) + "\n";
                    }

                    Toast.makeText(getBaseContext(), addr, Toast.LENGTH_SHORT).show();
                    Log.v("People","##############"+addr);

The "addr" does not getting any value.why it is happened here my Activity is extended by MapActivity and also tell me without extending activity (simply in class) how do you find the current location using current lattitude and longitude ?
please give me the code suggestions for this.Thanks in advance
Answer: Use the android.location package. There's a brief guide to using it here.
Answer: Use Geocoder class and call getFromLocation method.
This snippet Toast your current location starting from latitude and longitude:
Geocoder geocoder = new Geocoder(context, Locale.getDefault());
List<Address> addresses = geocoder.getFromLocation(latitude, longitude, 1);
if (addresses.size() > 0)
    Toast.makeText(getBaseContext(),addresses.get(0).getLocality());

find out the current location


Expresso Store: Pre-populate a cart with a members last order

Question: Basically I'm looking for a way to allow logged in users to re-order their last order. Has anyone ever tried this before in Expresso Store?
Comment: Haven't tried that before, but just thinking. Could you make {exp:store:checkout} and within that populate the products?
Comment: Yes I was just thinking the same thing. Use the users last order items loop and create the update quantities fields in the checkout form tag. Would be cool if there was an order_id parameter for the checkout tag though.
Answer: There's no built in way to do it. There are lots of possible complexities, like the fact products ordered in the past may no longer even exist!
If you want to do this, two possible ways come to mind.
You could use the standard add to cart tag along with the orders tag, to add multiple products from a previous order to the cart, all at once. This would require some clever templating, especially if your products have complex modifiers.
Alternatively, you could use PHP and create a simple plugin, which loads a previous order and adds products to the current cart. This would probably be cleaner, but requires some knowledge of PHP.
Comment: Thanks for the tip Adrian. Yeah, I understand the complexities of including a native way to do this from within Store. Fortunately, the project I'm working on doesn't have the need for product modifiers so that may simplify some things. I'll post what I come up with in the end.


how to reference which particle system the current object is using?

Question: is there a way in python to reference which particle system an object is referring to?
for example, I have a mesh named 'cube' with a particle system called 'cube_particle'. if I delete it, then I append the cube again, the second 'cube' would have a particle system called 'cube_particle.001'. if there are multiple objects, it could become quite a mess to reference which one is using which.
in python, bpy.context.active_object.particle_systems["cube_particle"] can only get object depended property such as bpy.context.object.particle_systems["cube_particle"].child_seed = 0
whereas bpy.data.particles["cube_particle.001"].child_nbr = 10, it is through bpy.data, not active_obj,
I am looking for some kind of operation to find a link between active_object.particle_systems[A] to data.particles[B].
for example, cube.001 's particle system cube_particle is currently linked to data.particles["cube_particle.002"]
thank you.
Answer: active_object.particle_systems[A].settings.name would return data.particles[B] in this case.


Can I convert a specialized killstreak weapon to a professional one without losing strange progress?

Question: I have a specialized killstreak Australium sniper rifle with ~3000 kills. I'de like to make it professional, but ideally without losing the kill counter. Am I able to just apply the professional kit without worry?
Answer: Yes.
Killstreak kits only track the kills made in the current life.  This isn't permanent information and is lost as soon as you die or leave a server.
The overall kill count is tracked because the weapon is strange... and all Australium weapons are Strange.
Comment: @imulsion If it makes you happy, I added the word "Yes" to the answer.
Comment: That doesn't answer his question though, does it?
Comment: @imulsion It didn't?  The 3000 kills aren't part of the killstreak, so...
Comment: Is there a source for this?
Comment: @EpicGuy You mean other than Strange weapons predating Killstreak kits by 3+ years?
Answer: When you go to "restore" an item, it gives you a list of all things that can be restored/removed. To make it Pro Killstreak, all you have to do it select remove Specailized Killstreak and avoid the button to reset the Strange counter. Then, you just apply the Pro KS kit normaly. As long as you do not trade the item or select the button that resets the Strange counter, the number of kills on the weapon will never reset.
The final answer for the question is yes.


Working in the UK as a Finnish national?

Question: I hope this question fits the site. I am Finnish, planning to do a PhD at the UK. Since Finland is part of the EU, is there any paperwork I would need to do in order to get to work at UK? The stay would be about 3-4 years, I guess. I would be moving with my family (wife and children).
Comment: It has nothing to do with the Schengen zone, the law applies equally to all EU citizens, with the addition of the EEA countries (Iceland, Liechtenstein and Norway) and Switzerland, with some limitations for Croatia. Citizens of those countries need no permits to work in the UK -- see my answer below.
Comment: "To get work": do you mean to ask about paperwork required to look for a job in the UK, or paperwork required once you have found a job in the UK?
Comment: Health insurance for you and your family.
Comment: you still need to get a work/residence permit for you and for your dependents. If you have a contract in hand, it's given almost automatically to people from the Schengen zone when you make the request; it shouldn't be too difficult but I have no idea idea about the specifics.
Comment: Everyone working in the UK needs a national Insurance number you don't need one to get a job but you need one before your first pay cheque otherwise you pay a penalty rate of tax.  https://www.gov.uk/apply-national-insurance-number you will likely be asked to prove you have the right to work in the UK on your first day of work (showing your passport for someone from Finland would be fine. they will take a photocopy)
Answer: As far as I understand, as a EU citizen (except for Croatia at the moment) you don't need any permits or other paperwork; in other words you have the exact same right to relocate and look for work and get employed. There are some differences if you seek government support while out of work (e.g. jobseeker's allowance or universal credit), but your right to work is in no way limited. If in doubt, check for yourself on the government's site: https://www.gov.uk/legal-right-work-uk
You may also (but are not obliged to) apply for a registration certificate which proves your right to live in the UK as an EU citizen: https://www.gov.uk/eea-registration-certificate
Answer: As a EU citizen you primarily need 2 things sorted to work in the UK:

NIN (National Insurance Number)
UK bank account

Although you can start working without any of the above mentioned you will need to sort them out as soon as you can.