Is there a way to set crawl to go through columns in a document library but not within a document?

Question: I have a document library in which I need to crawl the columns within that library but not crawl the text within the documents themselves.  The documents are OCR'd pdf's from a scanner.  Is there a way to set this up?
Answer: By default SP won't index PDF unless you installed an iFilter to do so. So, if you don't have an iFilter, no need to worry, it won't get indexed.
On the other hand if you do have an iFilter for PDF indexing,  you are in for some work to exclude only parts of a crawl, there are no "settings" you can configure for this type of scenario.
The only work around I can readily think of (and this is theory) would be to convert from a document library to a list with a document attachment, then in Central Administration exclude the document URL from search results.  Anything containing that URL in search will be removed.
Since columns in a doc library will be linked with that document, the doc link would be a part of search results and thus removed from all indexes including your column entries.
As a list attachment it's just another column item and you would only be excluding that column link, not the others, so you should still be able to search on the other column data.
Outside of this, you will probably need to dig into the Search Object Model for a solution.  For a large amount of items this is a lot of work, and if it needs to continually be updated, you probably need to look at automating it via the object model anyway.
If it didn't, help I hope it gave you some ideas.
Comment: Unfortunately we needed the iFilter with our server.  We will be making a new web application for these documents, but we have to use a library and not a list.  We have some automated solutions that need a library so I will look into the Search Object Model.  Thank you for the ideas.


Flash Actionscript 3.0 Audio Scrubber

Question: So I've been working on a Flash audio player for my website, and I'm trying to make a scrubber for the player. With the scrubber, a person will be able to drag the little bubble to fast-forward or rewind the song to a certain part.
What I have tried so far is this: I have made a player head that moves in a designated line proportionally to how much the progress bar has moved. Since I have an instance of a progress bar, progressBar, and a sprite progressBubble (aka the player head), they do not seem to integrate very well.
My question is, is there some kind of player head object that one can use specifically for progress bars? In any case, how can this scrubber be done?
(And I am new/not a big fan of Flash, and I have Googled, YouTubed, looked at Adobe's API,etc. for quite some time now and I can't figure out how to do this. If you can help me, you'll be my hero and I'll be grateful.)
Answer: Yes. There are many great widget kits. One of my favorites is at http://www.minimalcomps.com/?page_id=5

Flash Actionscript 3.0 Audio Scrubber


preg replace complete word using partial patterns in PHP

Question: I am using preg_replace($oldWords, $newWords, $string); to replace an array of words.
I wish to replace all words starting with foo into hello, and all words starting with bar into world
i.e foo123 should change to hello , foobar should change to hello, barx5 should change to world, etc.
If my arrays are defined as:
$oldWords = array('/foo/', '/bar/');
$newWords = array('hello', 'world');

then foo123 changes to hello123 and not hello. similarly barx5 changes to worldx5 and not world
How do I replace the complete matched word?
Thanks.
Answer: one way to do it is to loop through the array checking each word, since we are only checking the first three letters I would use a substr() instead of a regex because regex functions are slower.
    foreach( $oldWords as $word ) {

        $newWord = substr( $word, 0, 2 );

        if( $newWord === 'foo'  ) {
            $word = 'hello';
        }
        else if( $newWord === 'bar' ) {
            $word = 'world';
        }

    };

