Cancelling ListBox SelectedIndexChange Event

Question: Is it possible to cancel the SelectedIndexChange event for a listbox on a winforms application?  This seems like such a logical thing to have that I must be overlooking some easy feature.  Basically, I have been popping up a message box asking if the user really wants to move to another item, as this will change the UI and I don't want their changes to be lost.  I'd like to be able to cancel the event in case the user has not saved what they are working on.  Is there a better way of doing this?
Comment: I am agree with nawfal for more details check out the following link....
http://www.mindstick.com/Articles/176c6d68-ceca-4072-a319-7389f4e5b9dd/?ListBox%20events%20in%20C%20#.Net
Comment: Possible duplicate of [How to prevent/cancel a combobox's value change in c#?](http://stackoverflow.com/questions/314503/how-to-prevent-cancel-a-comboboxs-value-change-in-c)
Answer: You cannot cancel it.
What I did just a couple of days ago was to have a variable with the latest selected index. Then when the event fires, you ask the user if he wants to save, this is done in the eventhandler. If the user selected "Cancel" you change the id again.
The problem is that this will make the event fire once again. So what i've used is a bool just saying "Inhibit". And at the top of the eventhandler I have:
if(Inhibit)
   return;

Then below this where you ask the question you do something like this:
DialogResult result = MessageBox.Show("yadadadad", yadada cancel etc);
if(result == DialogResult.Cancel){
   Inhibit = true; //Make sure that the event does not fire again
   list.SelectedIndex = LastSelectedIndex; //your variable
   Inhibit = false; //Enable the event again
}
LastSelectedIndex = list.SelectedIndex; // Save latest index.

Comment: A slight variation on this, I discovered after reading this answer - you can remove the event handler instead of using the Inhibit flag:
`list.SelectedIndexChanged -= list_SelectedIndexChanged;
list.SelectedIndex = LastSelectedIndex;
list.SelectedIndexChanged += list_SelectedIndexChanged;`
There could be some reasons that this is an inferior method, but worked very well for my purposes.
Comment: @J Jones What happen if you did minus twice? Not sure if that would not throw an exception?
Comment: @OskarKjellin You wouldn't be doing it twice since this is inside the function. The function would never be called again until you add it back later.
Answer: This is exactly @Oskar Kjellin 's method, but with a twist. That is, one variable less and with a selected index changed event that really behaves like a selected index changed event. I often wonder why is selected index changed event getting fired even if I click on the exact same selected item. Here it doesn't. Yes it's a deviation, so be doubly sure if you want this to be there.
    int _selIndex = -1;
    private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (listBox1.SelectedIndex == _selIndex)
            return;

        if (MessageBox.Show("") == DialogResult.Cancel)
        {
            listBox1.SelectedIndex = _selIndex;
            return;
        }

        _selIndex = listBox1.SelectedIndex;
        // and the remaining part of the code, what needs to happen when selected index changed happens
    }

Answer: I just ran into this exact problem.  What I did is when the user makes changes, I set ListBox.Enabled = false;  This disallows them to select a different index.  Once they either save or discard their changes, I set ListBox.Enabled = true;  Probably not as slick as a prompt, but it gets the job done.
Comment: This is awesome.  Any time I start having to worry about private member variables that keep track of the current Index, or keep track of some Inhibit boolean, I start to think: how can I avoid adding this extra layer of logic?  Disabling the ListBox takes care of that.
Answer: More elegant, use the Tag property:
        if ((int)comboBox.Tag == comboBox.SelectedIndex)
        {
            // Do Nothing
        }
        else
        {
            if (MessageBox.Show("") == DialogResult.Cancel)
            {
                comboBox.SelectedIndex = (int)comboBox.Tag;
            }
            else
            {
                // Reset the Tag
                comboBox.Tag = comboBox.SelectedIndex;

                // Do what you have to
            }
        }

Comment: Just awesome. Simple, straightforward and error-free.
Answer: The SelectedIndexChanged cannot be cancelled. So you only have one real option:
private int? currentIndex;
public void ListBox_SelectedIndexChanged(sender, EventArgs args) {
    if (currentIndex.HasValue && currentIndex.Value != listBox1.SelectedIndex) {
        var res = MessageBox.Show("Do you want to cancel edits?", "Cancel Edits", MessageBoxButtons.YesNo);
        if (res == DialogResult.Yes) {
            currentIndex = (listBox1.SelectedIndex == -1 ? null : (int?) listBox1.SelectedIndex);
        } else {
            listBox1.SelectedIndex = currentIndex.Value;
        }
    }
}

Answer: This is my way to cancel SelectionChange for ComboBox. I think it could also fit to ListBox.
private bool comboBox_CancelSelection = false;
private int comboBox_LastSelectedIndex = -1;

private void comboBox_SelectedIndexChanged(object sender, EventArgs e) {
    if (comboBox_CancelSelection) {
        comboBox_CancelSelection = false;
        return ;
    }

    // Handle Event

    if (!comoBox_CancelSelection) {
        comboBox_LastSelectedIndex = comboBox.SelectedIndex;
    } else {
        comboBox.SelectedIndex = comboBox_LastSelectedIndex;
    }
}


How do I put on gas and setup the blockchain?

Question: I downloaded ethereum wallet nad bought some coins. They dont appear. It says that to view transactions, I have to make a contract. When I try to do that it says its exceeding gas limit. Also it says it's waiting for Blocks. Can't find anywhere on how to set up a the Block. Please help. I'm New.
Comment: Welcome. It might help someone help you out to provide a little more detail. You can include the version of the wallet you're using, Windows/Mac/Phone, etc, how long it's been running and what says you need to make a contract. Any detail that might help someone recognize what's happening.
Answer: You say you bought some coins but they didn't show up. The most likely cause of this is because your node was not yet synced. You then misread the message on Mist that says to "view" transactions you have to make a contract. You're mistaking viewing your balance and viewing your transactions. If you've added the correct address to watch in Mist, then if--and only if--the node is synced will you see your balance. You don't have to see your transactions to see your balance.
When it says "waiting for blocks" I think that means that your node is not synced.
Syncing takes a very long time, especially on computers with slower hard drives. My guess is that your sync is slowing down significantly near block 2390000 or so. This is the DDOS attack. The only thing you can do is wait until it syncs.
You can always look at that same address on http://etherscan.io or some other blockchain scraper. You should see your balance there (and the transactions).
Answer: You probably need to watch the contract and token to be able to see them, but you'll need to add some more info like Rob said. Specifically, what tokens did you buy?
Also do you see yourself connecting to peers, or is 'blocks left' not decreasing.
Comment: OP said coins not tokens. I took that to mean ETH. If OP bought tokens they would have to add a Token Watch. There should be instructions with the token sale on how to do that.


Low resource fix for loose wood planks

Question: I just moved into an apartment with a row of loose wood planks along a central walkway. I'm only going to be here a few months, but I'd like to secure them somehow. Unfortunately for me, this house is in Brazil. Typical hardware stores like Lowe's or Home Depot are nowhere to be found and I don't speak the language well enough to have a conversation with a local hardware guy. There are plenty of Mom & Pop shops around with screws and wood shims, but I only have a very basic set of tools with me (an advanced utility knife). What are some methods to secure the wood blocks but not damage my feet when I walk over them?
Comment: Can you get your hands on some construction adhesive?
Comment: @JACK I'm not sure what that is. This might be a good answer, and I can try to figure out what it is here.
Answer: For a small job like that, I think construction adhesive would do the trick. Most local hardware stores should sell it. You'd need a caulking gun, about $5 bucks, to spread the adhesive. The adhesive comes in a cardboard tube similar to the one below. There are many different types.
Comment: This looks like it would adhesive the blocks to the floor (thank you!), but what about the spacing between the blocks? Should it be filled with the adhesive?
Comment: @Hooked - why do you care about the spacing?  Walking on a crack won't hurt your feet.

Low resource fix for loose wood planks


10V voltage with raspberry and arduino

Question: is there a simple way to connect the 5V pins of the Arduino and the raspberry pi in series to get 10V ?
Thanks
Answer: No. The pins are already all connected in parallel, you can't change that.
Comment: @CaptainCoding7 I highly recommend using a transistor with an external battery. You can use the Arduino to "toggle" the transistor to output the 10v from the battery.
Comment: OK thx, so I guess the only way to get a higher voltage from an arduino or a raspberry is to use a boost converter, right?
Comment: I'm not sure what you're trying to do. Do you want to have a 10 V power supply, or do you just want to switch a 10 V device on and off?
Comment: I suppose he could take one pin from each device and connect them in series?
Comment: Yes I'm tring to have a 10V power supply @Hearth
Comment: Ok @KingDuken I will do this
Answer: Yes, you could just theoretically connect +5V pin from Arduino to Raspberry 0V pin, and so you could obtain 10V when probing +5V pin of Raspberry to 0V pin of Arduino.
But DON'T DO IT.
Besides of getting two points that can be measured as 10v potential with your multimeter, this setting will be of no utility at all.
You can't connect Arduino to Rpi (first because Rpi uses 3.3V logic, second because what Arduino thinks as "digital 1", Rpi would see as digital 0.
This is a really nonsense and there are a dozen practical reasons for not doing this in a real world situation. There are other ways of doing whatever you want to do.
Comment: ok thanks @mguima, I didn't see your answer one month ago !

10V voltage with raspberry and arduino


How to intentionally get denied entry to the US, without getting into trouble?