Answer: This is actually pretty simple if you understand regex, as well as how preg_replace works.
Firstly, your replacement arrays are incorrectly formed.  What is:
$oldWords = array('\foo\', '\bar\');

Should instead be:
$oldWords = array('/foo/', '/bar/');

As the backslash in php escapes the character after it, meaning your strings were getting turned into non-strings, and it was messing up the rest of your code.
As to your actual question, however, you can achieve the desired effect with this:
$oldWords = array('/foo\w*/', '/bar\w*/');

\w matches any word character, while * is a quantifier either meaning 0 or any number of matches.
Adding in those two items will cause the regex to match any string with foo and x number of word-characters directly after it, which is what preg_replace then replaces; the match.


Freeze after startup

Question: I just installed Ubuntu 12.04 on my computer. At first it worked just fine, but when i started updating the system just "updated" the screen, and then freezed. Same thing happens when I log in. Any tip?
Comment: I had a similar problem. My machine has a 'hybrid' Intel / AMD graphics setup. If you have the same, you may find you installed the AMD driver when updating your system. When the AMD driver is installed, the screen 'freezes' after you log in. To fix it, I followed the instructions in post 107 on the following thread: http://ubuntuforums.org/showthread.php?t=1930450&page=11
Comment: Welcome to Ask Ubuntu! This question should instead be filed as a bug report, and [as such](http://meta.askubuntu.com/questions/1317/what-to-do-with-questions-that-describe-known-bugs/) is off-topic, thanks! [Instructions on filing a bug report are here](http://askubuntu.com/questions/5121/how-do-i-report-a-bug).
Answer: I had a lot of problem when updated to 12.04.
What i've done was in a console ( ctr + alt + f1 ) to uninstall the packages xserver-xorg, ubuntu-desktop (and fglrx packages because i have an ati)
To uninstall:

sudo apt-get remove --purge xserver-xorg ubuntu-desktop

After doing this you may have uninstalled some usufull packages like gnome. Before uninstall check the packages that apt-get uninstalled to manually do that when you reinstall again the packages.

sudo apt-get install xserver-xorg ubuntu-desktop

--------- [init] DO YOU HAVE AN ATI?----------------

sudo apt-get remove --purge fglrx*

Then try to install your graphic card drivers property. If you have an ati:
http://support.amd.com/us/gpudownload/Pages/index.aspx
(download it before you uninstall these packages)
I also recommend do check this post: X doesn't start after Upgrade from 11.10 to 12.04
--------- [END] DO YOU HAVE AN ATI?----------------
Before you try this you can also try to run the command:

apt-get install --reinstall xserver-xorg ubuntu-desktop

Good luck.

Freeze after startup


Where can I find quarterly earnings-per-share data for the major U.S. market indices?

Question: Where (on what website) can I find last few years' worth of quarterly earnings-per-share for the Russell 3000? and the Dow?
Comment: Have you tried contacting the index makers to see if they have this data?  That would be my suggestion though it is worth noting that as companies have different quarter ends, it isn't that easy to generate a quarterly EPS for the index easily.
Answer: This will be difficult, as the composition of the Russell 3000 will change from year to year. The same is true for the Dow (assuming you mean DJIA), but there are rather fewer members of that index! Companies don't all have the same fiscal years or quarter end dates, which further complicates this.
In order to get correct data, you'll need to contact whomever maintains each index. That will be the best source, although it is unlikely to be free of charge.
There is a list of price to earnings ratios and other U.S. equity index data, mostly aggregate though.


Restricting AdSense ads' language

Question: My users are seeing (spammy) English ads on my website that's geared purely towards native speakers of another language many of whom know no English. I would like to restrict the language of AdSense ads to that language. Is it possible, and how?
Comment: Keep in mind that AdSense ads are targeted to individuals.   The ads that you see on your own website are the ones that are chosen *for you*.  The ads that your visitors see are not likely to be the same ones.
Answer: According to Google itself

Language targeting: Our technology can also determine the primary language of a page. If your content is in a language supported by our program, AdSense will target ads in the appropriate language to your content. We may look at the language of the pages a user is currently viewing, or has recently viewed, to determine which ads to show. In this case, AdSense may target ads in the user's detected language rather than in the language of your content. Learn more about ad targeting by language.

https://support.google.com/adsense/answer/9713?hl=en

In addition, we may look at the language of the pages a user is viewing or has recently viewed to determine which ads to show. This means that we may detect the language from either pages that the person had viewed in the past, or the page that they are currently viewing. In this case, AdSense may target ads in the user's detected language rather than in the language of your content.

https://support.google.com/adsense/answer/2753586?hl=en
I would look also at your page language declaration in the . Is it set correcty as the language of the document content?
Anyway, you should report a violation if you see spammy ads as Google suggest here https://support.google.com/adsense/answer/2631197?hl=en
Comment: So basically, the answer is that you can hint, but not restrict?
Comment: Also, the language is set in ``, is that what you mean or should it be declared elsewhere?
Comment: Yes. About the language: yes, you should declare it inside the html tag. What's the language of your document? Anyway: I think it's just a tiny hint (the content itself speaks) for helping crawlers to understand. As you saw, the decision depends on the AdSense system.

Restricting AdSense ads' language


Bjerksund and Stensland model, reasonable minimum value for Volatility?

Question: I am looking at an implementation of Bjerksund and Stensland (2006), and notice that it doesn't work well for very small volatilities. What is a reasonable minimum volatility to use in an algorithm for calculating the implied volatility?
Comment: In what way does it not work that well? Are there problems in the limits for the numerical implementation of the normal distribution? Or are the problems specific to details of the Bjerksund and Stensland model?
Comment: From what I saw when debugging, the issue is related to practical considerations when implementing in software. Putting a very small value for volatility can lead to very large values for phi that don't fit in a "double" value.
Answer: After some testing, it is clear that a value of 0.005 is the most reasonable minimum volatility to use with this model.
It is small enough to be a reasonable starting point (extremely unlikely that the real volatility of an option will be lower than this), while still being sufficiently high enough to avoid numerical issues when calculating implied volatility for out of the money options.


Can I trickle charge battery through OBD2 port 2007 civic

Question: Trying to determine if 2007 civic OBD2 port is live with key off so I can trickle charge with a solar panel
Comment: Welcome to Motor Vehicle Maintenance & Repair!
Comment: just because some thing is possible does not mean you shuld do it,it might be better to connect the charger to the plus on your ignition switch.
Comment: It's not what you ask, but I charge the battery through the main cigar lighter point, which  is always live. This works on both my cars, one is 16 years old, the other is 3 years old. I replaced the battery clamps on the charger with a cigar-socket plug, making the recharging job much easier (I shut the car door with the mains cable at the bottom corner away from the hinges and there is plenty of room in the footwell for the charger). The cigar point being what it is - for a heater element - it can handle a normal charging current. I don't attempt to activate the ignition etc. while I do this.
Answer: The 12v pin on the OBDII should be constant on regardless of the key position. Here is the pin out:

You can test it with a multimeter to ensure it is this way in your vehicle.
Whether it will work for trickle charging with a solar panel has yet to be seen, but always worth a go.
Comment: Pretty much this. It's worth bearing in mind that the wiring to the OBD port isn't generally high-gauge stuff, a low-current (<1A) float charger shouldn't be a problem though.
Comment: @edwardpeters - If this answers your question, please consider an upvote and select as the answer.
Comment: The device is a purpose built Coleman solar trickle charger, sounds like it should work. Thanks


When to check for confirmationsl

Question: When monitoring incoming transactions for a web wallet, should I check for confirmations on a timer, e.g. every minute? Or should I check once every block by using blocknotify?
Answer: This is a nice chart on the average transaction confirmation time: https://blockchain.info/charts/avg-confirmation-time that will give you a better estimation on how often you should check.
Also related: What keeps the average block time at 10 minutes?
Comment: I guess what I want to ask is this - given that bitcoind can notify me when a new block is received, is there any point checking more than once per block?
Comment: @George, Did the chart at https://blockchain.info/charts/avg-confirmation-time really sample *all* transactions? Or do they only sample like 1 transaction per day?
Answer: It depends how quickly you would like to notify the customer of their payment being accepted. When I make a deposit/payment, I would like to see it as soon as possible. I always get that uneasy feeling during the time between when I send coins and when I see it confirm in my account.
If I were you I would say every minute is acceptable (and easy to set up a cron for), I would notify when the payment has been seen (rawmempool), and when it has been confirmed the required amount of times to send or spend.
Comment: I guess what I want to ask is this - given that bitcoind can notify me when a new block is received, is there any point checking more than once per block?
Comment: If you would like to check for new unconfirmed transactions, yes, otherwise it would not be needed. I like seeing that my deposit was accepted asap, but truth be told this is not critical for payment processing. If you'd like to notify your customers that you have seen their payment sooner, then you can write a cron; if you just want to notify them their payment has been processed block notify should do the trick. Either way, the user will get used to how you process transactions. If you go with using block notify only you should expect clients to send you emails while they wait.
Comment: Thanks Mark. I use the walletnotify option to pick up transactions as soon as they are broadcast, and there doesn't seem to be any point in checking more than once per block. Think I have my way forward :)
Answer: Every 30-60 seconds should be sufficient, but if you have access to a service that will notify you when blocks are found, that would be the fastest. A confirmation is just a block being found. Once the transaction is included in a block, that's its first confirmation (and it is no longer unconfirmed). Every block that stems from that block afterward is another confirmation.
Comment: No, a block is a confirmation. Therefore it's impossible for a confirmation to happen between blocks.
Comment: Well this was kinda my thought. bitcoind uses the blocknotify config parameter to notify you on every block, so is there any need to check more than once per block?

When to check for confirmationsl


What is the sugya for wall-writing?

Question: Where is the sugya in Shabbat for the prohibition of reading text written on a wall on shabbat? I learned this the other week, but I cannot remember the daf.
Answer: Maybe you were learning Shabbos 149a, "מאי בינייהו א"ב דכתב אכותל ומידלי" regarding counting the guests and their portions on Shabbos.
Comment: Thanks, @AvrohomYitzchok, we were learning from photocopies which were missing the top of the daf.

What is the sugya for wall-writing?


What is the difference between straining and using a French press?

Question: Logic tells me that both should be the same because they both just strain the grounds. Is there any added effect of pressing down the plunger in French press?
Answer: I would say no, there is no macroscopic difference.
Actually, some people (notably James Hoffmann) advise not to press the plunger all the way down since it agitates the grounds and this could result in having more fines in the cup. You are perfectly fine using a strainer, but depending on how big the holes are you could get more fines.
The only difference could arise by squeezing the grounds with the plunger. Maybe that way you could get an additional tiny fraction of extraction, but I believe it would be more or less undetectable.
In any case, it's a simple experiment you could try at home to convince yourself!
Answer: In terms of extraction (as in "Total Dissolved Solids") there is very little difference. However, in terms of "mouthfeel" there is a very noticeable difference, which I'm sure everybody can taste when presented two cups side by side, feel free to try for yourself if you have friend with a second french press. Pressing down the plunger undoubtedly agitates the coffee, even if you do not press through the grounds themselves. This results in more suspended fines, which yields a cup that feels sandy and gritty. If you use the plunger only as a strainer and pour gently, the resulting brew will feel clearer and crisper, since more of the suspended material will have fallen out of solution.


Name, Place, Animal, Thing

Question: Which famous South African's image can replace the question mark and why?
Comment: @Prim3numbah His name is rot13(Qba Gbk). He is not that popular I guess.
Comment: I first thought the second person was rot13(Nxba, ohg gura V fnj gur anzr Cngevpx.... ba gur fvqr bs gur vzntr ohg fgvyy V pna'g frrz gb trg n uvg ivn vzntr frnepu.)
Answer: The famous  South African should be

 Elon Musk

The name of the two first people

 1. IDA Flo  2. Don Tox  IDA Flo is under "place" and now we switch place of the two and get Flo IDA. Add an R in between and we get Florida. Same thing with Don Tox, switch place of the two and you get Tox Don. Add an O in between and you get  Toxodon which is an extinct animal.

Now for the "thing" which is suppose to be represented by a famous South African

 my mind immediately thought of Nelson Mandela (which doesn't look promising since no word can be made by Mandela(?)Nelson but then I thought of Elon Musk. And indeed if we switch place of the two: Musk Elon we can, by adding an M in between, create the word Muskmelon which is a "thing" (fruit)

Here is an image:

Answer:
 Ah so I had the thing as: ENABLER

 Switching 'ENA' and 'LER you get LERENA - the South African boxer.

 Also the 'R' 'O' and 'B' added letters neatly spells the name 'ROB'.

 Muskmelon is more of a thing than an enabler though! Fair play

Name, Place, Animal, Thing


Why did they make the Head Gamemaker Seneca Crane kill himself in The Hunger Games?

Question: I don't understand why they locked him in a room with nightlock (kills you fast) what did he do?
Answer: Katniss and Peeta defied the rules of the game and made Snow and the Capitol look weak.
Seneca Crane was the Hunger Games Master and the public face of the failure, and also the one who changed the rules of the Hunger Games in the first place, allowing Katniss and Peeta to make their stand together. Ordinarily, even the tributes from the same district must turn on one another. But because of Seneca's attempt at crowd-pleasing, Katniss and Peeta get their chance to die in defiance of the Capitol.
President Snow blamed Seneca for this. Snow knew that the public defiance of the Capital would only lead to further uprisings, and set in motion his attempts to spin Katniss and Peeta as a pair of desperate lovers, rather than headstrong rebels.
Snow devised the punishment as a paradox: to eat the poisoned berries for a quick and sure death, or wait with no escape and no other sustenance to either starve or spark the further displeasure, which could lead to a more painful death. Snow has a twisted sense of justice and a thirst for blood and vengeance. He views the death trap as a poetic or symbolic punishment, itself embodying the Hunger Games Seneca failed to conclude properly.
Comment: this should be the accepted answer :)
Comment: I agree! Thanks for the assist Dacio and Major Stackings. I would divide the rep with you if I could...
Comment: I believe this particular method of execution was meant to symbolize control and choice. Seneca unwittingly gave Kat and Peeta control over their own fates; a concept which Snow knows could grow like a weed amongst the oppressed masses. His entire power base relies on the perception that he has absolute control over every life in every district. Seneca fractured that perception in front of the entire nation by not taking away Kat and Peeta's choice of life or death. So Snow executes Seneca in a very poetic way, by giving him a choice of how he dies.
Answer: Seneca Crane was the head Gamemaker until after the 74th Hunger Games.
About halfway through the games, he had announced that there could be two victors if they were from the same district. Katniss and Peeta saw this chance and took it, but once they had killed Cato, Crane announced that there could only be one victor. His plan all along was to have Katniss kill Peeta or vice versa, because that's what the people in the Capitol love, but it went awry when Katniss suggested a double-suicide.
There had to be a victor, so Crane allowed both of them to win, but Snow wasn't pleased. He had seen Katniss as the leader of the rebellion as soon as she had suggested the suicide instead of killing Peeta, so he wanted to take it out on someone. That someone was Seneca Crane, the man who had let the two tributes win. He locked Crane in a room with nothing but a bowl of Nightlock - the berries that Katniss and Peeta were going to eat for the double-suicide. His only choices were to eat the Nightlock and die almost instantly, or to die of thirst and hunger. He chose the nightlock so that he could save himself from a painful and long death.


'SO' instead of 'Stack Overflow' or 'SE' instead of 'Stack Exchange' - Which will be more preferred

Question: Is it okay if we mention 'SO' instead of 'Stack Overflow' or 'SE' instead of 'Stack Exchange' in question-answer communication on Stack Exchange Network? Which will be more preferred or which is a good practice?
Comment: Sure it's okay. Your choice of words is absolutely up to you
Comment: In what context?
Comment: @Oded In question-answers communication on Stack Exchange Network.
Answer: If you are talking about Stack Overflow specifically, you should talk about SO. Just like if you are talking about one of the other specific sites, you should say so - e.g. Database Administrators is typically referred to as dba.SE.
If you are talking about the entire network, then you should talk about SE. If you talk about SO in this context, people will think you are referring only to SO.
EDIT
Whether you use the full words or the abbreviations is entirely up to you. In certain chat rooms I use the abbreviations out of laziness, because I know everyone in the room knows what I'm talking about. On the public site, I tend to use the full name, because I don't gain much at all by saving a few keystrokes, and using the abbreviation just opens the door to have to explain to someone who asks "What do you mean by SO?"
Comment: I think OP is referring to using initialisms instead of the full names, not asking whether he can refer to SE as SO.
Comment: @MatthewRead I see
Comment: Note, posting SO or SE here on Meta is temporary - we have a user hunting down for those (even long years after posted) and changing to the full name. [example](http://meta.stackoverflow.com/posts/102747/revisions) - and he got hundreds. :)
Comment: I definitely prefer the longer version. In chat I think it's casual enough and, as I said, I know that just about everyone reading knows exactly what I'm talking about. Outside of chat, that user is not going to find many corrections to make in my posts. :-)


Why is it called MagSafe?

Question: I still get confused sometimes at the name MagSafe. Has it anything to do with the magnet in it? Why MagSafe? is it safer than other adapters?
Answer: The magnet can save your computer.
Let's suppose it's on a table connected to AC. If someone pull the cable with his foot by just walking by, the MacBook won't fall on the floor, the magsafe will just pop.
Comment: You're right man, I've thought about that many times and it has actually happened one or two times. The name does makes sense after all. It's just that I've never thought too deep about the name and always thought it was MacSafe and not Mag, only when I actually wrote the question here did it really occur to me that it is Mag as in magnet.
Answer: This is well answered by Wikipedia's article on MagSafe.
Summary: to obviate expensive repairs to connectors and laptops when users tripped over their power cords, Apple designed a connector that would stay connected mag-netically under normal circumstances, but which would safe-ly disconnect when the power cords (or laptops) were suddenly pulled away.
Comment: That's just brilliant innovation.

Why is it called MagSafe?


jQuery Image Slider - with images on either side of the main image

Question: I realise there are hundreds of tutorials on the net on how to create a jQuery image slider. However, none of them quite relate to what I'm trying to do...
I have a set of images that are about 350px in height and 800px wide. What I really want to do is to have these images at the top of the page, and have them slide through (like seen in many sliders). The only difference is, I really want the other 2 images on either side of the main image in focus. So when the image slides in, you can see it from the left. And the image that has just left the main focus can still be seen it from the right. Obviously the left and right images to the sides of the main image will be slightly off the page.
The reason I want this is so I can have a full size website that caters for all resolutions. Also, I plan to make this site responsive so when the page shrinks, the 2 pictures on either side are no longer needed. I hope I've made this clear. I'm just wondering if there are any examples of this out there?
As a "nice to have", it would also be great to have an image selecter too!
Thanks.
Answer: You can try this......
Hero Carousel
it might fit your description.
Here's another link which might gather to your need.
http://jsfiddle.net/JCQ6Q/15/
Vote up if it helps you :) all the best


dell 17 5755 with ubuntu 16.04.01

Question: i just bought a dell laptop ,i installed ubuntu 16.04 . i fixeditso when i close the lid  i can still use the laptop. i noticed when i closed the lid of the laptop it goes blank  but  its still on my hdtv . i figurrd it went into hibernation, but how can i use the laptop in hibernation mode . did i just turn the laptop monitor off but the laptop itself is still running , and will it hurt my laptop to use it this way ??? its hooked up with the hdmi port thru my surround sound system in the blu ray hdmi slot.  so if i want to watch regular tv i press cable on the remote and when i press  dvd button  the laptop picture is instantly there. so ,is my laptop running non stop ???
Answer: you answered your own question  "I fixed it so I can use the laptop when the lid is closed".  the computer is still running. closing the lid only turns off the screen, you can change this behavior in system setting.

dell 17 5755 with ubuntu 16.04.01


Plugin Strategy For MVC 5 Site

Question: I am working on setting up a multi-tenant site, where users can select a theme.  Each of these themes have different settings, so I would like someone to be able to select a theme and then when they edit their site settings it would bring up a form to allow that.  I am sure I could do this through hard coding data, but it would seem that I would be better off using plugins to allow new theme plugins to be added and remove the need to magic strings or having to create a dynamic settings page that reads what fields to display from a database.  There is plenty of documentation on things like MEF, but I need some help on figuring out how to display a unique view for each theme and then store the results.  Any help or direction would be appreciated.
Comment: Do you really need a plugin architecture for this, or would serving a CSS file on a per-user basis suffice?
Comment: @RobertHarvey Yes, because it is more than just css.  Some themes will allow logos or customized feeds.
Answer: You do not need MEF or plugabble stuff. Using IoC container will be enough for MVC5 I have used Windsor Castle with great success and lately also Autofac.
Then you have all your controllers made by factory and you can have service for selecting layout in your controller. With this service you query database for user settings and set your model/viewbag with needed info. I did something like it for silent release where only pilot users got new look and new features aka feature switch.
Also you can switch your layout by using "_ViewStart.cshtml"

The _ViewStart file can be used to define common view code that you
  want to execute at the start of each View's rendering. For example, we
  could write code within our _ViewStart.cshtml file to programmatically
  set the Layout property for each View to be the SiteLayout.cshtml file
  by default.

https://www.codeproject.com/articles/808894/ioc-in-asp-net-mvc-using-autofac
http://www.c-sharpcorner.com/UploadFile/dacca2/implement-ioc-using-unity-in-mvc-5/
On finishing note you can also do it with static class that has config from database but then you have to do a lot of ifs.

Plugin Strategy For MVC 5 Site


How to set breakpoints in inline Javascript in Google Chrome?

Question: When I open Developer Tools in Google Chrome, I see all kinds of features like Profiles, Timelines, and Audits, but basic functionality like being able to set breakpoints both in js files and within html and javascript code is missing! I tried to use the javascript console, which itself is buggy - for example, once it encounters a JS error, I cannot get out of it unless I refresh the whole page. Can someone help?
Comment: I gave up with Chrome. Tried with Firefox and had my breakpoint hit within a few seconds. It may be possible with Chrome but it's certainly not obvious how!
Comment: @OliverP I also suggest trying Firefox when things sometimes don't work in Chrome. I have some inline scripts in a `.php` file and Chrome just couldn't show the source file in `Source` Tab of Chrome devtool. I tried Firefox and everything works as expected.
Answer: Are you talking about code within
ofcourse replace "somename" by some name ;) and then you will see it in the chrome debugger at "Sources > top > (no domain) > somename.js" as a normal script and you will be able to debug it like other scripts
Comment: I would give you 1000 upvotes if I could ;)
Very useful trick
Comment: easiest and perfect way to go.
but note for others, remember to remove it before pushing it to production.
Comment: Oh my god you have no idea how much this helped me. Oh my god this is brilliant. I've been searching for something like this for ages.
Comment: @ZameerFouzan, why do you need to remove it from production? any real side effect?
Comment: I used this (fine) idea, but couldn't see the new file in sources tab, only the html file. Then I executed the code and, at the end, in the console, at the right of whatever message written from the script, you can see a link to the code. The best part is that the link shows the file name you gave to the script (ie, //# sourceURL=somename.js).
Comment: this so useful that I will name the js after you going forward
Answer: Use the sources tab, you can set breakpoints in JavaScript there. In the directory tree underneath it (with the up and down arrow in it), you can select the file you want to debug. You can get out of an error by pressing resume on the right-hand side of the same tab.
Comment: @ulu, I had the same problem.  Make sure your type="text/javascript" attribute is set on your
Comment: For some reason I see the list of included js files, but I cannot choose the executing page itself, it doesn't show in the list. Any ideas?
Comment: except that in HTML5 this attribute is no longer mandatory. I am not changing the source code just to debug !
Comment: I dont see even after adding type="text/javascript"
Comment: if this does not work, and you have inline javascript code like: `` add in a name like: ``   [This is explained better in an answer below](https://stackoverflow.com/a/39156149/65223)
Comment: For me the HTML file appeared blank in the 'Sources' until I refreshed the page - then I could see the code and set breakpoints.
Comment: how do you add an actual breakpoint tho? do i just use `return false` or something?
Answer: Refresh the page containing the script whilst the developer tools are open on the scripts tab. This will add a (program) entry in the file list which shows the html of the page including the script. From here you can add breakpoints.
Comment: Thanks! Using Chrome 69, this worked even if I wasn't in the sources tab. Having the developer tools open while the page loaded seems to be the key.
Comment: This didn't work for me. Instead, I clicked on a script error icon in the bottom right to open the program file in the scripts tab.
Comment: This would have been the accepted answer if this was my question. Thank you.
Comment: Worked in Chrome 83. In my env, the filename is based on the URL of your app. For example, if the URL is example.com/xxx/yyy, the filename will be "yyy".
Answer: Another intuitive simple trick to debug especially script inside html returned by ajax, is to temporary put console.log("test") inside the script.
Once you have fired the event, open up the console tab inside the developer tools.
you will see the source file link shown up at the right side of the "test" debug print statement. just click on the source (something like VM4xxx) and you can now set the break point.
P.S.: besides, you can consider to put "debugger" statement if you are using chrome, like what is being suggested by @Matt Ball
Comment: This is the one I always used to use earlier. Thanks a ton for the reminder.
Answer: My situation and what I did to fix it:
I have a javascript file included on an HTML page as follows:
Page Name: test.html
<!DOCTYPE html>

        <title>Test debugging JS in Chrome</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

Now entering the Javascript Debugger in Chrome, I click the Scripts Tab, and drop down the list as shown above. I can clearly see scripts/common.js however I could NOT see the current html page test.html in the drop down, therefore I could not debug the embedded javascript:

That was perplexing. However, when I removed the obsolete type="text/javascript" from the embedded script:

..and refreshed / reloaded the page, voila, it appeared in the drop down list, and all was well again.
I hope this is helpful to anyone who is having issues debugging embedded javascript on an html page.
Comment: It doesn't have anything to do with type. The script is collected by VM after execution unless inspector is already opened at this point. When you reloaded the page it didn't collect the script.
Comment: Good job! Tested in Chrome 20.0.1132.57 on Mac 10.7.4
Submitted bug to Chromium project.
Comment: Be aware that in HTML 4 and XHTML, `type` is a required attribute.  In HTML5, it's optional.
Comment: I'm my case, missing `` prevented me from seeing the code in the debugger
Answer: I was having the same problem too, how to debug JavaScript that is inside
Answer: for someone like me: just want to

(add breakpoint to) debug normal js code

 inside/embedded html

Steps:

Sources -> Page -> Top -> find your html -> click -> right side show html and js script -> add breakpoint -> debug
Answer: None of the answers above worked for my case: wanting to add a breakpoint to an already-running script, that had been inserted into the page as a


What is the correct word for "turn off lamp" for a non-electric lamp?

Question: We often say turn off the lights. Is it correct to say turn off the lamp when referring to a non-electric lamp (lit by fire)?
That doesn't sound proper. Which is the better phrase to use there?
Comment: If it's a gas lamp, "turn off" would work, and in fact I think it's originally where the phrase comes from, as you'd physically turn the gas valve. You're right that "turn off the lamp" for some reason doesn't sound perfectly right but "Turn the lamp off" sounds fine to me as a native British English speaker.
Comment: Another option would be 'extinguish the lamp'.
Comment: "Turn off" is completely fine too.  Many oil lamps have a wick that is adjustable by a knob on the side, and turning the knob in a certain direction causes the wick to retract, extinguishing the flame.  It would be interesting to investigate the full etymology of the phrase "turn off".
Comment: Is "turn off" really derived from turning a rotary switch ... or by turning (moving) it off the circuit?
Answer: If the lamp is lit by actual fire, I'd probably say:

Put out the lamp.

This is like how you "put out" a barbeque or a camping fire.
Note that, at least where I am, "lamp" and "light" are now synonymous and it took me a while to figure out what difference you were implying between the electric lightbulb and your "lamp".
Comment: @MaulikV As a native speaker I would say "put the light *outside*" if I wanted somebody to take it out of the room. "Put the light out" almost always means "switch the light off" or "extinguish it."
Comment: This is the correct answer, for a lamp that burns. "Extinguish" (as in @pew's answer) does work too, but is much more formal.
Comment: @MaulikV - 'put out the light' and 'put the light out' can BOTH mean either 'extinguish the light' or 'take the light outside'.
Comment: @MaulikV Yeah, I would quite probably say "put the lamp out" meaning "turn the lamp off". British English.
Comment: See the fun... put the lamp out would mean all different! Just changing the place makes a lot of difference!
Comment: I don't think so! If I want to instruct that the dark is out there, and in the room I don't need the lamp I'd certainly say, "Put the lamp out; I don't require it here!" Something like "Put/keep the shoes out, they smell!" @Dan
Answer: you can use douse the lamp or extinguish the lamp for a fire-lit lamp.
Comment: A modern American English speaker likely would expect that you were asking to douse the lamp with _water_.
Comment: @JakobWeisblat, Sounds like a term of art. The first two definitions of "douse" in my U.S.A'n dictionary are all about soaking things with water.  The third definition says, to extinguish something such as a lamp or a fire.  It's easy to see where the first two came from.  If one wanted to douse a camp fire, then a bucket of water would be useful. Once enough Americans got used to the idea that dousing fires is something you do with buckets of water, then they likely began to wonder what _else_ could be doused with buckets of water.  Teen-age children sleeping past noon, etc.?
Comment: Maybe mariner use only --"douse the glim"
Comment: @jameslarge in the theatrical lighting industry when you turn off the lamp in an arc-lamp fixture without killing power to the fixture itself, that's dousing.
Comment: I would go for douse as a non-native English speaker. Have to admit I rarely hear that :)
Comment: strictly anecdotal, but my Iowa-born & raised wife says "douse the lights" and sometimes even "douse the glim",
Answer: A single word for ending fires of all kinds: extinguish:

(transitive) to put out, as in fire; to end burning; to quench

This works for all kinds of flame lamps equally well (as does the original, put out):

candles: snuff, snuff out, put out, extinguish
gas lights: turn off, put out, extinguish
oil lamps: turn off, put out, extinguish
burning torches: douse, put out, extinguish

"Extinguish" and "put out" also appropriate for electric lights, for which I'd not use any of the other terms above.
Comment: As an AmE native speaker, I would **never** say that I "extinguished" an electric light. "Turned off" is my preferred term.
Answer: "Turn out the lamp" was also used more than 'off' in the times when lamps were oil or gas - see this ngram search.
Comment: Which more closely matches the way we always said "turn out the light(s)," growing up. This slowly morphed into "switch off the light(s)." With "turn" referencing the knob on the gas lamp, or the wick raiser on an oil lamp, and "switch" referring to the physical electric switch.
Comment: Drat, you beat me to it.  We'd turn down the lamp, then blow it out.  Shortened, it'd be "Turn out the lamp."  You don't want to completely lower the burning wick until it's extinguished by the roller, as you run the risk of doing it too quickly and dropping the still burning wick into the oil reserve.  At that point *bad things happen.*   A web commentary with similar advice: http://www.livingasimplelife.com/an-evening-with-oil-lamps/
Answer: Snuff or Snuff out applies specifically to lights based on fire: lamps, candles, torches. It's perhaps a little bit old fashioned (though so are fire-based lights!)
Answer: Your two choices in your scenario are

Turn off the lamp.

which is most idiomatic. Another possibility might be

Shut off the lamp.

but less often used.
Comment: @Vinod I think it could be used if it is turned off by stopping a supply of fuel (AIUI the phrase originates from gas lamps) but not for e.g. a candle.
Comment: Can that be used if lamp is lit by fire and not an electric one ?
Comment: I think many people are assuming a candle or oil lamp with their answers, but for a gas lamp, this is probably the best choice.
Answer: Blow out is an other precise phrase which can be used in this context.
It means:

Be extinguished by an air current.

Example usage:

She blew out the candles, posed graciously for countless photographs and accepted cheek kisses galore.
Seattle TimesNov 29, 2016


Does a good amp have to be heavy?

Question: In my (pretty limited) experience, electric guitar amps seem to get heavier as they get more expensive... is this a general rule and if so, why? What makes even a relatively small amp (like a 50W $2000 Mesa) so heavy (~25kg) and how is this linked to quality?
Comment: Most good amps are heavy, but being heavy itself does not necessarily make it a good amp.
Comment: Are we just talking heads or are we including speaker cabs?
Comment: @NeilMeyer I was meaning the combined unit, I don't know which part the weight goes to mainly!
Answer: There are mainly three factors to this:

Powerful speakers need (or at least used to need) heavy magnets.
Lightweight cabinets tend to be less "acoustically stable" than heavy ones. And more easily damaged when handled roughly.
50 Hz transformers need a lot of windings around fat iron cores. (Plus, tube amps also need output transformers. And, the more power you want, the more cooling you need...)

These points have gotten somewhat less relevant as technology marched on: there are now pretty light PA speakers and bass cabinets available, which use neodymium magnets and clever structural engineering to get loud levels and even sound properties. And, switching power supplies can be built much lighter than traditional transformers at the same power ratings. Class-D amplifiers need almost no cooling. And a light composite chassis can be quite as sturdy as a heavy wooden crate.
However:

Guitarists have something of a tendency to avoid modern technology in favour of "vintage", regardless if that makes any sense sound-wise
Guitar cab's aren't meant to sound good in the HiFi sense, but colour the sound in certain manners. Both naïvely designed light and simple heavy-duty cabs will do this, in different ways (cheap & light ones often in ways that even guitarist don't like), whereas PA speakers that are more or less trimmed for linear response just sound boring for guitar (though this can of course change when combined with a good digital cab sim).
 Similarly, non-switching power supplies (in particular with tube-diode rectifiers) have certain properties which are technically non-optimal, but actually work out positively musically.
Comment: The last point is important: expensive amps presuppose gigs and if the cabinet is not well-built, it **will** break in the truck/trunk eventually.
Comment: You forgot transformers. I still haven't heard a solid state design that sounds as good as a tube amp, and tube amps require both power transformers and output transformers. At least in terms of output transformers, the bigger the better sounding, and those things are dense chunks of metal that therefore add a lot of weight to a tube amp. Neodymium magnets are powerful and lightweight, but just don't sound as good. AlNiCo magnets are generally preferred by most guitarists, and are also the heaviest. Sigh.
Comment: @ToddWilcox: good point about transformers. (What you're saying about AlNiCo magnets I would, however, categorise mostly under _vintage buzz_... though indeed I'm also not overly fond of many modern compact designs (e.g. MarkBass amps), there are definitely many great combos with digital power stages and neodymium speakers).
Comment: I'd typed an answer covering this and then forgot to click to post it. Daft me. Therefore, I agree with all that you say - but regard lightweight guitar cabs:  The better built ones, especially combo amps, are stronger, and sound better. My point being the weight of the cabinet affects the sound, as you say, but also thicker wood & tough corners / strong chassis makes the whole unit much heavier & stronger. it's true of amp heads too. Eg my 1970 marshall amp head is built like a tank .. go me!  lol :-D
Answer: I used to associate quality = mass for most things, including PA systems and (tube-powered) guitar amps.
Now that I'm my 50's I've looked for ways to get that sound without so much weight, and thankfully, new neodymium magnets have helped a lot.
My current favourite is a Hughes & Kettner Combo 18. At 21 lbs it is easy on my back, but a monster for tone, and if the house needs, more they can mic it!
Comment: I second that. Look for a combo amplifier or speaker cabinet that uses speakers with the new neodymium magnet technology. These amps and cabinets have dramatically reduced weight compared to the "vintage" designs. There are models out there from many manufacturers that are light and portable while sounding great and having plenty of power.
Answer:
What makes even a relatively small amp (like a 50W $2000 Mesa) so
  heavy (~25kg) and how is this linked to quality?

Those amps use cast frame speakers, specifically an OEM variant of the Electro-Voice EV12L, which is probably the second loudest and second heaviest guitar speaker in the history of time (the JBL F120 is  a bit louder and heavier). Heavy magnet Celestions like Vintage 30s weigh around 12-15 pounds, the EV easily weighs 25 pounds. Quality? They almost never blow out and the cast frame does not bend or warp. And they are absurdly loud at about 103 spl.
In audio gear in general the bigger and better the transformer, typically the better the sound and more reliable the amp. Black and silver face Fender Bandmasters have tiny transformers that will blow if pushed too hard, the Fender Bassmen from those eras have big transformers, are near indestructible, and give you a tight controlled low end even though they are otherwise nearly the same amp.
The transformer is the one thing that cannot be replaced or upgraded. If it is, it is no longer considered the same amp.The transformer is the engine, the tubes are the spark plugs.

electric guitar amps seem to get heavier as they get more expensive...
  is this a general rule and if so, why?

The reason is that larger more powerful transformers require more raw materials to produce, must be produced on higher precision  tooling, and the increased weight incurs higher shipping costs both during manufacturing and when delivering the finished product.
Comment: Hm. Nowadays, you don't really need a transformer at all (well... switching power supplies still have HF transformers in them, but they're tiny). So I'd rather object to "the transformer is the engine". You might say, the transformer is the _carburator_. (But are such analogies really useful?)

Does a good amp have to be heavy?


Can shares be trades outside of an exchange?

Question: If a company's shares are listed on an exchange (NYSE or NASDAQ) is it allowed to trade them privately (i.e. one owner to another), without the trade being registered on the exchange?
Answer: Yes shares can be traded outside of an exchange, but a transfer agent is still involved.
As stock shares represent various rights and privileges, like voting rights and dividends, someone needs to keep track of who owns what shares. While it can be done within the issuing company, handling ownership & proxy voting is usual outsourced to a stock transfer company like Computershare or AST.
With those transfer agents the owner would either have a book only entry or a ledger entry with physical shares in their possession. Realize that physical shares was not uncommon as it is today in order to avoid the high brokerage fees prior to the 1990s.
In the US if you are holding the shares directly (book or physical), a Medallion Signature Guarantee is required for transfer. Should you have physical shares, the seller/buyer would submit those shares to the transfer agent along with the required tax information of the new owner.
As to the share price of the transaction that would be private matter between the two parties unless other fiduciary concerns are imposed. Note that while the transfer agent may not care that a $200 a share stock was transferred for $1 per share, the IRS might.
So while the exchange isn't involved, some entity like the transfer agent needs to be so that proper ownership of shares is recorded and that proxy voting material and dividends are assigned.
Comment: Thanks for the exhaustive answer!
That was very informative, and more than I had actually hoped for! :)
So, those shares that were traded outside of the exchange would probably not show up on any chart then, right? (I guess you would have to check the float to perhaps find those transactions?)
Comment: Correct. If the shares of the seller were originally obtained as an exchange activity, that would show up in any exchange volume record, but grandma selling to granddaughter shares of AT&T directly doesn't change the number of outstanding shares nor would be captured in exchange activity log. The transfer agent is involved for ownership assignment and only needs to report/record changes for the issuing company.
Answer: Yes shares can be traded outside of an exchange
NASDAQ was not actually an exchange until 2006.  Many platforms (for regulatory purposes) called ECNs (Electronic Communication Networks) were used in a similar way as exchanges to match buyers and sellers.  These continue today, and many ECNs and dark pools operate to allow transactions to occur off-exchange.   These all require the transactions to be reported to the Transaction Reporting Facility (TRF).  It is possible when you do a trade with your broker, it may be executed through other means than one of the three big name exchanges (NYSE, NASDAQ, or CBOE and their subsidiaries).  The main rule is that the transaction has to be booked with the TRF within a certain time period and the execution price has to be at or inside the NBBO - national best bid or offer.  The TRF reports market data like the exchanges do.
As for trading between two individuals, you may be able to transfer them through the transfer agent, or have your broker transfer them to their broker when you have receive payment (though some brokers may not be willing to transfer the securities to an account that is not in your name).  I would also be wary of trading the shares at a price outside of the NBBO.


How do I get rid of the "organize your world" popup when I launch Outlook.com mail?

Question: This is a recent annoyance (past year or so), and nobody, including Microsoft, seems to have any sort of fix. I'm running Windows 8.1 Pro. This popup does not seem to show up in Windows 10.
I just do not want to click thru this window when getting my mail!
Answer: The screen you are seeing is controlled by a Manifest stored on Microsoft's servers.  You cannot specifically control it per se.
There is a work-around though, which for now works; however if Microsoft change their manifest again, then this work-around may cease to work.
Simply, right-click on empty spot of Desktop and select New > Shortcut
In the type the location of the item field enter: https://outlook.live.com/owa/?nlp=1 then click Next
In the Type a name for this shortcut enter whatever you like, then click Finish
This shortcut will open in your default web browser and take you directly to your webmail.
If you have more than one browser, you can also just type or paste: https://outlook.live.com/owa/?nlp=1 into its address bar then press Enter
Answer: I have Windows 7 and the blue screen appeared after I reset Internet Explorer to its default settings. I found that https//outlook.live.com/owa on its own worked. However it ceases to work if the cookie live.com is deleted. This can happen when using Microsoft's 'Delete browsing history' (under Tools/Safety) as in default mode it deletes all cookies which are not in Favourites.
The alternative is to:
- change the 'Delete browsing history' facility so that no cookies are deleted
- use CCleaner to delete cookies as this program allows you to list cookies you want to keep; just make sure that live.com is kept.
Hope this helps.