Question: I have a multiple entry visitors visa for five years. I went to USA last year and lived there for one year with my husband (6 months entry and other 6 months of extension).
I left USA legally. Now my family wants me to go back and live with my stupid in-laws and husband in USA. I don't want to go but I have family issues and I have to go. Is there a way I can get deported from the airport?
How can I get denied at the airport from entering USA without getting in trouble?
(My husband overstayed his visa and he's now an illegal immigrant there. The problem is, if I get an entry he'll make me overstay too and I don't want that)
I'm from Pakistan, and we have a Pakistani passport.  I also have a Schengen visa and am currently a Spanish resident.
Comment: This is the most serious question I have ever seen on Stack Exchange.  I feel slightly ashamed for initially thinking otherwise, when I had only read the title.
Comment: The easiest way is to get your husband deported.  Call USCIS tell them where he is and have him deported.
Comment: Beware, if you get denied entry once it will be hard to get there again (forever).
Comment: From what I've read of your situation it appears:
* you have been forced to marry someone
* your passport is being withheld from you

Both of these are immoral acts. Since you say you have a schengen visa, would it be possible to travel to a country in the schengen area where these acts are illegal and go to the police there? You say you don't want to get the family into trouble but that have already committed crimes against you. And you are not in Pakistan any more - you don't have to put up with these crimes. Though spain does not have a forced marriage law, there are EU countries that do.
Comment: Can you contact you local US Embassy?  Explain to them that you would like your visa revoked / cancelled.  They may be able to do so - that way you can explain to your relatives that "The crazy Americans cancelled my visa and I can't do anything about it."
Comment: Talking to the embassy *should* cause them to take some form of action. I mean, you are saying that if you're granted entry into the US, you'll be coerced into committing a crime. One would think that the embassy wouldn't hold that against you, seeing as you haven't yet committed any crime and that you're attempting to avert one.

If that's going to work well with your family situation on the other hand, I don't know.
Comment: Never get deported. That stays as a blemish on your immigration record. Better get help and try not to board the flight to US.
Comment: @user11743 ***YOU'RE NOT THINKING THIS THROUGH!!*** The spoon trick is for British girls who are worried their parents might take them out of the country without warning. It works because the UK has strong anti-forced-marriage laws. Spain doesn't. If you try it, the airport workers will probably just say, "If you don't want to go to America, don't go. Why get us involved?" There's still time before the flight. Use it. I don't have much space here but just trust me on this: it's much, much better if you can avoid boarding that plane. Pick up the phone and talk to the US Embassy RIGHT NOW.
Comment: @user11743 I think we would all be very pleased to hear from you in a few weeks to know that you successfully managed to solve your issues. Don't hesitate to post here how you operated, so that other people can benefit from your experience.
Comment: I insist that you should contact an association before trying to do anything on your own. The employee you'll find in the embassy may not understand your needs or your reasons for wanting to be rejected from the US. Also, any "I lost my passport" seems pretty hard to justify as a coincidence, and, at best, gives you only a few months before facing the same problem again.
Comment: Thank you so much everyone.  Ok let me tell you something, My husband told me if I don't get entry, he'll go for paper marriage to get a green card and for that purpose he'll have to make an official divorce letter with me. That's a fake divorce but official. So I was thinking if somehow I don't enter USA and he goes for paper marriage I will get divorce papers. And that's all I want. I won't have to be bad and leave my family and go through tough time.
Comment: I will update you guys for sure :) I'm still in Spain, I will let you know.. Thank you so much :)
Comment: I called homeland security and told them every single details about him, even his work and Address. But they didn't deport him, they gave him 3 months to hire an attorney and come back to court so he went and applied for political asylum. Now they can't deport him :(
Comment: I can't thank you guys enough for your support. I'm so motivated and encouraged, I'm never gonna give up :) My husband booked my ticket :( I will be travelling to US this week, I don't have enough time to contact associations. So I have two options now. I'm gonna hide a spoon in my clothes and I will explain things to airport authorities and tell them to help me. And if it doesn't work I'm gonna talk to an immigration officer at JFK. I hope things get better. I will write everything I experience. Thank you once again for your help :)
Comment: @QuoraFeans This question is about preventing being forced to travel somewhere.  Although different from the more usual question of asking how to succeed in travel to a place, it is still a travel question, albeit an unusual one.  Although it is true that behind this travel-related question lies a much deeper problem, the specifics of forced travel are neither off-topic, nor too localised, and are therefore, in my opinion, welcome to this site.
Comment: In Canada, we have a number of organizations that provide services directly to individuals who are dealing with forced marriage. I'm not sure how relevant it can be to your situation but for onlookers... http://www.fmp-acsa.ca/emergency-help/ I'm certain that there must be sister organizations in the US.
Comment: @user11743 Please answer if you're reading this
Comment: Really? I can get my visa cancelled? How? That would be the best way. I won't have a "deported from the airport" record and I will be able to get a visa again whenever I want and meet my friends :D
Comment: What happened? It has been 3 months.
Comment: Another idea is to tell border patrol that you're being forced to come to the US against your will.
Comment: @user11743 This is not silly. I think everybody understands your situation. Some countries have good organization to support women in these situations, but I am afraid your country is not one of them. (I don't have good advice for you unfortunately)
Comment: @user11743 not silly at all, it's a very interesting and valid situation! Great that you were able to come on here and try and find a solution!
Comment: I have thought about doing that but I can't just leave and get my mum and younger sister in trouble. They'll pay for it and they're living in Pakistan so I don't wanna do it.
Comment: Out of curiosity, why not go to the US, make some friends, go stay with them for a bit, sue for divorce, and then as soon as that is settled, return to Pakistan?

You can make yourself not legally able to remain in the US, and yet still leave on good terms.
Comment: Doesn't the US Visa application literally ask you if you will overstay? If you answer "yes", it will probably bring up a text box saying "Explain:", and you can explain.
Comment: I would look at it this way: no matter what you do (pretty much) someone will suffer some sort of harm, either you or both you and your female relatives. I don't see an easy way out for you. So imagine a couple of years from now looking back on today: what would you wish you had done? Get a lot of evidence in a safe place (papers, recordings, etc.) and get prepared for difficult times ahead. I really don't see an easy way out for all of you.
Comment: If you tell the border patrol agent that you will be coerced to overstay your visa, you should be denied entry.

Also, what if you "lost" your passport? You'd need to reapply for a visa at the US Embassy, and if you tell them that you'll be coerced to overstay it, you'll most likely get your visa application denied.
Comment: My dad has my passport :( I will try to steal and then lose it, but is it gonna work? I might get a new passport with a visa and I will have to go again :(
Comment: Contact the US Embassy in Madrid and explain the situation. Their phone number is at http://madrid.usembassy.gov/visas.html
Comment: Thanks Mark. I didn't really know how to ask lol, guess I'm the weirdest person who wants to get deported from airport, sounds silly :( but it's about my life and my career. I can't leave my college and come to USA and stay there. Why do I have to do that if I have better options in my country but my family doesn't understand :(
Comment: Worded differently, the only chance of getting out of this unharmed is to pretend playing along, grab as much money as possible, and flee to a "women's house", and never come back. Causing an incident at the passenger harrassment or at the immigration officer will only cause additional trouble, but not change anything about the current situation. It may very well result in "family punishment", however.
Comment: Why can't you just tell them you were denied entry?
Comment: Please be carful whatever you do. Be wary of using a non-public computer, there may be tracking software. If you end up in America, know that you can contact the local law enforcement in the event your husband mistreats you. You actually have a better case for asylum than he does. Look for local women's shelters and get a handle on your options. Please keep this page running so that we know that you are safe. Good luck, and know that you are not selfish, this is being forced on you by people who should respect your choices.
Comment: @staticx, Just plain objectively speaking, chances are....  something good didn't happen. user13107's last seen status is recent, so there would've been a follow-up response by now (cf. *"[never gonna give up](http://goo.gl/8hDdHN)"*) if things had went smoothly. Silence likely meant this thread has been found out and user13107 is **not allowed to reply**. Hopefully 10 years later we might hear a response indicating some good news.
Comment: I got my visa from Pakistan and I'm living in Spain right now,  so I don't know if the embassy people can help me without me getting in trouble :(
Comment: I would "accidentally" lose my passport right before the flight. Wouldn't that be an option?
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](http://chat.stackexchange.com/rooms/54558/discussion-on-question-by-user11743-how-to-intentionally-get-denied-entry-to-the).
Answer: This question was shared on Hackernews and has a lot of comments and ideas over there that might be of interest to you as well.
Some of the major points raised there:

do take into consideration how many people here are for you trying to get out of this situation BEFORE going to the US
seek support. You've done the right thing reaching out online, now it's time to speak to a women's rights group, embassy, potentially even the police.
if you do, write everything down first, to make sure you get the message across plainly. You'll likely be nervous and upset, and it'll help to have a prepared statement.

There are some other options like telling the border officer that you're likely to overstay, which will get you taken aside for further questioning, at which point you can explain your situation. But it would be better to find a solution BEFORE your flight.
Comment: @user11743 if you visit an organisation like this, you don't have to do anything you don't want to. Listen to what they can suggest, they'll have ideas we haven't had on here.  They might be able to come up with a more useful suggestion. And if not, you can walk away - nothing lost, as nobody else needs to know.
Comment: Thank you so much. I have considered this option but as I told you if I go to some women's right organisation and bring dishonour to my family, I will get in deep shit. I know I can go to police, a shelter or something but I'm concerned about my mother. If I do something stupid like leaving home and seeking security ,my mother will get in trouble and she's in Pakistan. I'm waiting for her to come here and then I will take a step.
Comment: This is the best answer, overall.  I hope @user11743 takes this advice.
Answer: One of your best chances if you're not too much in a hurry would be to go see a specialized association in Spain (maybe a feminist association?).
These people would then have access to bigger means (embassy for example?) that could help you. These people can act with discretion.
As suggested by others, the idea to be denied the entrance is tricky and may not work or have unexpected results.
The association "Coordinadora Feminista" seems to deal with both women's rights and immigration. You may want to send them an email describing your situation (don't use your usual email address so they can't get back to you if you don't want to).
Comment: *"even visiting a church and asking to speak in confidence"*, that's like the worse advice ever. Spanish Catholic church is very hard-line on the Holy Matrimony, and they strongly oppose divorce. Besides, she's from Pakistan, thus most likely Muslim, not Catholic.
Comment: Really, worst advice ever? Can think of worse quite easily.  'Church' was just an example, can substitute for temple, synagogue, shrine, doctor, whatever - someone who could help with connections to various support groups.  She doesn't even need to tell the church person what it's about.
Comment: This might not apply in this situation, but girls in the UK who have been unable to get access such help have deliberately set off metal detectors at the airport to get a chance to speak to an official before being made to fly. http://www.theguardian.com/world/2013/aug/15/women-forced-marriage-spoon-underwear
Comment: @user11743 like others suggested - womens' associations, feminist ones, in fact even visiting a church and asking to speak in confidence, they would most likely be able to tell you about some womens' rights groups to help you.
Comment: I'm not from Spain and can't give you good advice but searching for "feminista asociación espana" in Google seems to give interesting results. These associations usually deal with violent husbands and so on. They can protect the women by giving them a place to live and advices so they can escape their fate. While your case is a bit unusual, they will have access to other resources and will give you good advice. They know about discretion and the doubts/fears you may have.
Comment: @vartec, weird comment! There's no law against Muslims walking into churches, and there's nothing in the Christian faith which forbids helping a Muslim (quite the contrary, in fact). I definitely think she'd have a better chance than if she walked into a mosque...
Comment: @vartec, @Izkata, Use common sense. Why would people reply with *"Marriage is sacred"* when we're talking about **forced marriage**? Also, there's a huge myth that church only welcomes christians. Folks from other religion or no religion are welcome too, including Muslims (even if they have clearly stated that they have no intention to ever be a Christian).
Comment: They don't need to know that. These kind of associations frequently deal with sensible cases. They can act without making anything public. Make sure you choose a serious association though if you choose to go that way.
Comment: Most churches I've ever been involved with in the US would be happy to help someone in that situation.
Comment: This is the most useful answer I've read - there are organisations who are experts in helping with this sort of thing.  If you can't find one, even start with a counsellor who could then direct you.
Comment: @MarkMayo I don't know about "worst advice ever", and nothing about how it might be different in Spain, but even here in the US going to a church isn't very good advice.  "Marriage is sacred" and all that jazz - although you _might_ get lucky...
Comment: Thanks for your suggestion. I don't wanna do anything to cause dishonour to my family by going to agencies and then go through honour killing lol.
Comment: Like what kind of association? I haven't heard about one around here :( Can you give some more detail on it?
Comment: This won't work: you can fight criminals legally only after a crime has been committed not before ... Every month more than one woman is killed by her husband or boyfriend in Spain (http://www.europapress.es/sociedad/sucesos-00649/noticia-total-700-mujeres-sido-asesinadas-espana-ultima-decada-crimenes-violencia-genero-20131103132550.html)
Answer: Getting stopped at the border is a bad idea. But if you do something "stupid", you can probably persuade the US Embassy to revoke your visa, all while pretending that you were actually doing your best to smooth your passage to America.
E.g. you could write them a letter like this:

Passport number: xxxxx
US Visa number: xxxxx
Dear US Embassy,
I am a Pakistani citizen and a legal resident in Spain.
  My husband is a Pakistani citizen and an illegal resident in the US.
  He has applied for asylum in the US, and hopes to regularize his status soon.
My husband has asked me to join him in the US,
  and I have a [type of visa] visa that would allow me to do so.
  But I am concerned that my status as the spouse of a known illegal alien
  might cause me difficulties at the border.
Please can you confirm if I will be allowed to enter the United States?
Yours etc.

EDIT
I changed "I wish to join my husband" to "My husband has asked me to join him" because the time may may come when you have to apply for asylum to escape your marriage. So you don't want a letter saying "I wish to join him" on your record.
EDIT
Forget what I said earlier. You've just written that you're booked on a flight for this week. There isn't time to write a letter.  Just phone the embassy and tell them what's going on. Or go there in person. Whatever you do, do it ASAP!
Comment: This is the best advice I got. Thank you so much. I'm definitely gonna try this tomorrow. Can I call the US embassy and say all this instead of writing a letter? It would be better if I call the immigration office and ask them about it.
Comment: @user11743 I think a letter is better. Think about how bureaucrats work. If you phone them, they'll just say, "Sorry, but we can't give legal advice." and hang up. But if you give them a document with all your details (name, address, visa number) that states your intentions, it's much harder for them to ignore it.
Comment: @user11743 If you prefer to phone them, and you want results, I think you'll have to explain exactly what's going on. "I want you to cancel my visa, because if you don't, I'll be forced to come to America be with the man I was forced to marry. I'll be forced to overstay my visa like he did." But in that situation, the thing that concerns me is that they might ask you to "co-operate with their investigations", and I don't think you're ready to deal with that. But I'm just guessing here. You need to talk to somebody who knows more about how this particular bureaucracy works.
Comment: @user11743 In any case, the important point is this: the authorities will probably revoke your visa as soon as they realise you are the wife of an illegal alien. So they just need somebody to help them "join the dots". There's more than one way to do it, and only you can decide what kinds of risks you can accept. I think the letter is a good approach because, even if you're caught, you'll probably get little more than a beating from your husband / father for "meddling in matters you don't understand". But it's your call.
Answer: Some suggestions from a friend, conveying some advice from a forced-marriage-fighting charity.

The woman posting the question needs to hide a spoon in her underwear when going to the airport before she gets to the plane. When she is screened, either via metal detector or backscatter it'll trip the scanners, and they'll have to take her into a more private location for further screening. This is when she needs to tell the authorities that she has been forced into marriage and is going to be forced into living in a coercive situation.
That advice is from here - the Guardian.
Basically, in her situation a lot of the advice could get her into serious trouble if she tried it while she was still with her family, so forcing a separation for private screening can get her whisked away to help without giving her family a chance to actually harm her if they object strenuously.
Comment: @Sylverdrag The spoon trick is to get away from guardians.  She seems to have reasonable freedom as it stands and would be able to simply ask for help.  I read it as her looking for a way to be kept out that she won't be blamed for.
Comment: @LorenPechtel Because it appears that this is the actual situation based on OP's comments. She has been forced to marry a guy she doesn't like and is being forced to drop her career to follow her "husband" to the states where she will be coerced to overstay her visa. So essentially what we are looking at here is a form of human trafficking.
Comment: This has nothing to do with the situation at hand.  I can't see why it got any upvotes.
Comment: @LorenPechtel You didn't understand how this answer was relevant to the question, so I explained why and how. Is it possible that her family might blame her anyway? Why did they pull her for a strip search? Maybe the immigration officers wanted to have a look & cope a feel, or maybe it's racial profiling... They can guess, but they won't know. No matter the solution, if they are denied entry, her family will probably blame her anyway, but here at least, there is no evidence and she can deflect the blame on her husband's overstay. Perhaps not the best solution but relevant.
Comment: @LorenPechtel Being able to explain the situation at the right time, alone, gives her a chance to point out that her "husband" is illegal.
All her family knows is that she had a strip search. Then her husband gets grilled about his previous overstay - he is the one they reject, she is not to blame.
Comment: @LorenPechtel And you don't think being able to get away from guardians will help with not being blamed for being kept out? Especially when her "reasonable freedom" involves her passport being kept from her, and being afraid to go to the embassy.
Comment: @Sylverdrag But they would figure she had triggered the strip search.  She's looking for an option where there's nothing that can be traced to her.
Comment: Having a spoon in your underwear is no guarantee that you would be taken to a private area for further search. Security people are human and they make mistakes all the time.
Comment: I once forgot a few coins in my pocket and that tripped the scanner. They just manually checked me and told me everything's fine, no private rooms involved.
Answer: Can't you just say you're going and then not go? They're not going to know if you got on the flight, or if you were denied. If you're denied you'll never get past immigration and -- if they're meeting you there -- they'll never get past immigration in the other direction. Now sometimes immigration will inform people waiting that you've been denied but it's not mandatory as far as I know.
This doesn't work if someone is travelling with you, or if they're paying for the flights because of the issue below.
Your other problem is that the airline will be charged for your return flight (and, probably, fined) they may very well try and get this money back from you and/or whoever paid for the flights. If they have any indication you planned it they will definitely try and get the money and may get legal on you. Potentially they could blacklist you to prevent you flying with them (and maybe even their partners).
You could definitely use Karlson's suggestion and say you're being forced against your will to enter the country. But that might cause legal issues for your friends and family. You could be brutally honest and explain that you're worried you'll be compelled to overstay, that should be enough for them to flag you but it really depends.
The other suggestion in the comment, get your husband deported, is good too. Although it might be obvious (to him) that tip came from you.
In any case, you definitely don't want to directly lie to anyone or break any laws. The very fact that you know you're going to attempt this is a lie-of-omission when you board the plane.
I would very strongly recommend you do not try to do this -- it's of dubious legality, it's almost certainly going to annoy the airline if it works, and it may or may not cause problems for your family in the US.
Comment: My family is very smart, they've some people working at JFK and they will know if I came or not. I love USA, I would definitely want to visit again but that one year I spent with my family there.. OMG. I can't imagine I'm gonna go through all that once again. I'm so happy in my country, I'm going to college and working, but all they want for me to come to STATES and overstay and live with my husband. I won't be able to go to school, and my career is out of question. I don't want my family to get in trouble, they're gonna kill me if they find out that I did something at the airport.
Comment: @Smoe Judging from other comments, it seems it might not be safe for her to do so
Comment: I am gonna get a return ticket, Am I still gonna get in trouble from the airline? I don't want my family to get in trouble, I just want to make it look like "They didn't give me entry" simple. If I tell immigration officer that I was forced to come here they'll get my family in trouble :(  I will do anything to get deported really, I'm in my second last year of college and I can't leave.
Comment: This might be a stupid question, but why don't you just tell your family, that you will not come to the United States? My opinion, but if they don't understand, that your not willing to give up your current live, studies and career and stay in the US illegally, they don't deserve you coming over.
Comment: @Smoe, That's the same question as http://travel.stackexchange.com/a/24553/12505
Comment: The benefit of not telling anyone about the husband is that while he's illegally in the US, he's not movable. He can't really travel. If he would be deported well the world is his oyster now and he can travel to where the wife is.
Answer: I have a multi entry visa in my expired passport and I need to carry that; and I was told if I would want a visa in a new passport, it's a new interview and all fees. So if you manage to lose your passport, your visa is poof, gone. The London US Embassy page concurs:

Once you have obtained a new passport, you may apply for a new visa, if required.

Forcing you to get a new visa is almost impossible: if you go study, you can't be monitored 24/7 so just call the US embassy once you have your interview appointment and tell them the truth and ask to be denied after the interview! The truth never hurts and this can't be a reason for a ban -- you did not violate any rules. As the US never gives a reason for why would someone be denied, you are 100% safe, the family will never know.
Edit: Spain might have less experience in these matters (the Wikipedia entry for honor killings doesn't even list Spain) but Germany certainly deals with this a lot.
Try Terres des femmes, just be careful of what email address you use. At the end of the day, no matter what, you might need to escape to Germany (good that you are inside Schengen already -- you can get to Germany w/o a passport! On 15 December 2013 the TGVs from Paris were extended all the way to Girona and Barcelona and there's a high speed train from Madrid and there are TGVs from Paris to Germany) and ask for refugee status there. If the words "honor killing" ever seriously occurred to you, if that's a realistic threat, that's an excellent reason to ask for refugee status.
Comment: This answer is culturally insensitive. Honor killing does not mean that it is the disobedient wife who will be the target; the victim can be anyone from her family. And her extended family presumably does not want to have to seek refuge status in Germany en masse because of her decision. This is why she is seeking a solution (deportation) where the husband cannot pin the blame on her. Actively running away into a land where she can get refuge status does not solve the problem. Living as a refuge in Germany (esp. if language barrier present) is not an improvement over study in Spain either.
Answer: Your best course of action at this point is to convince your husband to come to Spain legally.  His attorney can work something out about you sponsoring him with your status there.  He should discuss with his attorney how to cancel the asylum claim without committing further fraud.  There's a checklist for this.
There is nothing you can do inside the country that will help you.  Whatever you do, you will end up on the bad list with ICE or CIS.  The best that you may get is immediate deportation or voluntary departure.  This may or may not affect your visa status, but it's likely that you will not retain it.
If you do come to the USA, there is a very real chance that your husband will drag you down with him.  Asylum fraud is not a good thing.  You will be complicit in this and could be removed.  You could be held in a detention facility during proceedings.
If you can't convince him to leave, your second-best option is to inform CIS or one of ICE's few remaining asylum fraud teams that your husband is in the USA illegally.
In that case, you may want to go to your nearest consulate and discuss it with an officer there.
This is not legal advice, I am not an immigration attorney, and I am not an employee of DHS.
Good luck.
Comment: If she wanted to be reunited with him, and if her family gave much weight to her opinion, this would be good advice. But ...
Comment: Understood.  There is no option that doesn't involve confronting her family or risking immigration status with the USA, possibly including detention.  (She could claim asylum under VAWA from Pakistan, but since she can go anywhere in Europe, the claim would possibly be denied.)
Answer: I'll take the risk that I may be misinformed about this option, but …
I have seen a lot of good advice in comments and answers, but unless I missed it, no one has suggested requesting asylum in Spain.  IF the family is in Pakistan, wouldn't this be a good way to get some protection from actions by people in Pakistan or in the USA?  (As well as the ability to remain in Spain when your student status ends.)
If asylum is granted, neither Pakistan nor the USA would have any power to make you leave Spain.  And I would also recommend you not leave Spain unless Spain forces you to.
Comment: The problem was/is her dependence on the family in Pakistan and fear of repercussions on her mother and sister back home. Not her own safety.


Print multiple CRM content PDF files at once

Question: My client is using CRM Content to store PDF documents.  I have created a VF page to present content in a tabular form with a 'print' link to circumvent some of the awkwardness of the standard SFDC content interface.  This works well for downloading individual documents quickly.  However, the client wants to be able to select multiple PDF documents and have them all downloaded as a single document that can be printed in one action.  Any ideas?
Answer: I'm not aware of a native APEX and Visualforce option for completing this, but the paid Conga Composer and Conductor products can help you do what you're looking for.
Conga Composer
Conga Composer is an advanced Mail Merge engine for Salesforce and can merge multiple documents (up to 10) into one PDF for download. You're page would need to gather the IDs of the related documents and pass them to a conga composer point merge URL which would then merge the documents and initiate a download of the combined files.  In the example below you're page would need to figure out the template ids and pass them into the TemplateId param.
Example Merge URL
https://www.appextremes.com/apps/Conga/PointMerge.aspx?sessionId=00DXXXXXXXXXXXXXXXXX&serverUrl=https%3A%2F%2Fcs13.salesforce.com%2Fservices%2FSoap%2Fu%2F8.0%2F00DW00000073T8i&id=a1NW000000162D2&TemplateId=06950000000Crmp
Conga Conductor
Conga Conductor allows you to do automate composer actions such as doing bulk merges.  It would allow you to bulk download all the records and possibly merging them into one.  The pricing on this can be prohibitive in some cases.


Combination question with and without replacement

Question: There is a group of N unique things. A simple random sample sub group x can be taken without replacement where the number of samples is x, x < N and x = 25% of N. The sample sub group x is replaced after recording. How many simple random samples of size x need to be performed to see 90% of the unique items in group N?
Answer: This sounds like a homework question, so I'm a bit weary of providing the answer, but maybe I can help you think about it.
I'm going to assume you're looking for the expected number of samples to exceed 90% of observation.
After sample 1 you will have observed 25% of the things. In sample 2, the probability of observing any individual thing is 0.25, so the expected number of new observations you will make is the proportion of items you haven't yet observed times the probability that each is observed. Using this you should be able to set up a recursive function to calculate the expected proportion observed after each sample.
Also, I suggest changing how you tagged this question, because this is not statistics, it's probability.
Comment: Thank you for the response Alton. Not a homework question. Just trying to remember stuff from 10+ years ago. Your response was great! I can't remember the correct way to represent the recursive equation here but I am multiplying the number of items yet to be selected by .25 to find how many new items get selected adding this to the previous selected total and finally calculating my percentage. Much appreciated!
Comment: Sounds like you've got it figured out! To write it properly, one way is to define $Y_i$ as the proportion of the things you've observed up until and including observation $i$. Your recursive function for $E[Y_i]$, the expected number of things you've observed up to observation $i$, would then be $E[Y_i] = E[Y_{i-1}] + 0.25(1- E[Y_{i-1}])$, with the initial condition that $E[Y_0]=0$.


Circular fringes in Michelson interferometer

Question: The rays reflected by mirrors M1 and M2 meet at the glass G. For each ray(specifically 1 and 2 in the figure which may go on 1,2,3... for an extended object as is required for the experiment) as the splitted beams meet at G the path difference for each ray(1,2,3..) would be the same (x2-x1) according to the figure, then why do we see circular fringes at the screen?
Comment: Not sure what you mean, the path difference of one of the two arms can be adjusted so they aren't the same between leg 1 and leg 2 (like in the case of gravitational wave detection). There is interference only when the path length difference isn't an integer number of wavelengths.
Comment: Maybe I am not able to frame my question properly. I am trying to say that if for instance we take beam 2(in the figure) then the split beam that reaches mirror M2(vertical) and returns back to G and the one that reaches M1 and returns to G, the path difference between the two beams(split parts of Beam 2)  is same (x2-x1) and same is true for all the other beams(1,2,....), then how do we see circular fringes?
Answer: Circular fringes imply that at least one of the beams is not collimated.
Answer: It is similar to the interference pattern of a slits or particularly a round openings. The perspective is in line with the center of the rings but perpendicular to the surface of the mirrors. Consider the light beam from the source to the center of the pattern as straight. Then every ring out from there corresponds to a particular value of theta. These are fringes of equal inclination.


Artin/Popescu approximation for (some) big rings

Question: Fix a prime number $p$. Let $A = \overline{\mathbf{Z}_p}$ be the integral closure of the $p$-adic integers $\mathbf{Z}_p$ in some fixed algebraic closure of its fraction field, and let $B$ be the $p$-adic completion of $A$. Is the map $A \to B$ an inductive limit of smooth morphisms? If $A$ was excellent, this would follow from Artin/Popescu approximation theorems, but $A$ is not even noetherian. Of course, one can ask similar questions much more generally, but this is the case I am interested in.
Comment: I would like to know what the cotangent complex of $B$ relative to $\mathbf{Z}_p$ is. If the question I ask has an affirmative answer, then the relative cotangent complex of $B$ over $A$ is concentrated in degree $0$ (and is moreover a $\mathbf{Q}_p$-module).
Comment: It may be helpful if you indicate why you pose the question (e.g., idle curiosity or something more substantial).  For example, some non-archimedean geometry (most naturally, Berkovich spaces) ensures that for a finite system of polynomial equations over $A$ (or even something more general), any solution in $B$ can be approximated arbitrarily well by a solution in $A$. So if that is your goal then the Artin-Popescu (and "smoothening") viewpoint in such generality is  unnecessary.
Answer: This is not an answer to the question in the main body, but the one raised by the OP in the comments.

The goal is to show that $L_{B/A}$ is concentrated in degree $0$ and $\mathbf{Q}_p$-module for $A = \overline{\mathbf{Z}_p}$ and $B$ the $p$-adic completion of $A$. The map $A \to B$ is flat and an isomorphism after reduction modulo $p$. The flat base change formula for the cotangent complex shows
$$L_{B/A} \otimes_B^L B/p \simeq 0,$$
i.e., that $p$ acts invertibly on $L_{B/A}$. By flat base change again, we get
$$L_{B/A} = L_{B/A}[p^{-1}] \simeq L_{B[p^-1]/A[p^{-1}]}.$$
As $A[p^{-1}] \to B[p^{-1}]$ is an extension of fields of characteristic $0$, it is enough to show:
Claim: If $E/K$ is an extension of fields of characteristic $0$, then $L_{E/K}$ is an $E$-vector space placed in degree $0$.
Proof: By expressing $E$ as a filtered colimit of finitely generated field extensions, as the cotangent complex commtues with such colimits, we may assume $E/K$ is finitely generated, i.e., there exists a finitely generated $K$-algebra $A$ which is a domain such that $E$ is the fraction field of $A$. By generic smoothness (as we are in characteristic $0$), we may assume $A$ is smooth over $K$. Then $L_{A/K} = \Omega^1_{A/K}$ is a finite locally free $A$-module in degree $0$. Localising at the generic point and using $L_{A/K} \otimes_A E \simeq L_{E/K}$ then proves the claim.
Answer: Let me answer (?) your question with a question. What is this question really asking? It seems that it asks something like this. Let's call an A-variety a finitely presented, irreducible, scheme X over A. Now, suppose that we have a B-point x ∈ X(B). Assume that the image of x is dense in X. Question: Can we find a morphism Y ---> X of A-varieties and a B-point y of Y which maps to X.
OK, and we can certainly find an alteration Y ---> X such that Y is the base change of a strictly semi-stable scheme over a suitable dvr, say R, contained in A. Since Y ---> X is an alteration and since B is algebraically closed (right?) we can lift x to a y in Y(B). Right?
This already proves something about your cotangent complex because Y is lci over A. Right?
Comment: answer_bot, although you are new here, by the looks of it you have a lot of valuable knowledge to offer. The general norm we try to adhere to at MO is to give answers that are straight to the point and carry some semblance of being authoritative, and not get drawn into protracted discussions (the SE model is ill-suited to them). So while you seem like you might be fun to talk to in person, it would be better to cut down a tad on the chat and the answering in riddles for now.
Comment: @ToddTrimble:  Do you understand what answer_bot is saying?  Speaking as somebody who has many in person conversations with severely confused young mathematicians, often the *only* correct answer to a confused question is an enlightening question.
Comment: @JasonStarr In a word, no. My message might have been prompted however by the post as it was *before* I did some editing, where answer_bot was joking around in a way that I utterly failed to understand. If you think that answer_bot has answered enlighteningly with a question, then by all means please vote it up.


Communicating design to non-designers

Question: How do you communicate design to non-designers? For example, a complex information architecture. Sometimes I get the impression that it is really difficult for non-designers to be able to visualize something that is so abstract.
Answer: This is a general question so it's hard to provide specific answers.
Many blogs and websites talk about the Feynman Learning Technique and I think it is a principle that applies when designers are communicating with non-designers (or for that matter, any type of communication between two people from different domain knowledge areas).
In essence, it involves these steps:

Pretend to teach a concept you want to learn about to a student in
the sixth grade.
Identify gaps in your explanation. Go back to the source material to
better understand it.
Organize and simplify.
Transmit (optional).

But take your example of a complex IA, I still believe that a well-organized IA should decompose into smaller and logical modules, until you get to the simplest components. Conversely, you should be able to summarize and concatenate categories so you can present the information at different levels of detail or complexity.

Communicating design to non-designers


Sample size references

Question: For calculating sample size in clinical research, I have encountered different ways. For example, using lognormal distributions or calculating using ICC. I am confused which method to apply. Could anyone point to the some references to calculate sample size pertaining to clinical research?
Comment: Please provide more details about your own study, as this question is so broad and vague that it could require a book to answer. What type of clinical measurement or outcome is of interest, how many and what types of predictor values do you want to examine, and so forth.
Comment: [This page](http://stats.stackexchange.com/q/2770/28500) has many links to texts on statistics of clinical studies. It's best to consult with a local statistician before you start, as an experienced statistician will more quickly recognize the issues that are most critical for your particular study. Otherwise you may spend a lot of time reading about matters that aren't of immediate importance. That can be good for your education, but bad for your efficiency and the timely, successful completion of your study.
Comment: Thanks! So I am interested in gathering sample size to measure reliability and validity of clinical questionnaire between 2 sets of population. For finding sample size for this situation calculating upper and lower limit of ICC. In another study where we were comparing operative costs between two subgroups, they were being compared using imbalanced and with a lognormal distribution of costs with coefficient of variation. I am not sure when to apply which method. If you can recommend a book, thats fine too
Comment: Thank you so much EdM. This is exactly what I was looking for.
Answer: This is a broad question and there are books on the subject. Here is one that many have found accessible.
See also the link Good text on Clinical Trials?  provided in a comment.
Comment: Does it make sense to close this question as a duplicate of https://stats.stackexchange.com/q/91630/1352 and migrate your answer there? It looks to me like that one could be a reasonable canonical thread on sample size calculation in clinical trials (based on a [short search for threads with the "references" and "sample-size" tags](https://stats.stackexchange.com/questions/tagged/references%2bsample-size)).
Comment: @StephanKolassa: Done

Sample size references


Rules for FHA loan availability

Question: I'm trying to find the laws on what makes a condo complex available for FHA loans.  I hear it has something to do with the amount of money on reserve and the owner/occupancy ratio.  Does anyone know if there is a copy of these laws online?
Answer: This blog posting has some good info: http://www.massrealestatelawblog.com/new-stricter-fha-condominium-lending-regulations-and-guidelines-sure-to-chill/.  I won't duplicate the list in this response, but there are quite a few requirements nowadays.

Rules for FHA loan availability


Can I use hawaii state in my game commercially?

Question: I want to make game more realistic, for that I need a state . So, I decided to take hawaii state, as it can be seen through google maps with street view, 3d view and much more and will help me a lot for making realistic game. So, my simple question is that can I use the whole hawaii state [whole means everthing like clone/duplicate] in my game commercially.
Comment: What do you mean by "clone/duplicate"? Do you mean from Google Maps? If so, then no, their maps are copyrighted. (They paid a lot of money to the satellite company to take those pictures!) If you mean something else, please explain.
Answer: Wouldn't this be better for the Stackoverflow Lawyer's site? Anyway you can use the Hawaii state in your game. As long as you don't use anything from Google maps in your game. You are perfectly fine to create a level/game based around Hawaii because Google doesn't own the rights to Hawaii.
Just make sure you don't use anything from Google maps. Also, to be safe don't clone the buildings. For example don't have the same hardware store with the same name in your game that is in Hawaii. Your making profit from the hardware store.


Raspberry Pi Refusing SSH Connections?

Question: I have this RPi that I got for Christmas and I was excited to use it, but I found out I don't have a keyboard. I was relieved when it said you could remotely access it through a local network. I'm trying to do this with my Ethernet plugged into my computer and then directly in my RPi, but it doesn't work. It worked when I plugged it into the router, but it took a lot of bandwidth which pissed my father off because he couldn't watch TV (he uses Internet TV). I port forwarded the port and turned off AVG and allowed putty as a program on my firewall but nothing helped. Any ideas?
Comment: hooking up the raspberry pi and the computer directly needs some configuration.
Btw, are you running raspbian?
Comment: @feverDream Yes, I'm running Rasbian. Also, I've waited 30 minutes. How much longer?
Comment: I meant be patient and connect it to the router when nones using the internet. Rasbian comes with ssh enabled now, so read up on what you need to connect to it from you host machine.
Comment: @feverDream So can I not just configure it directly?
Comment: Before connecting to it you need to find out the ip-address of the pi. Are you comfortable with accessing your routers admin page?
Comment: I already know the IP.
Comment: Sweet, can you login to the device using putty?
Comment: Nope, that's the whole reason why I asked this question. It says Network Error: Connection Refused.
Comment: @feverDream I used ipconfig (while directly connected to my PC) to find the IP. Is that the right IP?
Comment: you should be a more clear with your question, you said ,"I'm trying to do this with my Ethernet plugged into my computer and then directly in my RPi, but it doesn't work. It worked when I plugged it into the router".
These are two different things.
Comment: @feverDream But how would I go along with using SSH locally without having to connect it to the router again?
Answer: OK there are two ways to remotely configure a raspberry pi:

Connecting it to your home network
Connecting it directly to your laptop's ethernet-port (using a crossover-cable)

The first approach is simple as raspbian comes with ssh enabled these days. So find the ip-address allocated to it by your router.
After that download putty and try to ssh to that machine and login withe the username pi and password raspberry.
The crossover-approach needs more work and more importantly access to the machine, so its ruled out in your case.
Comment: Try reading adafruits tutorial on ssh-connectivity.
http://learn.adafruit.com/adafruits-raspberry-pi-lesson-6-using-ssh
Comment: Ah thank you! I thought a simple CAT-5 Ethernet cable would suffice for the second option.

Raspberry Pi Refusing SSH Connections?


when sending text it directs me to use skype instead why

Question: when i try to send a text to someone new it sends me to skype. why. SayI get a call and want to send them a text it sends me to skype instead of allowing me to send a regular text message
Comment: What is your default sms application?
Answer: Check your default SMS application. Go to Settings > More and tap Default SMS app.You can select the desired one from here.


MVC persist a mixed collection of existing and new records

Question: Using the method from Steve Sanderson's blog, I have a list of items that I can dynamically add to with jquery.
So, I have a list of vehicles (that belong to a Person) that I load from the DB.  When I hit save, the items get binded via the standard MVC model binding mechanism, and I can just call an Update on the the Person object.
The problem exists when I dynamically add a new vehicle row. Since that vehicle did not belong to the initial list, calling Update won't persist that new item. But, calling Create won't work because I have the existing vehicles that need updating.
Is there an elegant way of handling this, or do I need to loop through each vehicle, check if it exists in the DB and then call Update/Edit depending on the result?
I am using NHibernate with C# in MVC3.
Answer: What method are you using for generating the ids of your entities?
If they are being generated  by nhibernate can you not just check the Id for each vehicle -
If it is null or default (guid.empty, 0 etc depending on what the type of your Id) then it has never been near your db and needs to be inserted.
If it has an Id then it already exists in your db and needs to be updated.
Comment: Actually - at the risk of doing needless updates session.SaveOrUpdate(object obj) will do exactly what it says on the tin. You can leave it up to Nhibernate to decide as to whether it needs to be saved/inserted or updated.
Comment: Yes, the id's are generated by nhibernate. The call to the repository is fixed to being just an Update (according to the specs I must follow). So, in lieu of calling SaveOrUpdate, I'll just have to check its null/0 status first.  Thanks Patrick.


Are "Beautiful me" and "Beautiful we" grammatically correct?

Question: I wanted to create some maximally short and correct construction with any adjectives and those pronouns.
I did some search engine research but there was nothing with "beautiful we", so what about the "we" pronoun? Also there was a song and some site articles with exactly "beautiful me" so it's probably correct?
Answer: Your question makes no sense.
Phrases lacking verbs are not grammatically correct or incorrect although they may well be uncommon or puzzling.
In practice it would be possible to include both your examples in sentences in the right context. It all depends on how you construct your sentences.
For example:

He's not in love with clever you, he's in love with beautiful me.
Beautiful we are, my love, but wealthy we are not, so cut back on your spending.
Comment: But maybe it could be used as nouns or concepts for names for projects and organisations (like a blog or photo album "beautiful me", or the name of a web site "beautiful we" or "genius we" where that site is based on it's users'es or community's input of data and about them), and, separately, maybe it could be used as clauses that maybe could be used without sentences?
Answer: "we" is a subjective pronoun, "me" is an objective pronoun.

We decided it should belong to me.
I decided it should belong to us.

Subjective pronouns don't take adjectives, and objective pronouns only rarely take adjectives.

I want to be the best me I can be.
The good me wants to eat healthily, but the bad me wants to eat junk food.

Note how even though "me" is in the subject, the verb has a third person singular conjugation.
So you can say "beautiful me" and "beautiful us", but not *"beautiful I" or *"beautiful we".


Make very accurate solutions without weighing

Question: I am currently facing a hen-egg problem. For a LC-MS method development I need to prepare reference solutions which are used to calibrate the method. Since the method is to be used for quantification in the pg/mL range, the reference solutions should have the most accurate concentrations possible. Of course I know how to prepare exact solutions in volumetric flasks, but here substance quantities are used which can be weighed easily and also quite exactly. In my case, only a few milligrams of the substance are available to me, which is why I cannot weigh high masses. The precision balance that I have at my disposal has a lower weighing limit of 1 mg, which is about the same as the mass that I would have to weigh. However, since the lower limit is very error-prone, I do not like this method. Unfortunately, I cannot think of an alternative solution that would allow me to create an exact solution without weighing. One could of course dissolve any amount of substance in the desired solvent and then determine the concentration by LC-MS, but this is exactly where the hen-egg problem mentioned above occurs. I cannot quantify via LC-MS until I have a suitable method and an internal standard. Are there any other ideas how to get exact concentrations using small amounts of the desired substance?
Comment: No, unfortunately not.
Comment: Is it possible for you to describe a little further about the nature of this reference substance? Molweight (roughly, say 100, 200, 500, 1000 g/mol)? What about mixing your compound with something down the road equally is diluted enough to not not interfere badly with your LC-MS, but initially eases the weight-in?  E.g., murexide (https://en.wikipedia.org/wiki/Murexide) is mixed 1:250 or even 1:500 with Na2SO4 and still then it is a powerful indicator for heavy metals.  Then an aliquote could be electrochemically analyzed (if reversibly responsive) by redox and cyclic voltammetry.
Comment: What is the nature of your sample (peptide / protein / oligomer / dye)?  In similar tune to @MaxW, researcher isolating natural products / determining LC50 values work with small quantities (e.g., doi 10.1039/C3NP20106F finally mentions a prep GC to yield just 2.22 mg of Caratol (MW < 200)).  Then, the folks in radiochemistry equally use tiny amounts of matter only.
Comment: @Buttonwood The reference substances are steroid hormones of an MW-range of 270 to 400 g/mol. As we have a common weighing room, the other labs won't have balances that are more precise and I even don't know anyone of my circle of acquaintances who has access to such a device. Your idea of mixing the compound could be an idea, I'll have a closer look into this. Thanks!
Comment: Is what you are trying to weigh a salt? eg if a sodium salt then you could analyze the solution for sodium for which you could prepare standards by weighing a different salt and diluting.
Comment: Are you able to prepare a rather concentrated solution with maybe 100 mg and then dilute it 100 times so that to get your expected low concentration ?
Comment: @Maurice Unfortunately, the substances are quite expensive which is why I only have a *few* milligrams of them. Depending on the substance we're talking about 10 to 50 mg. Besides, I would love to avoid dissolving all I have. In solution, substances tend to decay faster, which is why it would be great to only use as little as possible. I could of course do it and then evaporate the higher concentrations. This would, however, be prone to contaminations of the substances and for the 10 mg, I wouldn't gain much. All the ideas that come to my mind have several disadvantages, it is despicable.
Comment: Can you find a fellow reasearch with a microbalance?
Answer:
Are there any other ideas how to get exact concentrations using small amounts of the desired substance?

Every mass spectrometry lab should have microbalances to prepare samples and standards. A lab which can afford an LC-MS can also afford a semimicro balance or a microbalance. Such balances are meant to weigh 0.01 mg to 0.001 mg (with extreme caution).
Two simple options:
(i) Since you are apparently not the first user of LC-MS system in your group, ask how other senior researchers prepared standards in your lab?
(ii) Another (crude) option is that you try weighing by difference. You will tare your analytical balance to zero. By an analytical balance I mean a balance which reads to four decimal places in grams, this is the most commonly used in research labs. Place your standard container on the balance and read the mass. Carefully transfer approximate amounts to your desired container in which the standard will be prepared, and note the weight of the standard container again. The change in mass corresponds to the amount transferred. Practice it with some commonly available substance to see if this works and if your balance is sensitive enough or not. Balances age with time.
Comment: I wish you were right. I've now worked in several LC-MS laboratories and have never had access to a microbalance. Normally, an ordinary analytical balance as you describe it was sufficient, but this time I would need exactly that.

One more question about differential weighing: What's the difference between putting an Eppendorf tube on the scale and taring it, adding substance and reading off the mass, and doing what you describe? Are there concrete indications why one method is more sensitive than the other?
Comment: You did not address the simplest point. Can you ask someone in your lab how they prepared standards with small amounts? I can say exactly the opposite, every mass spectrometry facility I saw, had microbalances. I am talking about research labs and good universities. Microbalances are expensive (up to $ 30,000). The pros and cons of weighing by difference are described in standard textbooks. See https://www.google.com/search?tbm=bks&q=%22weighing+by+difference%22


Is master cylinder hydraulic fluid level critical (Shimano)?

Question: I managed to successfully bleed a Shimano hydraulic brake but used an improvised kit instead of the official Shimano one. Since I used a regular syringe instead of the funnel+plunger system which may guarantee a certain oil level in the master cylinder reservoir when used properly, I was wondering if the oil level is the master cylinder reservoir is critical.
Comment: It shouldn't matter. The Shimano funnel is convenient with the plunger but end of process you have a reservoir of oil above the lever body. If majority of air is out it's the same thing.
Comment: Which brake system? Do you have a link to the official instructions?
Comment: @Warren Button: I was wondering more if the problem is with too much rather than too little oil. With motorcycles there's a minimum AND a maximum fluid level. That's so that the fluid has room to expand in the master cylinder in the free travel portion of the lever.
Answer: The system is designed to have the lever bleed screw displace some oil as it's reinstalled. In other words, the lever end wants to be completely full at the end, and there is not supposed to be an air gap there
In the too little fluid direction, there is some tolerance for an air gap before symptoms begin, but ideally you wouldn't have any. If by chance you finish the bleed and find out there to be a small air gap at the lever, if it's small enough then dripping a little oil in may be reasonable, but usually there's none when you pull off the funnel so if someone does wind up with one, it would first make me worry that something went wrong in the bleed.
If one doesn't have a funnel, then most of the time, doing the "gravity bleed" part of the procedure the same way as with an older Shimano brake works fine, i.e. by dripping in more fluid in the screw hole as the fluid feeds into the catch bag/bottle at the other end. Doing this with road levers would be clumsy at best though, as they tend to often really need to have their angular position changed during this step to free up air bubbles, as per the official instructions.
Comment: Appears I've inadvertantly downvoted this answer seven hours ago (falling asleep). Won't let me correct it. Apologies.
Comment: Re. "dripping in more fluid in the screw hole": for your (and anyone else's) information, a regular syringe screws perfectly in the Shimano oil port, which makes things much easier than dripping oil in the hole and risking introducing air past the master piston.


Request for seismic data annotated with Earthquake/NoEarthquake labels

Question: I tried searching (and failed to find) annotated times series of seismic data. More specifically, I'm interested in seismic data time series that would have labels like "earthquake", "no earthquake", etc.
Answer: Not totally sure what you mean by time series data for earthquakes. If it is continuously measured seismicity at a single spot, I haven't found that.
What I currently found though is data about occurrence of

earthquakes
tsunamis (with flag for earthquake-induced)
volcanic eruptions

Maybe it helps.


Example of an algebra which is not a σ-algebra.

Question: I have troubles with constructing an example of an algebra of sets which is not a σ-algebra. Could you please help me with this?
Answer: Let $X$ be an infinite set, and $\mathcal A$ be the collection of all subsets of $X$ which are finite or have finite complement. Then $\mathcal A$ is an algebra of sets which is not a $\sigma$-algebra.
Comment: Let $X$ be the set of natural numbers. Let $A_n$ be the set of even numbers up to and including $2n$. Then the countable union of the $A_n$ is the set of all even numbers, which is infinite and has an infinite complement: the set of all odd numbers. Cool :)
Comment: But proving this is not sigma algebra would require that every infinite set has a countable subset(as much I know proof) but which require Axiom of Countable choice(CC). Or is there proof without using CC
Answer: Let $L$ be the collection of all finite disjoint unions of all intervals of the form:
$(−\infty, a], (a, b], (b, \infty), \emptyset, \mathbf{R}$.
Then $L$ is an algebra over $\mathbf{R}$, but not a σ-algebra because
union of sets $\left\{(0,\frac{i-1}{i}]\right\}$ for all $i \ge 1 = (0, 1) \notin L $.
Answer: For example, let $\mathbb{R}^{[0,+\infty)}$ denote the set of all the real value functions on $[0,+\infty)$. Consider the so called n-dimensional cylinder set, defined as
\begin{equation*}
C_{t_1,t_2,\ldots, t_n,B}=\{f\in \mathbb{R}^{[0,+\infty)}:(f(t_1),f(t_2),\ldots, f(t_n))\in B\},
\end{equation*}
where $B\in\mathcal{B}^d$ is a Borel set and $C\subseteq \mathbb{R}^{[0,+\infty)}$. Then the set $\mathcal{C}'$ of all the cylinders $C$, that is,
\begin{equation*}
\mathcal{C}'=\{C_{t_1,t_2,\ldots t_n,B}, \ \forall \ n\geq 1, \ \forall\ (t,t_1,t_2,\ldots,t_n), \ \forall \ B\in \mathcal{B}^n  \}
\end{equation*}
is an algebra but not  $\sigma$ - algebra.
Anyway it is well known that there exists the smallest $\sigma$ - algebra containing $\mathcal{C}'$, but this is another story.
Answer: As another example which supports the first answer above, let $\Omega $ $=$ $(0,1]$, and let $\mathcal{F}$
contain $\varnothing $, all $(a,b]$ with $a,b$ $\in $ $\mathbb{Q}$, $a,b \in [0,1]$ $a$ $<$ $b$, and all finite unions of $(a,b]$. Let $[z]$ round $z$ to the nearest integer. Then $\mathcal{F}$ is a
field by straightforward verification. It is not a $\sigma $-field: let $A_{n}=(a_{n},1]$ with $a_{n}$ $=$ $%
10^{n}/[10^{n}\pi ]$, hence $A_{n}$ $\in $ $\mathcal{F}$ but $\cup
_{n=1}^{\infty }A_{n}$ $=$ $(\pi ,1]$ $\notin $ $\mathcal{F}$.


Why aren't the dragons spawning?

Question: I go to the dragon locations in Skyrim, but there are no dragons.  I've looted the chest and learned the word, but there are no dragons to be seen.  I'm playing on a 360.
Comment: Have you got to the correct point of the main quest to unlock them?
Answer: You need to reach a certain point in the main questline.

 Upon the start of the quest "A Blade in the Dark", Alduin will begin to revive dragons from their burial mounds scattered across Skyrim.

http://www.uesp.net/wiki/Skyrim:A_Blade_in_the_Dark
Comment: Note that one the player completes [Dragon Rising](http://www.uesp.net/wiki/Skyrim:Dragon_Rising) (which is an earlier quest), *random* dragon spawns will start.
Comment: This is really interesting to know, I spotted a dragon flying high up in the skies once before this and tried chasing it to enter combat. Hadn't realized at the time they weren't officially in play yet.
Answer: You need to finish the 2nd battle in the main questline 'Dragons Rising' you need to do this to get your shouts this is the ONLY way to get dragons to start to spawn.
Look more on the www.elderscrollswiki.com

Why aren't the dragons spawning?


Backbone global success handling

Question: In our project we use backbone to access a REST service.
This service delivers an HTTP Header that contains a kind of session token to authenticate the current user.
This token changes on every request.
We use this token with our Login Model to determine if a login is need on the current route.
The first idea was using jQuery.ajaxSuccess.
<code>$(document).ajaxSuccess(function(event, xhr, settings) {
    updateToken(xhr);
});
</code>
Works nearly but the global success is triggered after the success handlers in backbone.
So if any backbone success handler starts a new request to the server, it has an old token at this moment and the request will be rejected.
Call updateToken in every success handler or continuing processing using setTimeout is to much effort and error prone. it may be forgotten.
Now we created this solution
<code>var BBsync = Backbone.sync;
Backbone.sync = function(method, model, options) {
    var success = options.success;
    options.success = function(model, response, options) {
        updateToken(options);
        success(model, response, options);
    };
    return BBsync.call(this, method, model, options);
};
</code>
All success methods are wrapped.
Is there any risk in this solution?
Have we overlooked something?
Any better solutions?
Comment: Seems reasonable to me.
Answer: I can confirm that your approach works as we do the same thing for the same reason.

Backbone global success handling


Is it allowed to write notes during the "read instructions" stage of a TOEFL exam?

Question: Is it allowed to take notes during the "read instructions" stage of TOEFL? At this stage the timer is stopped and it's a good time to take notes such as drawing tables for speaking and writing sections. But I'm not sure on whether it is allowed in the exam. I'm asking this question because I didn't find any section of the TOEFL rules that addresses this scenario.
Comment: I don't think anyone's written about it because it's not cheating and accepted as a valid strategy, otherwise someone would've written about it. You're gonna get reports like "I tried it and it worked", or "I tried it and I got written up"? ... If you get none of the latter, that's good.
Answer: I watched the test procedure video. At about 2:47 the paper was described as "scratch paper for your use during timed sections of the test". To me, that suggests you are not allowed to write on it outside the timed sections. You should be able to ask during check-in.
Answer: Afaik the sections are sequential so you don't get all the material in one go.
Then the reading time is reading time not writing time.
And I have run these exams in the past following their detailed instructions for each section.
Answer: The 'read instruction' section is before the actual test. It will tell you how the actual test is structured and what you are and aren't allowed to do. It is also available online and doesn't depend on the particular instance of the test you get. So if you do a mock exam in preparation, this mock exam will have the exact same 'read instruction' section as the real test. You can and should familiarize yourself with the general structure of the test before taking it but I don't see what kind of notes you would want to take during this section of the actual TOEFL.


Is C > Am > Em in the key of E minor or in the Key of E phrygian?

Question: I am writing a song with the verse going from C > Am > Em > Em. . I can't think of any other pop/rock songs that use this progression and if anyone can think of any please share as this would be very helpful right now. So I suppose the progression could be either E minor or E phrygian. If the vocal melody above these chords was to exclude the F/F# note would the listener ever feel like there was an implied tonality?
Comment: Could be Em, C, Am or even G, in my opinion...
Comment: wouldn't the piece either need to begin or end in Aminor or Gmajor for those two to be valid options?
Answer: Even though the chords could be taken from E phrygian, it would be very uncommon to say that the given progression is in E phrygian. The reason is that the character note in phrygian is the b2, which would be F in this case, and since the note F does not show up anywhere, the most common interpretation would be to say that the progression is in E minor.
The story would be different if there were a melody over these chords which uses the note F. But if neither F nor F# are used in the melody, this progression is most likely in E minor.
Generally, a mode other than major and minor is only perceived if the chords and/or the melody feature the mode's character note. E.g., it doesn't make much musical sense to say that the progression C-G-C is in C lydian (with the #4, i.e. F#, as character note), even though the chord tones are all part of C lydian.
Comment: hmmm, interesting. I like your thinking. I  think I can agree with you and discard Ephrygian as an option now which is great. But can you discard C major from from the options?
Comment: @armani: Well, what do *you* hear as the "home" chord here? Of course, those 3 chords are also part of C major, A minor, G major, ... But I hear E minor as the key, mainly because the progression leads to the Em chord, where it stays for two bars.
Comment: That is just the thing, I don't know. I guess it could be both? Even though there are two bars of Eminor at the end, I can't say that this is sufficient for saying Eminor, yet I can't say just because it starts with C and that all the chords are from C that it is in C major either. I guess there really is no answer?
Comment: @armani: Since the chords occur in several keys, one could keep arguing. Eventually, it's in the ears/head of the listener, but I dare to say that most musically trained people would perceive that progression to be in the key of E minor. But since it's *your* composition, *you* are the one to decide, and there is not definite right or wrong. As a hint, try to add an F to the melody somewhere to make it fit. Then try the same with F#. My guess is that it will be easier to make the F# sound good, which would imply E minor rather than C major.
Answer: Could be either. Or it could be useful to consider it staying in C major.    What does the melody do?  Any F# notes?
Comment: I wrote it purposefully trying to exclude them so the listener wouldn't know but now I am not sure where to take the song. Have a listen to what I have so far here https://ufile.io/7jqrt
There is a quick short modulation to Dminor at the end before the chorus comes in. I don't know where to go from there. I suppose now there are 3 possibles for the chorus. Eminor, Ephrygian or stay in Dminor after the bridge? what would you do?
Comment: @armani congratz on that piece of music. I can see you've gone about it exactly the right way; following your ears and trying to understand why what you've written feels the way it does. I was originally going to just write a comment, but this warrants a proper answer which I'll probably write tomorrow. In short, you're in Em and then modulating to Cmaj (yes, despite the B flat). Don't get too carried away by the idea of being "in" a mode. Unless writing very strictly nodal music as a choice, it's much more useful to just know what the key centre is. A key is NOT a scale.  Again  great work!
Answer: Seems more like C, although E Phrygian contains the same notes exactly. When it gets written on the stave, you need to decide what the key sig. is going to be, and to me no # or b fits better. At the end of the song, you'll find one particular chord will sound like it fits better than any other. That'll be the decider for the piece's key.
Comment: could it be Eminor?
Comment: It could, I haven't heard it ! C and Am have more in common with Em than Dm does, but that's no great criterion.


What is the .sqlite file for?

Question: I would like to know what the .sqlite file is for. When I use MySql or MongoDB, the database is on disk, its something I never see. The documentation tells me with SQLite, everything is contained in a single disk file. Does this mean this .sqlite file is the database itself (and that it is, like all my other regular files, stored on disk)?
Comment: I'm pretty sure all of those DBs depend on files to exist. They just don't all promise to stick to only one file.
Comment: [This describes what's inside the .sqlite file](https://www.sqlite.org/fileformat.html).
Answer: The <code>.sqlite</code> file is the complete database. It's one of the big features of sqlite in that it's single-file with binary compatibility between platforms.
From the About SQLite page (emphasis added):

SQLite is an embedded SQL database engine. Unlike most other SQL databases, SQLite does not have a separate server process. SQLite reads and writes directly to ordinary disk files. A complete SQL database with multiple tables, indices, triggers, and views, is contained in a single disk file.

For a description of the file format, see Database file format on the sqlite website.
Answer:
Does this mean this .sqlite file is the database itself (and that it is, like all my other regular files, stored on disk)?

Exactly this.
One use case for this design is when you actually want "data files" that can be stored in arbitrary locations and whose content happens to be accessible to your code like an SQL database.

What is the .sqlite file for?


What could be causing tempdb version store growth on primary node in the absence of open/active transactions on readable secondary db?

Question: This is a SQL server 2022 CU10 enterprise edition server, 2 node AG with readable secondary.
30 user dbs are in the AG.
Via an inhouse SQL monitoring tool I observed tempdb version store growth on primary and secondary nodes due to one of the AG dbs (let's call it ProdAppDB), the reason being a long running transaction (running since last 7 hours). Version store usage is now at 7GB, and slowly growing. Tempdb size is 128GB of which 120GB is free. But the tool isn't able to provide any further details as to where the transaction is running for so long (whether on primary or secondary node).
On Primary node, this db (ProdAppDB) is not using snapshot or rcsi isolation. Secondary replica has readable feature of the AG enabled.
Using dmvs (https://stackoverflow.com/a/45568219) I can confirm that:

There are no active/open transactions on the readable secondary node for this db.
There are active/open transactions on the primary node for this db (some are since about 8 hours prior from now).

But when I query sys.dm_exec_sessions/sys.dm_exec_requests then I don't see any query that is actively running.
Questions:

Why is primary node's tempdb version store growing? I am asking because rcsi/snapshot isolation is not enabled on this (or any) primary db. As per doc (https://learn.microsoft.com/en-us/sql/database-engine/availability-groups/windows/active-secondaries-readable-secondary-replicas-always-on-availability-groups?view=sql-server-ver16#bkmk_CapacityPlanning) version store shouldn't be maintained on primary when the isolation level is default.

Why are active/open tran on the primary node db causing version store growth on secondary replica's tempdb? I thought only long SELECTs on readable secondary could result in tempdb version store growth on the secondary node.

Is there anything for me to pin point to a particular to a particular process/tran/query so that I can kill just that one?

Is it correct to say that the only reasons for version store growth could be either due to a long running UPDATE/DELETE transaction (either actively running or sleeping/not yet committed) on primary, or a long running SELECT transaction on the readable secondary that's holding on to version store row. Or is there any other possibility?

Update-
Erik mentioned in a comment that this maybe unrelated to AG, and purely be cause by something else like triggers which also use version store.
Answer:
On Primary node, this db (ProdAppDB) is not using snapshot or rcsi isolation. Secondary replica has readable feature of the AG enabled.

Much as I answered in this question, regardless of having the database level settings enabled, readable secondary replicas will cause read committed to be silently remapped to snapshot. This uses the version store.

Why is primary node's tempdb version store growing? I am asking because rcsi/snapshot isolation is not enabled on this (or any) primary db.

It is enabled, you enabled it by making the secondary database readable.

Why are active/open tran on the primary node db causing version store growth on secondary replica's tempdb? I thought only active/open tran on readable secondary could result in tempdb version store growth on the secondary node.

It can and will do both.

Is there anything for me to pin point to a particular to a particular process/tran/query so that I can kill just that one?

Lots of answers and question about this, I would encourage you to read them.


Is it " a fun place to be" or "a fun place to be at"?

Question: I use "to be" but the more I think abt it the more I think "to be at" should be the one that makes the most sense since we say "we are at a place".
Comment: This is something that may vary between dialects, I think.
Comment: *a fun place to be, a fun place to be **at**, a fun place **at which** to be*. They're just different ways of saying the same thing. But I don't think "dialect" is a relevant term for why any given speaker / writer might choose one version over another. I'd descrbe it as a ***stylistic choice*** (where I'm sure the *first* version is by far the more common choice for almost all contexts and almost all speakers).
Comment: "Where you are at" is an American dialect variation of 'Where you are".
Answer: "A fun place to be" would be more common, although you could certainly hear someone say the second version and no one would look at you weird. It depends on the context, though.
"A fun place to be" would be correct generally because "A fun place to be at" is kind of repetitive and unnecessary, specifically because the verb "be" already completes the idea of the phrase. The "at" isn't adding anything to the phrase -- it's just directing back to the object of the sentence (the fun place), repeating to the listener that the place that they're at is fun.
Substituting other verbs for "be" you'll probably find they also complete the idea without the "at" being necessary. A fun place to run at, A fun place to make money at, a fun place to inflate balloons at, a fun place to stop at.
From another angle, "a fun place to be at one with the universe" makes sense because the word "at" is continuing the initial phrase into a new idea (I'd say this is usually the job of the word "at"). a fun place to be at 5 o'clock, a fun place to be at a stand-still, a fun place to be at a concert.
Using the extra "at" is pretty common, though. A version that is pretty common is "Where are you?" vs "Where are you at?". People also say, "Where you at?"
Thanks!
Comment: thank you! I am not quite sure what you meant by "a fun place to be at one with the universe". Like, what does "what is one with the universe" have to do with at
Comment: @VictorChen nothing, it's just an example of how the word (preposition) 'at' could carry the phrase on to a new idea and add more meaning to it.


Something wrong in my project, using fabric.js

Question:
function loadimg(src){
        var newww=new fabric.Image.fromURL(src,function(img){
            window.canvas.centerObject(img);
            window.canvas.setActiveObject(img);
            window.canvas.add(img);
        },{
            H_PADDING: 20,
            V_PADDING: 50,
        });

    // window.canvas_obj.add(neww);
    add_layer(src);
}

that is my package function to load an image to the canvas and I want to select the image object that was put into canvas by the API  canvas.setActiveObject(canvas.item(i))
but it only finds the item(0), 1, 2, 3. Once more, it can't find it.
Comment: hard to understand what is your problem. can you provide a fiddle with this code running?
Answer: what you need  is to load an image and make it active ?
If so,   i created a jsfiddle example that loads an image and activates it.
var canvas = new fabric.Canvas('c');
canvas.backgroundColor = 'yellow';

var site_url =  'http://fabricjs.com/assets/1.svg';

//i use loadSVGFromURL to load an svg image but it is the same if you would like to use fabric.Image.fromURL() to load your image
fabric.loadSVGFromURL(site_url, function(obj) {
          var img = new fabric.PathGroup(obj, {
          left: 165,
          top: 100,
          width: 295,
          height: 211
        });
//add the loaded image on the canvas
        canvas.add(img);
//activate(select) the image
    canvas.setActiveObject(img);
//render canvas to show the borders on the image
        canvas.renderAll();
          });

jsfiddle : http://jsfiddle.net/tornado1979/v4qzuw9w/
hope helps ,good luck.


The difference between 'painter' vs 'artist '

Question: What is the differences between
' painter ' and ' artist ' ?
I am so confused with it.
Comment: Related: http://ell.stackexchange.com/q/7533/230
Answer: A painter is one who paints (anything, on anything). An artist is one who approaches solving a problem in a non-engineering, heuristic way (for sake of argument, I do realize some engineering solutions can be so beautiful as to be artistic)
A painter is an artist, one who paints signs is a commercial artist, but an artist may not be a painter. ie a sculptor
Without getting too philosophical, the person who makes your coffee might be considered an artist (in making coffee, not as an alternative occupation) in the same way as "beauty is in the eye of the beholder", depends what you think. But they would not be considered a painter.
Answer: In general:
Artist.
Root -> Art (Arts) people who do 'Arts'. It may be performing Arts (i.e., theatre, music, dance), visual arts (i.e., painting, sculpting, multimedia), or combination.
Painter.
Root -> paint. A person who makes paintings.
Comment: A painter might not be creating a work of art - the word *painter* is used to describe someone painting the exterior of a house, for example, while if an artist did that, we'd be expecting the side of the house to have a pretty picture on it.
Comment: Yes, I agree. Take note that I mentioned 'in general', considering that both words the post provided lead to some confusion regarding some arts-related matter, presumably. Thank you for your comment - disambiguation.