minecraft launcher wont connect to internet

Question: when I open the launcher it says I can only play Minecraft offline. When I click the try again button to reconnect it doesn't work. I was trying to buy mc dungeons but that wouldn't even work even after redirecting me. At this point I believe it is a issue with my Microsoft account because I added another account and it connects just fine and I can buy mc or mc dungeons no problem. Is this a launcher issue or a Microsoft account issue and can it be fixed?
Answer: This happens to me a lot.
Log out of Minecraft. Open the Minecraft installer, and hit Repair when it is an option.
When it finishes, log back in. Boom! Fixed.


Failure to start in frigid temperatures

Question: RE 2001 Ford Explorer
It has a new battery, coil, and wires in place. The truck will not start below -7 F despite strong cranking; in these temperatures, sound of fuel pump priming is muted or absent.  Upon rewarming, the truck starts briskly and pump sounds return.  No other classic signs of fuel pump failure.  Any ideas that you may have would be hugely appreciated.  Thank you!
Comment: Check the operation of the fuel pump relay. I would suspect that something electrical is failing to send power to the pump as opposed to the pump itself.
Comment: The fuel pump is inside the fuel tank. Is the fuel level gauge working properly?
Comment: Did you check the voltage to the pump while it's priming?
Answer: I have experience on similar situation. It was -20 degree Celsius and engine was choked on my case.
As people indicated your problem could be the fuel pump. Trapped water (ice)  inside the gas tank can cause failure of the pump. You may need to check if fuel pressure is ok on the engine side.
This may help.
Fiat Punto Wont Start. Fuel Light & Three warning lights flashing

Failure to start in frigid temperatures


$G$ is an abelian group of order a product of distinct primes $\implies G$ is cyclic?

Question: If $G$ is an abelian group of order $p_1p_2...p_k$ , where $p_1,p_2,...,p_k$ are distinct primes , then is it true that $G$ is cyclic ?
Answer: Hint: Why does the group have an element of order $p_i$ for each $i$? Once you've figured this out, think about how to "combine" these elements to get a generator for the group.
Comment: Short and simple! +1
Answer: Yes, this is a direct consequence of the classification theorem for finitely generated abelian groups:
For every finite abelian group, there holds
$$ G \cong \mathbb{Z}_{n_1} \oplus \mathbb{Z}_{n_2} \oplus \cdots \oplus \mathbb{Z}_{n_k}$$
where $n_i$ divides $n_{i+1}$ Therefore, in your case, as all your multipliers are distinct primes, the only possibility is $n_1=p_1p_2\dots p_k$ and the rest zero.
Answer: Yes, this is a particular case of the Chinese remainder theorem (where you consider the ring structure of $G$ as a $\mathbb{Z}$-algebra).


Geometric Intuition for Hamiltonian Actions

Question: Let $G$ be a connected Lie group acting on the symplectic manifold $(M,\omega)$. In the definition of a Hamiltonian action one requires that the moment map $\mu\colon M\xrightarrow{} \mathfrak{g}^\ast$ satisfies
$$\omega(X_\xi,\cdot) = d\langle \mu,\xi\rangle$$
for all $\xi\in\mathfrak{g}$. In other words, we want $X_\xi$ to be the Hamiltonian vector field of the function $\langle \mu,\xi\rangle$. While I understand what the definition says, I don't really have a geometric understanding of it. The second condition in the definition is that $\mu$ should be $G$-equivariant, which is more intuitive to me. What exactly does the above condition ensure? Is there a more geometric way to think about it?
Comment: I refer you to Quantum Theory, Groups and Representations: An Introduction by Peter Woit. In my copy it's Chapter 15 on Hamiltonian vector fields and the moment map. It's the most lucid explanation of the moment map I've read. The author (and I) prefers to think about the moment map as a function $\mathfrak{g} \to C^\infty(M)$ which assigns to each $L \in \mathfrak{g}$ a function on the manifold $\mu_L$. Your condition then becomes $X_L = X_{\mu_L}$ where $X_L$ is the vector field defined by the action of $L$ on functions and $X_{\mu_L}$ is the Hamiltonian vector field of $\mu_L$.
Comment: Maybe more geometrically, $\{\mu_L, \cdot \}$ and $-X_L$ act on functions identically as vector fields. To recover your definition of the momentum map, observe that $\mu_L(p) = \langle \mu(p), L \rangle$. If this has been helpful, I'll type it up into a more formal answer with more details.
Comment: @CharlesHudgins I will take a look at it, thanks a lot! If I am understanding correctly, what you are saying is that the moment map can be reinterpreted (the comoment map is what this is called I believe) so that for each $L\in\mathfrak{g}$ it picks a function on $M$ whose Hamiltonian vector field is the fundamental vector field of $L$.
Comment: @CharlesHudgins I would really appreciate it if you can explain the first sentence in your second comment in more detail. It seems to be what I have been looking for.
Comment: I'll type up an answer.
Answer: Per my comment, this answer is largely cribbed from an excellent text by Peter Woit called Quantum Theory, Groups and Representations: An Introduction. In my edition this discussion occurs in Chapter 15.
The Setup
Suppose we have a symplectic manifold $(M, \omega)$. As usual, the Hamiltonian vector field associated to a function $f : M \to \mathbb{R}$ (called the Hamiltonian) is by definition a vector field $X_f$ which satisfies
$$
df = i_{X_f} \omega
$$
(NB: by non-degeneracy of $\omega$, this $X_f$ is in fact unique)
We'll also define a Poisson bracket $\{\cdot , \cdot \}$ by
$$
\{f, h\} = \omega(X_f, X_h)
$$
Finally, we'll consider the action of a Lie group $G$ on $M$. We won't make any assumptions about how $G$ acts on $M$, though we'll see that if we want a momentum map to actually exist, certain (very subtle) restrictions have to be put in place.
The Vector Field $X_L$
As we said above, $\mathfrak{g}$ is the set of left-invariant vector fields on $G$. We want to study the action of $G$ on $M$, so a reasonable idea is to see if we can naturally turn each vector field $L \in \mathfrak{g}$ into a vector field $X_L$ on $M$.
This is done easily enough. Recall that $\exp(tL)$ is the integral curve of $L$ (almost by definition). Fix an $x \in M$ to create a curve $\gamma(t) = \exp(tL) \cdot x$ in $M$. We'll define $X_L$ to be the vector field
$$
X_L(x) = \left.\frac{d}{dt}\right|_{t = 0} \exp(tL) \cdot x
$$
What is this $X_L$? Based on how we've defined things, $X_L$ is just the generator of the flow on $M$ induced by $L$.
The Function $\mu_L$
At this point, one wonders: is $X_L$ is a Hamiltonian vector field and, if so, which Hamiltonian generates it? It turns out that $X_L$ is not in general a Hamiltonian vector field and the conditions under which it is one depend on both $G$ and $M$.
Let's suppose there is a Hamiltonian $\mu_L$ for each $L \in \mathfrak{g}$, i.e. $X_{\mu_L} = X_L$. We have
$$
\{\mu_L, f\} = \omega(X_{\mu_L}, X_f) = \omega(X_L, X_f) = -\omega(X_f, X_L) = - df(X_L) = - X_L f
$$
And so we see that $\{\cdot, \mu_L \} = X_L$ as vector fields. Hamilton's equations of motion tell us that for Hamiltonian $\mu_L$, we have
$$
\frac{df}{dt} = \{f, \mu_L\} = X_L f
$$
That is, if $\mu_L$ is our Hamiltonian, then $\frac{d}{dt} = X_L$. This, to me, is the clearest way to think about what the moment map is, even though, as we shall soon see, authors tend to define things in a way where it is not clear that this is what's going on.
The Moment Map?
You may have noticed that $L$ comes from a Lie algebra $\mathfrak{g}$ and that $\mu_L$ lives in the Lie algebra of functions on $M$. You may wonder: is $L \to \mu_L$ a Lie algebra homomorphism? The answer is, again, in general no.
Let's suppose $L \to \mu_L$ is a Lie algebra homomorphism. Let's temporarily give this map a name, $N$, so that $N(L) = \mu_L$. If we evaluate $N(L)$ at a point $x \in M$, we get $N(L)(x) = \mu_L(x)$. Observe that $N$ is linear in the first argument (it is a homomorphism), so $N(\cdot)(x)$ is a linear function $\mathfrak{g} \to \mathbb{R}$ for every $x \in M$. In other words, $N(\cdot)(x) \in \mathfrak{g}^*$.
This motivates the definition of the moment map in the OP. We say that the moment map is a function $\mu : M \to \mathfrak{g}^*$ defined by $\mu(x)(L) = N(L)(x)$.
Unwinding the OP Condition
At last we can unwind the condition in the OP and try to state things in a more intuitive way. We require
$$
\omega(X_\xi , \cdot) = d\langle \mu, \xi \rangle
$$
This means
\begin{align}
\omega(X_\xi, Y) &= d\langle \mu, \xi \rangle (Y)
\\&= d(\mu(\cdot)(\xi))(Y)
\\&= d(N(\xi)(\cdot))(Y)
\\&= d\mu_{\xi} (Y)
\\&= (i_{X_{\mu_{\xi}}} \omega)(Y)
\\&= \omega(X_{\mu_{\xi}}, Y)
\end{align}
By non-degeneracy of $\omega$, this is the now familiar condition $X_\xi = X_{\mu_{\xi}}$, where $\mu_\xi$ is just $\langle \mu, \xi\rangle$.
Final Thoughts
Hopefully this gives you some geometric intuition for the condition in the OP. It is nothing but the statement that $X_\xi = X_{\mu_{\xi}}$ where $\mu_{\xi} = \langle \mu, \xi\rangle$. In the language of Hamiltonian mechanics, this means that if $\langle \mu, \xi \rangle$ is the Hamiltonian, then $\frac{d}{dt} = X_\xi$.
This condition is automatically satisfied as soon as we can assign a Hamiltonian vector field to each $L \in \mathfrak{g}$, no matter what that assignment looks like.
If that assignment can be chosen to be a lie algebra homomorphism, only then do we call it a moment map. The condition that the assignment be a lie algebra homomorphism is the really interesting part. Notice that the choice of $\mu_L$ for each $L$ is only unique up to a constant locally. So maybe we should pick constants so that $L \to \mu_L$ is a lie-algebra homomorphism. It turns out we can't always do this. When we can't, we say that the action by $G$ has an anamoly. This depends on very subtle properties of the action and is of course of great interest to physicists.
Answer: A moment map is a set of rules that measure your symplectic actions.
On a symplectic manifold, you can use one Hamiltonian function $H$ to test action/energy/momentum at every point of your symplectic manifold equipped with the symmetry (precisely, a flow generated by the Hamiltonian vector field $X_H$) corresponding to the Hamiltonian. This is a version of Noether's theorem. So you can think of $H$ as A ruler of the symmetry.
Now, suppose you have more than one symmetries! Precisely, you have a Lie group $G$ of dimension greater than 1 acts on your symplectic manifold. Then for every element $\zeta\in \mathfrak{g}$ of Lie algebra, you can first assume the flow corresponding to a $\zeta$ is a Hamiltonian flow: i.e. there exists $H_\zeta$ such that $X_\zeta=X_{H_\zeta}$. Therefore, you have an assignment: for a symmetry $\zeta$, you have a Hamiltonian function $H_\zeta$ (a ruler for each $\zeta$). By definition of the Hamiltonian field, you have $dH_\zeta=\iota_{X_\zeta}\omega$.  (In fact, here you just need to solve a ODE for each $\zeta$).
Now, you may expect that the assignment $\zeta \mapsto H_\zeta$ should be linear since momentum should be linear with respect to speed. In particular, the ruler $\zeta \mapsto H_\zeta(x)$ at every point $x$ should be linear with respect to every symmetry $\zeta$. Consequently, we have that $\zeta \mapsto H_\zeta(x),\, \mathfrak{g}\rightarrow \mathbb{R}$ is an element in $\mathfrak{g}^*$ for every $x$. We call this linear function $\mu(x)$. Then we have a map $\mu: M \rightarrow \mathfrak{g}^*$. And by the definition, we have $\langle \mu,\zeta\rangle(x)=H_\zeta(x)$. So we put them together to see that
$$d\langle \mu,\zeta\rangle=dH_\zeta=\iota_{X_\zeta}\omega.$$
Presently, we actually didn't check that the map $\mu$ we constructed from this scheme is well-defined! Because the choice of $H_\zeta$ has freedom since we only know its differential. So, we can also choose $H_\zeta+c(\zeta)$ as the Hamiltonian of $X_\zeta$. In particular, for $\zeta, \eta\in \mathfrak{g}$, you can check that we can take both $\{H_\zeta,H_\eta\}$ and $H_{[\zeta,\eta]}$ as the Hamiltonian function of $[\zeta,\eta]$. But definitively, they can differ by a constant $C(\zeta, \eta)$. By linearity of $c,C$ with respect $\zeta, \eta\in \mathfrak{g}$, we have that $c\in \mathfrak{g}^*$ and $C\in \wedge^2\mathfrak{g}^*$.
However, you can check that to guarantee the $G$-equivarance, equivalently, we should require $\{H_\zeta,H_\eta\}=H_{[\zeta,\eta]}$, which we don't know so far. So, if you want to correct the issue by carefully choosing the constants $c,C$, we need the following coherence condition (which is not a prior known)
$$C(\zeta, \eta) = c([\zeta,\eta]),\forall \zeta,\eta\in \mathfrak{g}.$$
If you can choose $c,C$ with this condition, then you will see that after the correction by $c$, the map $\mu+c$ gives you a moment map. Actually, this procedure is a typical scheme to construct your moment map!
In conclusion, a moment map is a collection of rulers that measure your group of symmetries in a consistent way (compared to a single Hamiltonian function).
Bonnes: In fact, we have that $c\in C^1(\mathfrak{g},\mathbb{R})=\mathfrak{g}^*$ and $C\in C^2(\mathfrak{g},\mathbb{R})=\wedge^2\mathfrak{g}^*$, where $\wedge^q\mathfrak{g}^*=C^q(\mathfrak{g},\mathbb{R})$ is the Lie algebra cochain with $\mathbb{R}$ coefficient. Moreover, the coherence condition means that $C=-\partial_{CE}c$, where $\partial_{CE}$ is Chevalley-Eilenberg differential of the Lie algebra cochain. So, under certain conditions of Lie algebra cohomology, you can prove existence/uniqueness of moment maps.


Is it me or is the tx_in table completely unnecessary in dbSync?

Question: If I've understood the dbsync schema properly then the tx_in table is completely unnecessary. The two fields (tx_in_id & redeemer_id) should just be brought into the tx_out table and left null when a UTXO has not yet been consumed. This would be far more intuitive, or am I missing something?
Answer: db-sync is insert only. You need to be able to see what the state was at any particular point in time. If it modified rows that wouldn't allow you to do so.
Comment: Got it. But for my purposes (analysis) lt seems like can merge the tables without messing up the data. Cool.


how to get bitcoind to launch on startup/reboot? ubuntu 16.04

Question: Is there an easy way to ensure that bitcoind restarts on system reboot? I tried placing the systemd service file in /etc/systemd/system but that didn't seem to work... thanks in advance
Comment: Try https://askubuntu.com/ if you're facing issues with the systemd script, it's not bitcoin specific, and those guys are a lot better at the whole linux side of things
Answer: After putting the systemd file in /etc/systemd/system, make sure that your systemd file is set up to work with your installation (binary path, datadir path, etc. are correct). Then run sudo systemctl enable bitcoind.
Alternatively you can do edit your crontab with crontab -e and add the line
@reboot bitcoind

Comment: do you really need to put the executable in the system folder? Update path and add the root folder for the daemon so it can be updated easier and not forget to copy everything over...


Why don't people on Earth experience a same time effect as when accelerating in a rocket with the same G-value?

Question: If a person moves in a rocket with a constant acceleration of 1 G, then sooner or later he will reach about the speed of light. At the same time, time will flow slower for him than for the surrounding universe. But I heard that from the point of view of theory of relativity, the surface of the Earth accelerates relative to the surrounding space with a constant acceleration of 1G. That is, in fact, moving in a rocket with an acceleration of 1G and being on the surface of the Earth are the same. However, in the rocket there will be a time change effect, but on the Earth we do not feel this. Why is that?
Comment: Well, for starts, you don't actually accelerate while standing on the ground, so you speed does not increase as you stand there.
Comment: But. It should be like this. As far as I know, we experience the G-force  due to the acceleration of the Earth's surface relative to the surrounding space. Which seems to fall into the Earth, doesn't it?
Comment: I got it from this video: https://youtu.be/XRr1kaXKBsU
Comment: You experience the g force because you are _not_ accelerating relative to the earth. In free fall you don't feel the force since you are responding to it.
Answer:
but on the Earth we do not feel this

In the accelerated ship they don't feel it either. Time dilation is not a matter of feeling, it is a comparison between different clocks.
But it is true that a rocket passing by the earth, say at 99% of the light speed, starting then to accelerate to reverse its relative velocity, sooner or later will be back for a second meeting.
When it happens, comparing the clocks readings, the time recorded by the ship will be far less than that recorded by a clock at the earth. The fact that both are all the time under the same acceleration  doesn't matter. It is a misconception to think that acceleration is the cause of time dilation.
Our clocks here in Earth ticks a little bit slower than another clock far from the gravitational field of our planet and static with respect to us. But the $\Delta t$ of the comparison with the clock in the rocket is far greater than that tiny difference at such very high relative velocities.
Answer: Not really, an accelerated observer in a flat space time (in fact, any observer in any space time) can't reach the speed of light. What you are describing right now are Rindler coordinates.
The reason you don't observe time dilation is because, time dilation always refer to one frame of reference with respect to another frame of reference. In the case of being on the surface of Earth, with respect to whom? With respect to an inertial observer (i.e. an observer free falling through space with an acceleration of 1G), then you would get exactly the same time dilation as with the case of the rocket. In fact, they are the same scenario, but with reversed roles.
Indeed, the behavior of a stationary observer on a gravitational field and an accelerated observer in flat space time are indistinguishable. That is (more or less) the reason why general relativity predicts curved trajectory of light when passing near massive objects, or black holes.
In fact, in these Rindler coordinates, one can speak of a horizon in the past of the non-inertial observer, very similar to how a stationary observer can talk of a horizon when nearby a black hole. The effect is just very small.
Comment: In the case of being on the surface of Earth, with respect to whom? - for example with respect to someone on the Moon. Let's say the rocket accelerated for 2 months. That is, 60 days passed on the rocket. During this time, the rocket accelerated to 0.17C. Then the rocket turned around and began to slow down with the same 1G. When the rocket returned to Earth, 4 months had passed on the rocket. How much time has passed on Earth during this same time? Why has so much more time passed on Earth than the man on the rocket relative to an observer from the Moon?
Comment: After all, if we take into account that the Earth surface moves upward in space-time (since space-time falls into the Earth), then the distance traveled by a man on the Earth surface and a man in a rocket will be the same
Comment: With respect to someone that is falling towards the gravitational field (Assuming a constant gravitational field).
How much time has it passed? I don't know, you'd have to integrate. In fact it is actually the acceleration to change the direction what makes the [twin paradox](https://en.wikipedia.org/wiki/Twin_paradox) not really a paradox, but an oversimplification.
Answer:
then sooner or later he will reach about the speed of light

The "about" is important. Just wanted to stress nothing ever reaches exactly the speed of light no matter how hard or how long it accelerates.
To make it a fair comparison, imagine we have infinitely many copies of the Earth spread around the universe and all at rest with respect to each other. We also have infinitely many copies of the rocket and they also spread around the universe and also initially at rest with each other and the many Earths. When the rockets all start accelerating with constant proper acceleration of 1G the Earth observer will see each copy of the rocket that happens to pass near the Earth to pass faster than the previous one. The rocket observer will similarly see each copy of the Earth that happens to pass near his window as passing faster than the previous one. When looked at like this you see there is a symmetry.
In your scenario, you are basically asking why the Earth observer sees everything (except the rocket) as at rest with respect to her, while while the rocket observer sees everything racing progressively faster past him. Let's modify things a bit. Let's remove everything in the universe except The Earth and the multitude of rockets. Now the rocket observer experiencing artificial acceleration is asking why he sees everything (except The Earth) as stationary (where 'everything' is all the co-accelerating rockets), while the Earth observer sees 'everything' as racing progressively faster past her.
Let's remove acceleration from the equation. Lets imagine a rocket cruising along a constant 0.9c. This rocket pilot sees the whole universe as moving at 0.9c in the opposite direction. We conclude the Earth must be stationary because it basically at rest with the rest of the universe and the rocket must be moving, but in relativity, the rocket pilot is entitled to consider himself as stationary and the whole universe is going at 0.9c for random reason.
The rocket observer will observe that if he lets go of an apple it will accelerate to the the back of the rocket and hit the rear wall in just the same time it would take an apple to fall from the same 'height' on the Earth.
In General relativity the equivalence principle only really holds locally. In curved spacetime the speed of light at distant locations can appear to be different to the local speed of light and the equivalence principle does not hold over great distances.
Comment: Thank you for your answer, but I didn't catch the essence of the example with asymmetry, could you rephrase?
Comment: @nilecrocodile OK, had a go at rephrasing.
Comment: Thank you! More or less clear. The only question, isn't true that space-time falling into the Earth? I was inspired by this video https://youtu.be/wrwgIjBUYVc?t=517 (the link with timestamp). And it says that space "falls" into massive objects with acceleration. Essentially, this means that the entire universe is moving towards the Earth, just like the rocket in your example... essentially the difference between the rocket and the Earth is only that space disappears inside the Earth, while for the Rocket it stays behind it... Or is this video also an allegory for clarity?
Comment: I think that is the waterfall analogy and it has its problems. If you think of photons as little motorboats in this flowing river, then the photons near the edge of the waterfall that are going outwards are going slow against the flow while those going towards the waterfall are going progressively faster. An observer standing near the waterfall (hovering) would see photons going at different velocities, but general relativity says an observer always see the speed of light locally as being constant in all directions. As far as I am aware, the analogy is not part of mainstream science.
Comment: A second problem with the analogy is this. Imagine you are on the bank holding an apple in the water flow. When you release the apple, the flowing water exerts a drag on the apple accelerating it away from you, to to able to drag the apple there must be friction between the water and the apple. Now way upstream where the water is almost stationary you shove the apple away from you. It comes to a stop because of the drag of the water, but we know in flat space when we push an object it continues forever. There is no drag in flat space.


How to teach a class that I've never taken?

Question: I have the opportunity to teach an undergraduate class in statistics.  However, I've never taken statistics and the material and concepts are a little foreign to me.  I'm concerned, as a graduate student, that it may take up a lot of my personal time just to learn the material, much less teach it.  I really don't want to turn the opportunity down because I know its a good learning experience, but I don't want to become overwhelmed by it.  What are some effective strategies to teach a class that you've never taken before without overloading yourself?
Comment: "I really don't want to turn the opportunity down": I warn you against this kind of thinking, especially if you are interested in a research postdoc. You will have many, many opportunities in grad school and beyond, and regrettably you will have to turn most of them down.
Comment: See also ["Teaching What You Don't Know"](http://www.amazon.com/dp/0674066170/?tag=stackoverfl08-20) by Therese Huston, helpfully mentioned in ff524's [answer](http://academia.stackexchange.com/a/37968/12339) to another question.
Answer: It will be a huge timesaver if you can get lecture notes from someone who has taught the class before.  There's a big difference between understanding the material well enough to solve problems and answer questions and understanding it well enough to find the clearest, most succinct way to present it.  If you get someone else's lecture notes, you will only have to attain the first level of mastery, rather than the second; this will save you a lot of time.
Before the class starts, you should sit down with the syllabus (presumably you can get one from someone who's taught it before; typically, the first time I teach a class, I don't change much unless I have a good reason to) and try to understand the structure ("story arc") of the class.  What are the big ideas?  For example, in Calculus I, some of these are: limits, derivatives, integrals, applications.  That gives you a sense of where you're going and helps you to know what may be important.
Don't feel like you have to know every little detail perfectly.  The stuff that will likely stump you will be the obscure corner cases.  The stuff that most of your students will struggle with will be much more basic, like the limit definition of a derivative, and precalc and algebra.  If a student asks you a question that you can't answer right away, learn to be comfortable saying "that's a great question"; it's a little outside of the scope of this lecture, but I'd be happy to talk with you about it after class.
Thinking on your feet in front of an audience (especially about unfamiliar material) can be really tough.  Most of the time, you can avoid it.  Usually the student will be happy to talk with you after class.  The reduced pressure of not being in front of the other students will help you to think more clearly.  If you still can't answer the question after a reasonable amount of time, say "This is a good question.  Let me think about it some more and get back to you in class next time."  At that point, feel free to ask your colleagues.  Often one of them will have encountered the question before, and will know the answer off the top of their head.
tl;dnr Get lots of help from colleagues who have taught the class before.  Typically, it won't take much time from them, but it will save you a lot of time (later, when roles are reversed, be willing to do the same for someone else).  You don't have to be perfect.  If you have decent lecture notes, and you really engage with the students and answer their question, you'll be fine.
Comment: @Paul A great all-purpose response in office hours is: "What did you try?  And where did you get stuck?"  This won't solve everything, but it will help you pinpoint where to focus your explanation.  It will also buy you time to think while you listen to the student's answer.  Another good approach is to verbalize your thought process: "Let's try such and such, and see what happens?"  This has at least two benefits.  First, it allows you to think through things, without feeling like you have to know the answer ahead of time.  Second, it teaches students how to problem solve.  Both are valuable.
Comment: That's really awesome advice!  I never thought there was a difference between knowing it well enough to "solve problems" versus "explain things succinctly".  How should I approach answering students' questions during office hours when I don't know the answer... should I rely only on the "i'll get back to you on that" approach or is there another way to go about it?
Comment: Regarding "What did you try? And where did you get stuck?" I've used this tactic to guide students through solving problems without actually telling them anything substantive, and even without having any idea how I would solve the problem myself! It can be surprising how much most students will fill in for themselves if you just keep prompting them. And in the cases where that doesn't work, it often comes down to incorrect knowledge of some fact which is a trivial thing to correct.
Comment: @Paul In regards to "solving problems" versus "explaining".  The first requires you to have a decent understanding of the technique.  The second requires you to have that same understanding *and* to know your students well enough to know what will be easy and what will be hard for them.  For the second, it's helpful to be able to look at the subject matter from multiple perspectives.  In particular, when you're answering a student's question, you should try to step into their viewpoint.  This is often easier said than done.  Fortunately, detailed lecture notes do some of this work for you.
Comment: these are really great suggestions.  Thank you so much, DanC
Answer: Dan C gave a tremendously good response to this question, but I thought I'd add one more idea:
with the preponderance of online classes, it is very much possible to follow a set of lectures online as you teach a class for the first time (especially for introductory classes), and many times you can find full semester classes for free on YouTube, or Khan Academy, or MIT OpenCourseWare.  I've done this for an Astronomy class that I taught, and I not only learned a lot from watching the class, but I was able to set up my own classes with a good idea of class-long topics.  Furthermore, I've said it at least once on Academia.SE before: observing other teachers teach is one of the best professional development methods around; you learn the good and the bad, and you see what works and what doesn't work.
The reality is that sometimes, staying one step ahead of the students is the best you can do, even if it isn't ideal from a pedagogical perspective. As DR famously said, You "go to war with the army you have, not the army you might want.".
Comment: I'm not sure, but wouldn't this be considered plagiarism? How much would you be allowed to "copy" or take away from one of these courses when constructing your own?
Comment: @ciri You would still be teaching your own course, but you would be modifying the material from the lectures. You are free to teach a course however you'd like, and if it is like another teacher's classes, so be it.
Answer: I know this answer might be controversial, but I think it is important to mention it. The solution is to not teach the class.

Teaching is a huge responsibility: you are responsible for the enthusiasm (and possibly the career) of a lot of students. If you do not feel ready you are not ready.
Good teaching takes a lot of preparation. You indicate that you are concerned about the time it will take you. My conclusion: you do not have the time to prepare properly. This is a good reason not to teach the class.
You are looking for effective strategies. There is no such thing; teaching is not some kind of "trick". The next two points explain why.
You need to have good (if not excellent) knowledge of the field: "If you can't explain it simply, you don't understand it well enough" can be reversed as well: if you do not understand the material well enough you will not be able to explain it simply. Reading a few course materials in the short time before the course will not be sufficient.
Teaching takes planning. Planning takes time and experience (even if you are using existing course materials, you need to be very familiar with them and what they are meant to achieve).

Don't take the responsibility of teaching when you are not ready. But you can start preparing for next year, or ask to teach subjects you are more familiar with.
Comment: I disagree strongly with many of these points.  The first time I teach a course, I rarely do it as well as the third or fifth or... time I teach it.  But the reason I get better is that I learn from the mistakes I make.  I also don't always have the choice of which classes I will teach.  Finally, I think there are many "tricks" that significantly improve teaching (start with an example; more generally, work from concrete to abstract; use pictures wherever possible; follow a clear outline; find a style that suits your personality; etc.).  No one of these fixes everything, but they all help.
Comment: These "tricks" you mention strongly depend on the content and goals of the course. It is fine to make mistakes (it happens  that mistakes made by the teacher are the most educational part of the course), but is is not fine to teach a course if you admit in advance that you do not have time to prepare adequately.
Comment: The way that you *implement* the trick depends on the course, but the idea of drawing a picture (for example) is useful in a very wide range of courses.
Comment: Precicely. And this implementation requires skill and experience. Incomplete ("simplified") pictures may do more harm than good. And so do confusing images that are quickly cobbled together. GOOD pictures help, not ANY picture. Similarly, finding a style that suits your personality takes time. The question from OP states that they do not have time: not to make good quality pictures, and certainly not to find their own teaching style. I think you missed the point of the question.
Answer: This question is ancient history for the site, but the following may be helpful to some. I assume that the scale of the class is relatively small, probably no more than 20 students, with about 10 being better. It won't work for large lecture sections.
The main idea is to turn the class into a seminar, rather than a lecture. Admit to the students that this isn't your specialty and that you will all learn the material together. Some students will balk at this, but it can be made to work. The idea is that face time in the course is used for discussion and exploration, rather than lecture. You assign some work one day and let them work on it over night. Then you have small groups develop solutions together. You can also assign topics to students who will then, a few days later, give their best explanation of the ideas.
I asked a very similar question at CSEducators here.
This technique probably works best with somewhat sophisticated students. It is, in fact, how a lot of learning at the research edge takes place. People discuss topics then work individually and together on the ideas. But the group work aspect of it can, perhaps, entice beginners into participating and developing better study habits along the way.
Note that it doesn't depend on "staying one day ahead of the students" nor developing sophisticated teaching materials. But it does require some creativity in keeping discussions moving along.


Does or should a prosecutor in the US interview the victim and the suspect, if they are physically available, to file charges?

Question: Does a prosecutor ought to interview the victim if physically available and the suspect if physically available to file criminal charges (in the US)?
Comment: Many crimes do not have victims, such as possession and trafficking laws, tax laws, perjury laws, escape laws...
Comment: @user6726: I specifically said "and suspect" and "if they are physically available". To be more logically rigorous, I have rephrased my question. Please review.
Answer: There is no requirement to interview the victim and/or the suspect prior to filing charges. Often statements are taken from the parties involved/witnesses by police and presented to the District Attorney's office as evidence. However charges can be filed without either party being interviewed, especially by the DA. This can often be the case in things like domestic violence cases, where the victim refuses to cooperate and the perpetrator refuses to talk ("lawyer up" or invoke 5th amendment rights).
Charges can be filed based on circumstantial evidence of the crime (in the example, marks on the fist of the perpetrator and injuries to the victim, along with proximity). The police will try to interview the suspect and/or victim, but usually the prosecutor does not get involved at this point until charges are filed and the defendant has retained a lawyer (or declined one).
Answer: If a witness makes a materially important statement to a prosecutor, and the witness later makes a contrary statement, the prosecutor becomes a fact witness to the original material statement.  In most situations, a person cannot be both an attorney and a fact witness in the same case.  So if the original statement is important to the state's case, a DIFFERENT prosecutor will have to take over the case so the initial prosecutor can be a witness.  This problem can be prevented by having another competent adult present during witness interviews so that other person can serve as the fact witness if necessary.
Intent is an element of many criminal offenses.  In the example of domestic assault, the prosecutor must prove beyond a reasonable doubt that the defendant acted intentionally, knowingly, or recklessly.  A person cannot negligently or accidentally commit assault.  So it would be WISE for SOMEBODY to interview the alleged victim, because you are going to waste a lot of time and money prosecuting a DV case if the alleged victim's testimony is that any injuries were the result of consensual mutual combat.
Probable cause to believe an offense was committed can be developed without interviewing any witnesses.  For example, if a 13-year-old girl turns up pregnant, any doctors or nurses helping her would have an affirmative legal duty to report child sexual abuse to law enforcement.  A child that young cannot legally consent to sexual contact and Sexual Assault Of A Child is a "strict liability" crime (which means there is no intent element of the crime and it doesn't even matter if she lied about her age.)  The pregnancy itself is evidence of the crime and a search warrant for the suspected father's DNA may be all that is needed for proof beyond a reasonable doubt.
Comment: "Consensual mutual combat" probably won't hold water.  Courts don't usually recognize anyone as having an ability to consent to grievous bodily harm, outside of sanctioned sports bouts (but even then it's arguable any 'grievous' harm suffered is the result of an accident; the sport is designed to settle things with less than that).  Attempting to argue you did calls into question your mental soundness, and now the defendant can (allegedly) add "beat up a mentally incompetent/disturbed person" to their list of accomplishments, and this may actually have additional legal consequences.
Comment: Consent is a legitimate defense to the offenses of Assault, Aggravated Assault, Deadly Conduct, and Sexual Assault (see ch. 22 Texas Penal Code.) If an alleged victim testifies to consent in a mutual combat scenario it opens the door for the self defense justification (ch 9) which shifts the burden to the state to DISPROVE the justification beyond a reasonable doubt. (sec 2.03(d)) That puts the state in the unenviable position of "proving a negative."

@zibadawa timmy Attacking my "mental soundness" amounts to a violation of stack's Code of Conduct regarding name-calling or personal attacks.
Comment: I made no comments about you whatsoever.  Might want to take another pass at comprehending that.
Answer: It is not customary for a prosecutor to personally interview an available suspect before pressing charges, and is not, as a general rule a "best practice" of a prosecutor to do so.


Figure of Speech vs. Figure of Thought

Question: Is there any meaningful difference between a "figure of speech" and a "figure of thought". Searching for a definition of "figure of thought" leads to many esoteric discussions relating to ancient rhetoric and philosophy. How can I tell a figure of speech apart from a figure of thought, and why would it be worth distinguishing between the two?
Comment: A 'figure of speech' is a set phrase that has been used in English for a while to refer to rhetorical patterns, mostly short and within a single sentence (a metaphor may be extended for a full passage though). A 'figure of thought' is a new thing to me and sounds like a newly invented thing to subtly distinguish some patterns that are not so easily expressed as patterns in word choice like what are connoted by 'figures of speech' and have some additional characteristics, something like 'proof strategies' or 'discourse patterns'. Whatever the details, the distinction feels like a new thing.
Answer: Yes they are different, although the definition and distinction my only be of interest to scholars of classical rhetoric. There are, according to this article from the University of Alberta, three figures: Figures of Word, Tropes (Figures of Speech), and Figures of Thought.  All three are tools in rhetoric for conveying information.
Figures of word involve the actual construction of a sentence, including word selection, placement, and repetition.
Figures of speech are when words or phrases are used in a sense other than their literal meaning for dramatic effect. Hyperbole is a figure of speech.
Figures of thought are the styles that rhetoric can take, the way an argument is approached. A simile is a figure of thought.
They are different concepts, but not mutually exclusive. Examples of figures of thought could be figures of speech, and contain figures of word.  Figure of speech is, by a wide margin, the concept that we are most familiar with. And we are familiar with specific types of all of them, including, hyperbole, paralipsis, metaphor, and allegory, but their technical classification wouldn't be of much interest to anyone outside of an academic setting.
Answer: From the start of an article discussing how best to interpret the Bible:

The biblical writers (in both OT and NT documents) made extensive use of a good many figures of speech (sometimes called figures of words) and figures of thought. The former is when the image or resemblance is confined primarily to a single word, whereas the latter might require for its expression a great many words, phrases and sentences. A metaphor, for example, would be a "figure of speech," whereas a parable would be a "figure of thought."

Figure of Speech vs. Figure of Thought


Is there a ketivat ot for tefillin or mezuzot?

Question: I've heard and attended a few ketivat ot ceremonies for the writing of a Torah. I've never heard of a similar ceremony for tefillin or mezuzot. I assume that it may be that these items have far fewer letters? Nonetheless, there certainly are enough to write to have a few people assist in this. Is there such a thing as ketivat ot for these items? If not, how come?
Comment: It's not a big deal to finish a Mezuzah. People can write multiple Mezuzot in a day. No one's having a party about it. If you want to write a letter in one a Sofer who writes them could easily arrange for you to write the last letter in one
Comment: Perhaps the answer lies in the fact that Tefillin has to be written Kesidran (the Parshiyos are written in the order which it exists in the Torah) and multiple writers may not be able to accomplish this aspect.
Comment: In addition the size of the letters is smaller, which increases the danger of badly formed letters invalidating the work
Answer: There is a distinct Mitzvah to write a Sefer Torah (specifically, mitzvah number 613). This can be accomplished by filling in a letter (as the Rambam in Mishneh Torah, Tefillin, Mezuzah and the Torah Scroll 7:1 writes explicitly that even writing one lette fulfils the requirement). Since most people aren't writing their own Sifrei Torah, there are these 'events' that allow people to join in with minimal monetary contribution. There is no Mitzvah to write Tefillin or Mezuzah, therefore there are no 'events' to do so.