Is it possible to download only a part of the blockchain?

Question: I am doing some investigation related to the bitcoin transactions graph and I don't need the whole blockchain, because it would be too much data (and I don't have much space). I just need a part of the blockchain to construct a graph with the transactions and then do some analysis on it. Is it possible to download only a part of the blockchain? Let's say I want only up to 3 million transactions. Or something like the transactions from 2015 and 2016, or the most recent 3 million transactions (these are not requirements I have on the data, it's just to exemplify).
Answer: If you write software yourself, with a custom implementation of the P2P protocol, this is certainly possible. Just send getdata messages for just the blocks in the range you want.
No such feature exists in Bitcoin Core however, as its purpose is fully verifying the state of the chain, it will always start at the very beginning. If you want blocks somewhere from 2015 you can of course just stop the software once it has passed that point.
Note that Bitcoin Core does support a pruned mode, in which only the last N blocks are kept on disk (but they're still all downloaded and verified, just discarded after verification). If you want access to the last 3000000 transactions, and lack diskspace for the full chain, it would be an option to synchronize in pruned mode.
Comment: The P2P protocol does allow *asking* for specific transactions, but it's only for transactions the peer has recently announced to you. Nodes do not generally keep a database of all transactions ever that you can just query, as it's not needed for general operation, so even nodes which do have such an index do not expose it through P2P commands.
Comment: I will investigate those getdata messages. I am new in the bitcoin technology so I did not know you could just send messages for specific blocks. Could I do that also to ask for some transactions? I think the idea could be to start from a random transaction and ask for the previous and the previous and so on.

A problem I have with using Bitcoin Core is that my PC is not very powerful, so I guess it could take too much time to download and verify the blockchain, even if I use pruned mode.


If a house elf's master dies are they freed?

Question: If a house elf's master dies and the master has no descendants of any kind, would the house elf be freed?
Comment: Unlikely.  When a wizard dies, there's usually going to be a relative who can inherit even if there isn't a descendant, and if not, I'm betting the Ministry will grab the entire inheritance, including the house elf.
Comment: I believe there was clear statement of inheritance.
Comment: They are treated as property. So, their ownership would go to the heir..
Answer: The house-elf's fate is determined by the will of the deceased.
That said, usually a house-elf would stay in the household it was serving already. House-elves are servants of families, not individuals.

"Your family?"
  "The wizard family Dobby serves, sir...Dobby is a house-elf - bound to serve one house and one family for ever..."
(Chamber of Secrets, Chapter 2, Dobby's Warning).

It was normal for house-elves to remain within one particular household for their entire lives, as is evident from the generations of house-elves displayed on the walls in Grimmauld Place.
We only have one known instance of a house-elf moving to serve a new master or household as a result of a death - Kreacher. This example is a complex one because the rules governing Kreacher's succession were intertwined with the succession of Grimmauld Place and the particular requirements of the Black family in relation to this. Namely, only male Blacks can acquire the Black inheritance in order of succession.

"Black family tradition decreed that the house was handed down the direct line, to the next male with the name of Black. Sirius was the very last of the line as his younger brother, Regulus, predeceased him and both were childless."
(Half-Blood Prince, Chapter 3, Will and Won't).

These strict preconditions were not necessarily typical of other wizarding families. The Blacks are known to be rather old-fashioned and aristocratic, after all. What is significant is that when the last remaining member of the family who was eligible to own Kreacher died the matter of succession was determined by the will of the deceased. Sirius determines that Harry will inherit everything he owns (including his house-elf).

"But first of all I must tell you that Sirius's will was discovered a week ago and that he left you everything he owned."
(Half-Blood Prince, Chapter 3, Will and Won't).

And, despite suspected complications involving Black family curses, this is exactly what happens.

"Well, that simplifies matters," said Dumbledore cheerfully. "It seems that Sirius knew what he was doing. You are the rightful owner of number twelve, Grimmauld Place, and of Kreacher."
(Half-Blood Prince, Chapter 3, Will and Won't).

It seems clear that when the last member of a wizarding family dies that they have the right to determine who their house-elf passes on to. This is established through their will. House-elves are treated as slaves who are the rightful property of witches and wizards so it's no great surprise that they are divvied up in the same way as furniture and personal items, according to the will of the deceased. If a wizard doesn't leave a will or they don't specify a designated person to inherit the elf then it's likely that the Office for House-Elf Relocation mentioned in Bellatrix's answer kicks into force in order to find a new home for the elf.
So, no, the elf isn't set free. Remember that the vast majority of elves view freedom as a mark of deepest shame. House-elves are usually free only when they have been released by their masters - and this event is very rare and profoundly humiliating for the elf. Freedom is seen as a sign that the house-elf has failed the family. When a house-elf's master dies they would be desperate to be allocated a new master. They would certainly not crave freedom. Knowing this, and knowing the value of a dutiful house-elf, wizarding society would be sure to create a system of house-elf ownership where elves are passed onto new owners without delay. Giving the elf to the person named in the will would seem to ensure this.
Answer: I believe the answer to this question relies on whether you view the house-elves as bound to the house, or the family. This is actually an open question, as far as I can tell. There was a hint at the answer in the old WOMBAT test on JKR's website as discussed in this question, but it's inconclusive.
If the house-elf's allegiance is to the house:
My assumption would be that in this case, the elf would go to whoever owns that house (perhaps the Ministry, as suggested in a comment above, until a "proper" owner is found - say, if the house is purchased).
This idea is supported by the following book quotes:

"Yeah, Mum's always wishing we had a house-elf to do the ironing,"
  said George. "But all we've got is a lousy old ghoul in the attic and
  gnomes all over the garden. House-elves come with big old manors and
  castles and places like that; you wouldn't catch one in our house…" -
  Chamber of Secrets

This kind of implies that if you came into some money, and bought yourself an old estate with a manor, you might also get the house's house-elf's allegiance. This would also imply that if you moved away from your historic estate, the house-elf wouldn't go with you, which does seem surprising compared to the loyalty and servitude they show in the rest of the series. However, George's comment could also be interpreted as meaning that the types of families likely to own these houses are also likely to have house-elves, which is a slightly different scenario.

"You see," Dumbledore said, turning back to Harry and again speaking
  as though Uncle Vernon had not uttered, "if you have indeed inherited
  the house, you have also inherited —" He flicked his wand for a fifth
  time. There was a loud crack, and a house- elf appeared. - Half Blood Prince

This one seems like a pretty clear if-then statement. If Harry has the house, he also has the house-elf. Arguably, this could be intended as "if you have indeed inherited everything that Sirius owned, you have also inherited Kreacher" - but overall, I think the implication is that the house-elf is tied to the house.
One further idea supporting this is that Hogwarts also has house-elves, and is not a family-owned building. Instead, the house-elves appear to take the school's current Headmaster or Headmistress as their master, as noted in the answers to this question.
This scenario raises the further question of, "If a house-elf's allegiance is to a house and not a family, what happens if a house is destroyed?" Would their allegiance switch to the plot of land? What if it's never rebuilt upon?
If the house-elf's allegiance is to the family:
Then I suppose they would be free. Perhaps they would be able to choose another family, or alternatively would be able to work somewhere like Hogwarts, which is an institution rather than a family.
I don't have any specific quotes supporting this view, which indicates to me that the above scenario is the most likely one; however, given how their servitude is portrayed in the books (and the loyalty that elves like Kreacher and Winky display to their masters) it does seem more intuitive that they would choose to stick with the person or family over the physical building. However, the quotes appear to disagree with this view.
Answer: They may be 'jobless', there's an Office for House-Elf Relocation.
Though it's unclear exactly what happens to a house-elf when their owner dies leaving no heir, there's an Office for House-Elf Relocation at the Ministry, so presumably house-elves sometimes need relocating. Though some of these may be intentionally freed, others' owners may have died.

"After two years at the Office for House-Elf Relocation, years he describes as "tedious in the extreme," he was transferred to the Beast Division, where his prodigious knowledge of bizarre magical animals ensured his rapid promotion." - Fantastic Beasts and Where to Find Them

As they've loyally served until their owners' death, presumably it's easier for a house-elf whose owner died to get work than a house-elf who'd been freed by an owner displeased with them.

"Dobby came to see Professor Dumbledore, sir. You see, sir, it is very difficult for a house-elf who has been dismissed to get a new position, sir, very difficult indeed –" - Harry Potter and the Goblet of Fire, Chapter 21 (The House-Elf Liberation Front)

That a House-Elf Relocation Office exists is evidence that sometimes house-elves do have to find a new owner, and it seems likely that not all of them were dismissed by owners unhappy with them.
Answer: A house-elf would go onto their firstborn son or daughter, and if there are no children, then it goes to another relative (ie; Kreacher would have gone to Bellatrix Lestrange, the oldest of the surviving line of House Black, but Sirius specified that he is owned by Harry) So unless specified, it would go to a relative. I would like to provide a quote, but I can't find a relevant one,  so an example will have to do. Also, if there is no relative of any kind, and the will does not specify who will own the elf, the decision would presumably go to the ministry House Elf Legion Office, and either be relocated or set free, depending on if there is a family who is in need of an elf. There is no mention of this in either Fantastic Beasts or Harry  Potter stories, so there is no way to prove this in Cannon (JKR hasn't said much on the subject either)
But this is the most plausible answer because that is the purpose of the House Elf Legion office, however, if you can find anything in canon, link it and I will gladly edit my response.
Answer: No, the house elf is inherited. Sirius Black dies without a heir but Harry inherits the ownership of the elf.

Kreacher's voice had risen to a scream. Harry could think of nothing to say, except, "Kreacher, shut up!" It looked for a moment as though Kreacher was going to choke. He grabbed his throat, his mouth still working furiously, his eyes bulging. After a few seconds of frantic gulping, he threw himself face forward onto the carpet (Aunt Petunia whimpered) and beat the floor with his hands and feet, giving himself over to a violent, but entirely silent, tantrum.

As we can see, Kreacher do not like to obey Harry but he is forced to do.
So House elf are inherited with houses as Dumbledore say.

"You see," Dumbledore said, turning back to Harry and again speaking as though Uncle Vernon had not uttered, "if you have indeed inherited the house, you have also inherited --"Kreacher," finished Dumbledore
Comment: this is correct, but only because Sirius specified that he go to Harry and not Bellatrix Lestrange. By default, without any kind of specification, he would have gone to Bellatrix, the last surviving (oldest) member of House Black that had not been disowned.
Comment: Yeah Bellatrix would inherit Kreacher in that situation, as my last quote say anyone who inherits a house  inherits any elf working in that house there is a will or not. The only way to freed a elf is to give them clothes.

If a house elf’s master dies are they freed?


Reflection support in C

Question: I know it is not supported, but I am wondering if there are any tricks around it. Any tips?
Comment: If you want reflection, C and C++ are the wrong languages for you. It is contrary to their philosophy of "you don't pay for what you don't use."
Comment: Implementing basic [COM](http://en.wikipedia.org/wiki/Component_Object_Model) interfaces could bring a little reflection into your code.
Comment: You can get the effects of reflection by using mechanisms outside fo the C/C++ langauges.  See other answers.
Comment: The thing I am trying to do is find what the parameters for a function before calling dlsym(3) . Thanks for the answers
Comment: @adk: then you need a way to extact the parameter (name?) order and type information from the source code.  C won't do this. You have to step outside the C language.  This is practical. See other answers.
Comment: @Crashworks, "you don't pay for what you don't use."  Sure, but isn't the whole point of C/C++ that you can opt in and pay for what you _do_ want to use?
Answer: Reflection in general is a means for a program to analyze the structure of some code.
This analysis is used to change the effective behavior of the code.
Reflection as analysis is generally very weak; usually it can only provide access to function and field names.  This weakness comes from the language implementers essentially not wanting to make the full source code available at runtime, along with the appropriate analysis routines to extract what one wants from the source code.
Another approach is tackle program analysis head on, by using a strong program analysis tool, e.g., one that can parse the source text exactly the way the compiler does it.
(Often people propose to abuse the compiler itself to do this, but that usually doesn't work; the compiler machinery wants to be a compiler and it is darn hard to bend it to other purposes).
What is needed is a tool that:

Parses language source text
Builds abstract syntax trees representing every detail of the program.
(It is helpful if the ASTs retain comments and other details of the source
 code layout such as column numbers, literal radix values, etc.)
Builds symbol tables showing the scope and meaning of every identifier
Can extract control flows from functions
Can extact data flow from the code
Can construct a call graph for the system
Can determine what each pointer points-to
Enables the construction of custom analyzers using the above facts
Can transform the code according to such custom analyses
(usually by revising the ASTs that represent the parsed code)
Can regenerate source text (including layout and comments) from
the revised ASTs.

Using such machinery, one implements analysis at whatever level of detail is needed, and then transforms the code to achieve the effect that runtime reflection would accomplish.
There are several major benefits:

The detail level or amount of analysis is a matter of ambition (e.g., it isn't
limited by what runtime reflection can only do)
There isn't any runtime overhead to achieve the reflected change in behavior
The machinery involved can be general and applied across many languages, rather
than be limited to what a specific language implementation provides.
This is compatible with the C/C++ idea that you don't pay for what you don't use.
If you don't need reflection, you don't need this machinery.  And your language
doesn't need to have the intellectual baggage of weak reflection built in.

See our DMS Software Reengineering Toolkit for a system that can do all of the above for C, Java, and COBOL, and most of it for C++.
[EDIT August 2017:  Now handles C11 and C++2017]
Comment: Here's another way to think about.  Reflection in langauges that have it is about how much of the source code the compiler is willing to leave in your object code to enable reflection.  Unless it keeps *all* the source code around, reflection will be limited in its ability to analyze the available facts about the source code.
Comment: If you don't have source code, you'd better hope that reflection that answers the specific question you have is available in your programming system.  The OP's problem was about C, which has no reflection built in at all.   If you have a system with reflection, like Java, you often find it won't give you enough detail; does Java provide the names and types of function parameters, as the OP requested?  The point is that you need a powerful system to analyze code, and most programming systems/languages aren't going to provide. So step outside and get a tool that *can*, with no exceptions.
Answer: Tips and tricks always exists. Take a look at Metaresc library https://github.com/alexanderchuranov/Metaresc
It provides interface for types declaration that will also generate meta-data for the type. Based on meta-data you can easily serialize/deserialize objects of any complexity. Out of the box you can serialize/deserialize XML, JSON, YAML, XDR, Lisp-like notation, C-init notation.
Here is a simple example:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#include "metaresc.h"

TYPEDEF_STRUCT (point_t,
                double x,
                double y
                );

int main (int argc, char * argv[])
{
  point_t point = {
    .x = M_PI,
    .y = M_E,
  };
  MR_PRINT ((point_t, &point, XML));
  return (EXIT_SUCCESS);
}

This program will output
$ ./point
<?xml version="1.0"?>
<point_t>
  <x>3.1415926535897931</x>
  <y>2.7182818284590451</y>
</point_t>

Library works fine for latest gcc and clang on Linux, MacOs, FreeBSD and Windows.
Custom macro language is one of the options. User could do declaration as usual and generate types descriptors from DWARF debug info. This moves complexity to the build process, but makes adoption much easier.
Comment: Do you understand how the macro trick works? I'm trying to use this reflection trick but I don't understand the logic behind it. Trying to read the source code but it's very confusing.
Answer:
any tricks around it? Any tips?

The compiler will probably optionally generate 'debug symbol file', which a debugger can use to help debug the code. The linker may also generate a 'map file'.
A trick/tip might be to generate and then read these files.
Answer: I know of the following options, but all come at cost and a lot of limitations:

Use libdl (#include <dfcln.h>)
Call a tool like objdump or nm
Parse the object files yourself (using a corresponding library)
Involve a parser and generate the necessary information at compile time.
"Abuse" the linker to generate symbol arrays.

I'll use a bit of unit test frameworks as examples further down, because automatic test discovery for unit test frameworks is a typical example where reflection comes in very handy, and it's something that most unit test frameworks for C fall short of.
Using libdl (#include <dfcln.h>) (POSIX)
If you're on a POSIX environment, a little bit of reflection can be done using libdl. Plugins are developed that way.
Use
#include <dfcln.h>

in your source code and link with -ldl.
Then you have access to functions dlopen(), dlerror(), dlsym() and dlclose() with which you could load and access / run shared objects at runtime. However, it does not give you easy access to the symbol table.
Another disadvantage of this approach is that you basically restrict reflection to objects loaded as dynamic library (shared object loaded at runtime via dlopen()).
Running nm or objdump
You could run nm or objdump to show the symbol table and parse the output.
For me, nm -P --defined-only -g xyz.o gives good results, and parsing the output is trivial.
You'd be interested in the first word of each line only, which is the symbol name, and maybe the second one, which is the section type.
If you do not know the object name in some static way, i.e. the object is actually a shared object, at least on Linux you then might want to skip symbol names starting with '_'.
objdump, nm or similar tools are also often available outside POSIX environments.
Parsing the object files yourself
You could parse the object files yourself. You probably don't want to implement that from scratch but use an existing library for that. This is how nm, objdump and even libdl are implemented. You could peek at the source code of nm, objdump and libdl and the libraries they use in order to find out how they do what they do.
Involving a Parser
You could write a parser and code generator which generates the necessary reflective information at compile time and stores it in the object file. Then you have a lot of freedom and could even implement primitive forms of annotations. That's what some unit test frameworks like AceUnit do.
I found that writing a parser which covers straight-forward C syntax is fairly trivial. Writing a parser which really understands C and could deal with all cases is NOT trivial.
So, this has limitations which depend on how exotic the C syntax is that you want to reflect upon.
"Abusing" the linker to generate symbol arrays
You could put references to symbols which you want to reflect upon in a special section and use a linker configuration to emit the section boundaries so you can access them in C.
I've described here N-Dependency injection in C - better way than linker-defined arrays? how this works.
But beware, this is depending on a lot of things and not very portable. I have only tried this with GCC/ld, and I know it doesn't work with all compilers / linkers. Also, it's almost guaranteed that dead code elimination will not detect how you call this stuff, so if you use dead code elimination, you will have to add all the reflected symbols as entry points.
Pitfalls
For some of the mechanisms, dead code elimination can be a problem, in particular when you "abuse" the linker to generate a symbol arrays. It can be worked around by telling the reflected symbols as entry points to the linker, and depending on the amount of symbols this might be neither nice nor convenient.
Conclusion
Combining nm and libdl can actually give quite good results. The combination can be almost as powerful as the level of Reflection used by JUnit 3.x in Java. The level of reflection given is sufficient to implement a JUnit 3.x-style unit test framework for C, including test-case discovery by naming convention.
Involving a parser is more work and limited to objects that you compile yourself, but gives you most power and freedom. The level of reflection given can be sufficient to implement a JUnit 4.x-style unit test framework for C, including test-case discovery by annotations. AceUnit is a unit test framework for C that does exactly this.
Combining parsing and the linker to generate symbol arrays can give very nice results - if your environment is so much under your control that you can ensure that working with the linker that way works for you.
And of course you can combine all approaches to stitch together the bits and pieces until they fit your needs.
Answer: Based on the responses to How can I add reflection to a C++ application? (Stack Overflow) and the fact that C++ is considered a "superset" of C, I would say you're out of luck.
There's also a nice long answer about why C++ doesn't have reflection (Stack Overflow).
Comment: You can't get it in the language.  You can get the equivalent effect by stepping outside the language; see other answers.
Answer: I needed  reflection in a bunch of structs in a C++ project.
I created a xml file with the description of all those structs - fortunately the fields types were primitive types.
I used a template (not C++ template) to auto generate a class for each struct along with setter/getter methods.
In each class I used a map to associate string names and class members (pointers to members).

I didn't regret using reflection because it opened new ways to design my core functionality that I couldn't even imagine without reflection.
(BTW, it was an external report generator for a program that uses a raw database)

So, I used code generation, function pointers and maps to simulate reflection.
Comment: So you used an ad hoc approach to achieve the desire effect.  If that works for you, great.  A structured approach to doing what you wanted would have allowed you to skip the hand-coded XML description of those structs, and "reflect" the actual data from the struct declarations themselves.  See other answers to this question.
Comment: Just what I had in mind as well, going to write a PHP script analyzing my .cpp files which then dumps C++ code, which does the reflection. I need it to use C structs via a scripting engine.
Answer: You would need to implement it from yourself from the ground up. In straight C, there is no runtime information whatsoever kept on structure and composite types. Metadata simply does not exist in the standard.
Comment: Or, if you find implementing a full reflection system all by yourself a bit daunting, you can use a tool designed to analyze/transform code that has all the necessary machinery.  See others answers to this question.
Answer:
Implementing reflection for C would be much simpler... because C is simple language.
There is some basic options for analazing program, like detect if function exists by calling dlopen/dlsym -- depends on your needs.
There are tools for creating code that can modify/extend itselfusing tcc.
You may use the above tool in order to create your own code analizers.
Comment: "can you find the parameters of a function" No, just that such symbol exists.
Comment: can you find the parameters of a function, say sin using dlopen/dlsym? and what are some good code analyzers?
Answer: For similar reasons to the author of the question, I have been working on a C-type-reflection-API along with a C reflection graph database format and a clang plug-in that writes reflection metadata.

The intent is to use the C reflection API for writing serialization and deserialization routines, such as mappers for ASN.1, function argument printers, function proxies, fuzzers, etc. Clang and GCC both have plugin APIs that allow access to the AST but there currently is no standard graph format for C reflection metadata.

The proposed C reflection API is called Crefl:

https://github.com/michaeljclark/crefl

The Crefl API provides runtime access to reflection metadata for C structure declarations with support for arbitrarily nested combinations of: intrinsic, set, enum, struct, union, field (member), array, constant, variable.

The Crefl reflection graph database format for portable reflection metadata.
The Crefl clang plug-in outputs C reflection metadata used by the library.
The Crefl API provides task-oriented query access to C reflection metadata

A C reflection API provides access to runtime reflection metadata for C structure declarations with support for arbitrarily nested combinations of: intrinsic, set, enum, struct, union, field, array, constant, variable. The Crefl C reflection data model is essentially a transcription of the C data types in ISO/IEC 9899:9999.

C intrinsic data types.

integer types.
floating-point types.
complex number types.
boolean type.

nested struct, union, field, and bitfield
arrays and pointers
typedef type aliases
enum and enum constants
functions and function parameters
const, volatile and restrict qualifiers
GNU-C style attributes using (__attribute__).

The library is still a work in progress. The hope is to find others who are interested in reflection support in C.
Answer: Parsers and Debug Symbols are great ideas.  However, the gotcha is that C does not really have arrays.  Just pointers to stuff.
For example, there is no way by reading the source code to know whether a char * points to a character, a string, or a fixed array of bytes based on some "nearby" length field.  This is a problem for human readers let alone any automated tool.
Why not use a modern language, like Java or .Net?  Can be faster than C as well.

Reflection support in C


apply styling only to a specific url

Question: I want to apply styling only to a page with a specific URL(not id) in Wordpress.
for example to .../something/events
kindly suggest only PHP solutions, via funtion.php (not CSS id or class)
I've tried different things but nothing has worked. thanks.
Answer: Why don't you add a class to body via functions if you are on that url, so you can use that class on css, like so:
function add_class_to_body($classes) {
    if(is_page('events')){
        $classes[] = 'page-events';
        return $classes;
    }
}
add_filter('body_class','add_class_to_body');

Then you are able to target through
.page-events div{
    background-color: red;
}

Comment: I'm sure that if you had added that piece of information to your question that I'd have given a different answer as well. Did you try the code? I'm not sure that even with the translation plugin that the page would be identified
Comment: Thanks for your solution. I'm sure it will work, but the problem is I have a multilingual website, and there is a problem with a plugin and that I can not translate the slug for some reason (although I have tried so hard to make it happen, and failed). so there's an .../event page and another .../fa/event page, which with your solution there will be no difference if I'm right. The first .../event page works fine. the problem is the second which have a same slug but different url.
Answer: I found this somewhere out of the blue and it worked! so I share this in case it helps anyone
add_action( 'init', 'apply_css_if_url_contains_string' );

function apply_css_if_url_contains_string() {

$url = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];

if ( false !== strrpos( $url, 'events' ) ) {
echo '';
}

}

apply styling only to a specific url


Null & Residual Deviance in GLM in R

Question: For a GLM in R, is it correct to interpret that Higher the difference between NULL & RESIDUAL deviance, better is your model? If not, then how do i know if my model is good or bad (for GLM - poisson, gamma, tweedie)
Answer: Simply check your model using anova.glm() with a F test or a Chi-squared test. If your write anova(model,test="F") this will automatically compare it to a null model and send back a p-value. Check Zuur et al. 2009 and, in R, ?anova.glm

Null & Residual Deviance in GLM in R


What are the products that i can use for my Web Adverstiment?

Question: Could some please help me know what are the good products that are exist in market to develop and configure my  web adversitments.
I need to do adverstisment on web.
Answer: Have you tried Google Adwords?
Answer: You just need to integrate the ad code from an ad network (e.g. Google AdWords as suggested, Doubleclick, Yahoo, etc. etc... see the wikipedia list here)
Once you sign up with one of these networks they will provide you with HTML/JavaScript or other code (the 'Ad Code') that you can integrate into your application.
Answer: BE CAREFUL WITH ADWORDS! The current version of Google adWord DOES NOT support Actionscript 3 (AS3).
Only Actionscript 2 (AS2) is supported, and Google is VERY picky about the kinds of code you use. You are not allowed to create any HTTP requests via Flash. They are afraid you will try to circumvent their adWords tracking/counting system.
There IS a workaround to enable you to use AS3, but it is just a bandage, not a final solution. I have used it over the year or so, and had no problems with it.
Also, ads must be below certain file size in K.
Google's primary advantage with adWords is its almost complete ubiquity: adWords ads are EVERYWHERE.
Answer: If you want to look for the work-around. It is called "life-jacket". It is a free actionscript flash patch.
You can read about and download it at wordpress(dot)com by searching for "exoboy" or the title "Actionscript, AdWords, and Me."
Hope this helps others since I had to go through #$%$ to figure it out on my own....
Answer: If not using simple text Google Adwords as rosehaensse suggested, and you want rich text ads, they're all done in Flash these days.


Help Identifying Bike Frame?

Question: Trying to identify this bike frame so I can build it with compatible components, AND so I can calculate it's value. Any help massively appreciated.
Comment: How did it end with all identifying details removed and in your possession? The easiest way is usually just asking the seller.
Comment: @ojs My comment wasn't about identifying this particular frame, just pointing out that (a) the frame might not _have_ a seller _to_ ask and/or that (b) OP has likely already exhausted their options as far as asking the previous owner goes. (At least, my first assumption is that the questioner had done the bare minimum before posting online.)
Comment: I would say "Chinese".
Comment: @ojs I found one of my frames literally hanging out of a trash bin. (It's rusted and ugly, but it still rides well.) If it weren't for (1) the bottom bracket stamp and (2) this sort of vintage steel bike being very popular where I live, I would probably have asked a similar question. Though I suppose people taking out the trash and coming back into their apartments with a 40 year old bike frame isn't a common occurrence, it has made me consider that situations like OP's might be similar.
Comment: @jayded-bee your story does not really help with identifying this one, but thank you anyway
Comment: Does it matter in the slightest ?   What you need is compatible components, which are based on measurements.  What brand it was is irrelevant now.   Do note that you'll never get a rear derailleur on this bike, and even a front one might be impossible, giving you one speed (gear ratio)  If you want to progress this, start by finding a seat post and clamp that fits this frame properly.  That's your biggest challenge.
Answer: Actual identification may be difficult. Valuing a frame whose provenance you can't show is is also difficult. It is possible for me to say a few things.

This is an aluminum frame with an aero downtube and a cutout in the seat tube. And it may take an aerodynamic seatpost, which unfortunately tend to be proprietary to the frame unless the seat tube is round. You will need to check this.
It has what I would normally call track dropouts in the rear. It also has a guide near the head tube (in the downtube) for internal cable routing. Thus it probably isn't a track frame (you could measure the distance between the dropouts to confirm, track frames are 120mm vs 130mm for road). There should be some sort of screw in each dropout to help you adjust how close the wheel sits to the seat tube.
I would have guessed this could be a Cervelo, maybe mid 2000s or early 2010s. However, see the area on the chainstay just above the dropouts? I don't know that Cervelo ever used that shape. There are no visual matches on this vintage Cervelo bike website.
I would guess this is a triathlon or time trial frame. There weren't many aero road frames from the time period I think this frame is from. One of the prominent aluminum aero road frames from that era was the Cervelo Soloist, and we've established that the dropout design is wrong for Cervelo.
Comment: The combination of aero features, horizontal dropouts and internal routing ports is indeed very odd.  My guess would be some sort of generic aero bike that's had different dropouts fitted to make a track/fixie varient
Answer: It looks similar to an early `90s road bike I had from Mongoose (yes the BMX makers) but with some differences.

Dropped chainstay and high-aspect ratio downtube are similar.
Yours has trackends not dropouts and might have a 120 mm OLD measurement.
Also your top tube is more formed whereas mine was a chunky tube, and a more aggressively aero seat tube+post.
There are many more photos in https://criggie.org.nz/pictures/bikes/mongoose/
We don't really do valuations, other than Aluminium is worth around $6 a kilo as scrap metal, very region-dependent.   A bare frame with no provenance and a lot of missing parts before its a bike, is just scrap metal until you build it into a working rideable bike.   You don't even have a fork and that's hard to match.
Comment: Never mind the fork. If the OP needs a non-round seat collar like it looks like this Mongoose has, or a non-round seatpost, those seem likely to be proprietary items. If those are needed, then I have a feeling the project is DOA.
Comment: @WeiwenNg i did a bit more digging into this rather strange combination of frame features this evening.  I couldn't find an exact match, but it seems frames in this style have some popularity amongst 'trendy' fixie designs.  The internal routing on the top tube is used for a rear brake.  With a seeming abundance of similar bikes available it's possible OP might be able to get some compatible parts

Help Identifying Bike Frame?


Mechanism of ring opening of amine combined with formylation

Question: What is the mechanism for this reaction? The tertiary amine is converted into an amide and the ring gains a double bond. I can't figure out how the C-O double bond would be formed.
Comment: Find the nucleophile. Find the electrophile. Combine.
Comment: Oh, that's the easy part, but can you figure out what happens earlier? That's more interesting part.
Comment: Hint. The amide is a formyl amide. Where does the H attached to the carbonyl come from?
Comment: Can chloroform react with sodium hydroxide?
Answer:
This reaction is very similar to Reimer-Tiemann reaction which also consists of the reagent $CHCl_{3}$ + $NaOH$. The mechanism of that reaction is believed to have dichlorocarbene intermediate too. A good point to remember is that the dichlorocarbene intermediate is often used to form cyclopropane or carbonyl groups.

This is the mechanism for the reimer tiemann reaction. We can see the similarity in the this reaction and the one you have mentioned previously.
Comment: Mm, that's better. Although the arrows still suggest an intramolecular proton transfer which I don't like...
Comment: @orthocresol I am not sure if I should discuss this here, but I will be honest, I am a 12th grade student and hence couldn't understand the terms you used earlier. I don't understand what correction there should be here. Can you please elaborate in simple terms, or can we discuss it in chat?
Comment: To deprotonate a X–H bond, the base (let's say B) needs to come from the *opposite* side of the hydrogen, i.e. X–H···B. That's essentially like an SN2 reaction, and the reason is the same: you need to get to the σ* orbital. This makes an intramolecular deprotonation essentially impossible, because that lone pair that is supposedly doing the deprotonation can't reach the σ* orbital. More likely that the negative charge picks up a proton from somewhere else, and the proton on the ring is lost some other way.
Comment: Apart from that nitpick, your mechanism is fine, though; your edit fixed the other things I pointed out. But I'd still ask you to type out your text, instead of attaching a *picture* of written text. It's easier for everybody else to read, and can be searched for.
Comment: I will grant that that the σ* orbital seems very difficult  align. I just thought that the aromaticity would drive it to be essentially SN1 type acid base reaction. I guess the arrows seem to direct people into thinking this is SN2( in which case should I just get rid of them and add equilibrium arrows?) I will update this answer to text format once my major exams get over (because I don't mainly know how to do TeX and draw custom images.) That being said thanks for your inputs.
Comment: Yes it's the arrows that are the issue. Removing them is fine.


Relativistic corrections to classical physics formulae

Question: How are classical formulas in physics (such as p = mv, or kinetic energy, or maxwell distribution of speeds) treated with the appropriate relativistic correction/modification? Is it done by using the Lorentz transformation equations? Could anyone give me a few examples of relativistic corrections to classical formulae? Thanks.
Comment: http://en.wikipedia.org/wiki/List_of_relativistic_equations
Comment: Are you looking for an algorithm for classical $\to$ relativistic conversions of arbitrary equations? Because such a thing doesn't generally exist...
Answer: Alfred Centauri's wiki link certainly gives you a nice list of such things, but that entry doesn't exactly show you how such quantities reduce to their non-relativistic counterparts.
In particular, in the context of classical mechanics, one can generically show that relativistic expressions reduce to their non-relativistic counterparts in the limit of velocities $v$ that are small compared to the speed of light $c$.
The key to seeing this for many such quantities is to notice that the parameter $\gamma$ which appears everywhere in relativistic expressions is close to $1$ when $v\ll c$.  Specifically, note that $\gamma$ is defined in terms of the ratio $\beta = v/c$ as follows:
\begin{align}
  \gamma = \left(1-\beta^2\right)^{-1/2}
\end{align}
When $\beta$ is small, namely when we are doing physics for velocities $v$ much smaller than $c$, the following Taylor expansion of $\gamma$ about $\beta = 0$ becomes relevant;
\begin{align}
  \gamma = 1 + \frac{1}{2}\beta^2+ O(\beta^4)
\end{align}
In particular, the first two terms are a very good approximation at low speeds.  Here's an example:
Kinetic Energy.
The relativistic definition of the kinetic energy of a particle of mass $m>0$ is it's total energy minus its rest energy;
\begin{align}
  K = E-mc^2
\end{align}
where the total energy is defined as
\begin{align}
  E = \gamma mc^2
\end{align}
Combining these facts, we see that the kinetic energy is given by
\begin{align}
  K = (\gamma - 1)mc^2 = \frac{1}{2}\beta^2 mc^2 + O(\beta^4) = \frac{1}{2}mv^2 + O(\beta^4)
\end{align}
where I used the Taylor expansion of $\gamma$ about $\beta = 0$ in the first step, and the definition of $\beta$ in the second step.  In other words, to lowest non-vanishing order in $\beta$, the relativistic expression for the kinetic energy of a massive particle is the non-relativistic expression.


How do I hide, delete or manage grease pencil lines in 2.8?

Question: I drew on a face reference photo with the grease pencil by holding D. I want to hide the lines I drew. Some sources say to press N and then go to the "grease pencil" section, but that appears to be missing/moved in 2.8. Trying to search for 2.8 grease pencil gives me a bunch of long tutorials on creating 2D animations with the new grease pencil, but not a simple answer on how to hide the lines I drew. How do I hide or manage them?
Answer: Grease Pencil became a separate object (and more complex) type in 2.8. If you just draw with D, you now create an Annotation and you can toggle it's visibility:

globally in the Overlays section

individually by toggling an annotation layer in the N panel -> Annotations
Comment: I am not sure, but I don't think it is possible to edit Annotations afterwards, maybe in some future 2.8 version.
Comment: Is there a way to move part of a grease pencil drawing to it's own layer?
Comment: Is there a way to make annotation stick to the surface of the object? Like in grease pencil "Stroke placement", but I don't see it anywhere near annotations.


Order confirmation email not sending to guest user's email address Magento 2.3.5 -p1 community?

Question: Order confirmation email to the guest user not sending but sending to logged-in customer. I am using the Magaplaza SMTP module for sending emails. Can anyone tell me Why this is happening?. I am searching for a solution for this for the last 2-3 days but not find any solution, why this happening, and how to fix it.
I am using Magento 2.3.5 -p1 community version and digital ocean server.
Comment: I just disable asynchronous sending, and now it working fine(sending mail to the guest user).
Answer: The first, make sure all configuration is correct.
If configs are correct, so the cause is Magaplaza SMTP.
Sometimes, The Magaplaza SMTP extension will not send emails.
I have also encountered that error.
Comment: The rest of all transaction email is sending only not sending to the guest email.


What is considered to be a flight into known Icing?

Question: I am aware that flight into known icing is prohibited if your aircraft is not suitable to fly in icing conditions (unless e.g.: FIKI,...). Given the following example I am wondering if it would be legal to takeoff in Luxembourg in these conditions if your cruising level is well above the cloud tops: Cloud Layer with Cloud tops +/- FL050 and w/ Freezing Level FL040+ and light icing to be shown on a icing forecast / report. What indications are best to use to predict icing? Would this report indicate flight into known icing (I guess Yes, but I am not sure) thus making a takeoff "illegal"?, although you would only briefly pass the narrow layer of icing? The safest answer is obviously to not takeoff(although I do believe it would present no hazard in this situation), but I am simply questioning this from a legal point of view? Thanks!
Comment: I see this is tagged easa-regulations, @tTed are you also interested in FAA based answers (thats what mins article covers)?
Comment: For FAA regulations, see [this question](https://aviation.stackexchange.com/q/24136/62).
Answer: This is a wonderful question! The regulations are vague around it. According to your situation presented above, it is certainly illegal. AIM 7-1-22 defines Known Icing Conditions as "Atmospheric conditions in which the formation of ice is observed or detected in flight."
I urge you to check out this letter which is a response to AOPA from the FAA regarding known icing conditions:
https://www.govinfo.gov/content/pkg/FR-2007-04-03/pdf/07-1620.pdf
Here is a quote from that letter: "The NTSB has held that known icing conditions exist when a pilot knows or reasonably should know of weather reports in which icing conditions are reported or forecast."
The FAA argues that if a pilot willingly flies into known icing conditions, they could take legal action as per 14 CFR §91.13 (no reckless or careless behavior).
Comment: Welcome to aviation.SE! We already have [a question](https://aviation.stackexchange.com/q/24136/62) that covers this from the FAA point of view.
Answer: Just talked with some experienced pilots and they all concluded that this is a case into know icing as you expect icing to occur at temperatures below 0 degrees celsius thus climbing through a layer (visible moisture) known to be above freezing level  is definitely "flight into known icing", especially from a legal point of view, no matter if you only pass it during a few seconds.
Comment: Keep in mind that passing through that 1000ft layer of icing conditions takes waaaay longer than just a few seconds, unless you are flying a fighter jet. For a general aviation acft a cruise climb would be something in the 500 to 1000 ft/minute range, so should the conditions really be bad, you'd have plenty of time to accumulate a nice crust on your wings... Temperature below 0 degrees celsius does not necessarily mean conditions are icing. You need sufficient humidity for that too.


Spirit Airline Drastically Changed Flight

Question: I had a flight I bought with Spirit Airline direct through them(their website), as direct flight to LAX and back. It's over a month away, but I just received an email from Spirit where they drastically altered it. They pushed it back ~6 hours, and want to do an overnight layover in LAS before doing an early morning flight back home. What options are ahead of me, both for demanding rescheduling and/or compensation. I bought their trip refund policy add-on because of how little faith I had in them so that's always on the table.
Comment: Usually when an airline changes a booking by more than a few minutes they will give you the opportunity to cancel or change your flight for free. Do they not suggest such options in their email?
Comment: They just did something very similar to me. Have never seen this with other airlines.  Seems shady, like they never intended to service the original flight
Answer: Spirit's rules are spelled out here: https://content.spirit.com/Shared/en-us/Documents/Contract_of_Carriage.pdf
My read is

You are entitled to cancel for a full refund.
If you can find an alternative flight on Spirit within 7 days of the original flight, you can ask to be rebooked on that flight for free

What options are ahead of me, both for demanding ... compensation

There is no compensation beyond the refund of the original fare.

I bought their trip refund policy add-on

That was probably a mistake. These type of insurance rarely cover anything that the airline doesn't have to pay anyway (without insurance) and there tend to be LOTs of exclusions. If you are worried about not being able to take the trip, you are better of with 3rd party travel insurance.
Sorry, you got what you paid for. Section 8.1 is a particularly fun read

8.1 Spirit Airlines Responsibility for Schedules and Operations
Times shown in a timetable or elsewhere are not guaranteed and form no part of the terms of transportation. Spirit may, without notice, substitute alternate carriers or aircraft, and may alter or omit stopping places shown on the reservation. Schedules are subject to change without notice. Spirit is not responsible or liable for making connections (on its own flights or flights of any other carrier), or for failing to operate any flight according to schedule, or for changing the schedule of any flight.


Pass a value to an inFrame

Question: This probably an easy thing to do but for some reason I can't get a handle on it.
I have a simple form that allows people to select one if three items for sale. When they chose their item I need to pass that variable into an iFrame with a third party checkout page to safely process their cc transaction.
How would I do this?
Cheers-
Answer: The simplest, even JavaScript-less way to do this is giving the iframe a name attribute:

(I'm not 100% sure right now whether it's also id or just name you can use, I'm pretty sure it's name)
and then using that name as the target in the form:
<form action='whatever' target='order_confirmation' ....>

the form will then be submitted into the iframe.
Answer: On the URL is the easiest
Answer: Easiest way is to put it on the url.  For instance if they select item1 then: http://checkout.com?ID=Item1.

Pass a value to an inFrame


What are these connector blocks called?

Question: This is from a key telephone system and im wondering what these connector blocks are called. Also, what type of tool should you use for these things?
Answer: You don't need a tool for these. You open the lid, insert the cable and close the lid. Then you insert the connector into the receptable.

What are these connector blocks called?


How to find Lévy Triplets

Question: I have recently started to learn about Lévy processes, and have learnt about the Lévy-Khintchine theorem. My question is about the Poisson process, it stated to have Lévy triplet (0,0,$\lambda\delta(1)$), where $\delta(1)$ is the dirac measure with unity at 1, and zero elsewhere. But I can't seem to find an example showing this, is the Lévy triplet derived more from intuition about the process than through the Lévy-Khintchine theorem?
Answer: The Lévy - Kinchine theorem tells you that the characteristic function of a Lévy process has a certain form. Not how to compute this. For the Poisson process it is an easy exercise to compute the characteristic triplet:
$$\mathbb{E} e^{i \xi N_1} = \sum_{k \le 0} e^{i \xi k} \frac{ \lambda^k}{k!} e^{- \lambda} = exp( \lambda( e^{i \xi} - 1))$$
Taking the logarithm we get our representation:
$$\lambda( e^{i \xi} - 1) = \int \lbrace e^{i \xi u} - 1 \rbrace \  \lambda \delta_1(du)$$
Eventually I think it is important to understand that the Lévy - Kinchine theorem tells you that a general Lévy process actually behaves quite like a Poisson process, up to a drift and a Brownian motion. In fact the term involving the Lévy measure is always a compound Poisson Process unless the measure is infinite.
Comment: Are the triplets unique? Or can there be a characteristic be describe by the Lévy-Khintchine form with different triplet values?
Comment: Yes the triplets are unique. For example suppose that you have a triplet such that the associated $\psi$ is zero. Now the second order term prevails on the others at $\xi \to \infty$ so it has to vanish. Finally the term under the integral is not linear, thus both the remaining terms have to vanish as well.

How to find Lévy Triplets


Why can't you defragment Solid State Drives?

Question: I keep hearing that this is a huge no-no. Why is this? I run Ubuntu mostly so it doesn't affect me, but I was just wondering.
Comment: I can't say I'm educated in this area, but I believe it is because SSDs are damaged slightly every time they perform a write, and defragmenting wears out the SSD faster. Also, since SSDs have no moving parts, defragmenting SSDs gives a smaller performance gain than defragmenting HDDs.
Comment: Note to readers landing on this page: thinking on this subject has changed in the 7 1/2 years since this question was asked.  Please be sure to see the recent answers here and the answers on the current question this is marked as a duplicate of.
Answer: Solid state drives are based on flash memory, which age very differently than standard spinning platter-based hard drives.  Each sector has a limited number of write cycles, so the drives include wear-leveling features that allows the drive to last longer by essentially fragmenting the drive on purpose.
The read times are not greatly improved by defragmenting as they are in standard drives, so there is no real gain in defragmentation, but by doing so, you are increasing the number of writes to the drive, thereby decreasing the drive life.
Answer: Defragmenting puts your sectors near each other which is helpful for a disk that spins around. However, this is useless on an SSD which has constant access time for any sector. Defragmenting just causes extra writes on a disk (SSDs have a limited number of writes due to their design)
Answer: Note that there shouldn't be any technical reason for not "being able to defragment a solid state drive", in the sense that you could start a defragmenter program and run it against the drive.
But doing so doesn't have the effect it does on non-solid state drives, as moving the clusters together won't actually speed up the drive.
On the other hand, what you will do is perform lots of unnecessary writes on the drive, and this will shorten, albeit slightly, the life-span of the drive.
Additionally, many solid-state drives does optimizations to lessen this problem by reducing repeated writes to the same area, and this is transparent to the outside system, in which case the clusters might not be moved together at all but instead spread out over the drive. This technique is typically "wear leveling".
If a defragmenter program refuses to defragment a solid state drive (or even just list it as a drive you can select), I'd wager that it's basically a software refusal to do so, just to avoid the problems outlined above.
Note that I don't know enough about the underlying protocols used to defragment a drive, so there might very well be a hard block from a solid state drive to accept defragment commands, if there are such things. The reasons for this, however, are the ones described here.
Comment: SSD = solid state drive.  There is no disk.  You keep on using "disk" instead of "drive".
Answer: Defragging will lower the live expectancy of your drive by performing unnecessary passes over a drive with a limited life-span.
Answer: It depends on what is on the drive. You will not get any performance increase by defragging an SSD, but it will have an impact on data-recovery.
On the one hand, flash-memory has a limited number of write cycles, so doing a lot of writing will eventually wear it out. Flash drives, memory cards, and SSDs use tricks like wear-leveling and TRIM to extend the life of the media, but defragmentation tends to cause a large number of writes, which will cause it wear out all the faster.
On the other hand, fragmented files are infinitely harder to recover when accidentally deleted, hit by a virus, etc. so keeping your files in a contiguous state (e.g., by defragmenting) will greatly increase the chances of recovery.
Therefore, like I said at the start, it depends on what is stored on the drive, how important the files are, how likely you are to need to perform data-recovery, and how frequently the files are changed (frequent deletions and copies will lead to fragmentation faster as well as eat up more write cycles).
Answer: Actually, you can. Defragmentation is a filesystem-level thing, it doesn't matter what is on the lower, block level.
But in the case of the SSD there is no disk head whose movements should be minimized. Thus, it won't be faster, not even a little bit.
Some OSes and tools forbid this only, because the decisions of their developer companies like to mix the meaning of "you don't need" and "you can't". But these are different things.
Probably there are multiple hacks which could avoid this ban (regedit, or exporting the drive as iscsi and re-importing to the same machine, etc). In this case, you will find  a very fragmented drive, whose defrag will be very long. It is because the OS doesn't care about fragmentation on their case. And, as other answers also mention, this defrag won't make your system faster, but it will reduce its life.
Comment: True. You can defrag the filesystem on an SSD. And as far as the OS is concerned you now have nice clean sequential data.  (All of which is very much not true on the actual drive, which does its internal mapping).
Answer: It is not bad all the time. Manually running a full defragmentation is something you should not do, but if you have volume snapshots are enabled, windows 8/10 will defrag the SSD once per month:

This is by design and necessary due to slow volsnap copy on write
  performance on fragmented SSD volumes. It's also somewhat of a
  misconception that fragmentation is not a problem on SSDs. If an SSD
  gets too fragmented you can hit maximum file fragmentation (when the
  metadata can't represent any more file fragments) which will result in
  errors when you try to write/extend a file. Furthermore, more file
  fragments means more metadata to process while reading/writing a file,
  which can lead to slower performance.
Conclusion
No, Windows is not foolishly or blindly running a defrag on your SSD
  every night, and no, Windows defrag isn't shortening the life of your
  SSD unnecessarily. Modern SSDs don't work the same way that we are
  used to with traditional hard drives.
Yes, your SSD's file system sometimes needs a kind of defragmentation
  and that's handled by Windows, monthly by default, when appropriate.
  The intent is to maximize performance and a long life. If you disable
  defragmentation completely, you are taking a risk that your filesystem
  metadata could reach maximum fragmentation and get you potentially in
  trouble.
Answer: According to Condusiv Technologies:
SSDs start out really fast and then quickly start to lose their speed and over time become subject to corruption. SSDs require that old data be erased before new data is written over it, rather than just writing over the old information like with hard drives. This doubles the wear and tear and can cause major issues.
The principle issue is write speed degradation due to free space fragmentation. Small free spaces scattered across the SSD cause the file system to write a file in fragmented pieces to those small available free spaces. By doing so, it degrades write performance by as much as 80% to the solid state drive.
SSDs can only write so many times to the drive as they have a finite number of writes that they can perform. Due to the doubling effect of needing to read and erase before it can write again, SSDs undergo twice as much use.
As the SSD approaches its limit, more fragmentation and write errors occur, causing SSD slows. Write performance decreases proportionately as free space fragmentation increases. All SSDs will suffer from this problem at one point or another unless HyperFast is used to optimize the solid state drive.
They therefore recommend using their product called Diskeeper.Accoding to the company:
Diskeeper with HyperFast keeps your system running as fast as when you purchased it, by optimizing the free space on your SSD. The HyperFast feature, included with Diskeeper 12 specifically solves these issues by intelligently eliminating performance–degrading free space fragmentation which can promote random rather than the more efficient sequential writes to occur. This technology along with the IntelliWrite Technology promotes the more efficient and beneficial sequential writes to occur rather than random writes.
More info about their product is available:
http://www.condusiv.com/products/diskeeper/


using a unitary matrix to transpose

Question: A unitary matrix U is a matrix such that the conjugate transpose of U, when multiplied on the right with U, yields identity. My question is, is it possible to obtain the transpose of any density matrix using some unitary operation? (I read somewhere that the transpose operation is an 'anti-unitary' operation, but I don't think that means that a unitary operation can NOT simulate a transpose operation).
Comment: I guess this question would fit better in math.SE. Anyway, fact is a anti-unitary operation is not a unitary operation so the conjugate-transpose is not unitary. To see that note that $(\alpha_1 U_1 + \alpha_2 U_2)^\dagger = \alpha_1^* U_1^\dagger + \alpha_2^* U_2^\dagger$ whereas for a unitary operation due to linearity you will never get the conjugate on $\alpha_1$ and $\alpha_2$.
Answer: The transpose $\rho^T$ of a density matrix $\rho$ is again a density matrix, furthermore it has the same eigenvalues as $\rho$ (including multiplicities). Therefore $\rho^T$ is unitarily equivalent to $\rho$, i.e. there exists a unitary matrix $U_\rho$ such that $\rho^T= U^*_\rho \rho U_\rho$.
But this matrix depends on $\rho$. If there existed a unitary matrix $U$ such that $\rho^T=U^*\rho U$ for all density matrices, then this would imply that the map $\rho\mapsto\rho^T$ is completely positive, which it is not (as Juan already pointed out.
Note also that taking the transpose depends on the choice of a basis!
Comment: When you write down a density matrix, you have to choose a basis for your Hilbert space. If you choose a basis. where your density matrix is diagonal, then taking the transpose doesn't change it. If you represent your density matrix in another basis, where it is not diagonal, then of course taking the transpose changes it. Therefore clearly taking the transpose depends on the basis, it is not a physical operation that you can define without fixing a basis (writing a density operator as a matrix of course also requires fixing a basis).
Comment: Sorry, taking the transpose of a matrix does NOT depend on the choice of the basis.
Answer: The transpose is not a unitary map. One simple way to understand this is by recalling that the transpose is not a completely positive map. More precisely, let $T$ be the transpose map. Then the state $\rho_1=(\hat{I}\otimes T)\cdot\rho$ in general will not be a valid density natrix. However, for maps of the form $\hat{I}\otimes U$ for some unitary $U$, the state $\rho_2=(\hat{I}\otimes U)\cdot\rho$ will always be a valid density matrix. Therefore, the transposition map is not unitary.
In some cases, the transpose map might be equivalent to some unitary map for a particular state, but this does not mean that the map itself can be represented as a unitary.

using a unitary matrix to transpose


If there was an infinite amount of matter at big bang to form an infinite universe how it was possible for a so huge amount of matter to expand?

Question: If there was an infinite amount of matter at big bang to form an infinite universe how it was possible for a so huge amount of matter to expand? Is it better to think that the universe is spatially curved and finite as the amount of matter inside it.  As the CMBR arrives to us from all directions could it be analized and compared to two sheets, one spheric and finite and the other flat and infinite where both of them are hit by a hammer and they react diferently...the first transfer vibrations towards the antipode point where wibrations collect arriving from all directions like in the three-dimentional case of our space and the CMBR. The other, infinite flat sheet transfers the vibrations towards infinity and there is not a point where these vibrations could be seen to arrive from all directions.
Answer: There is a great distinction between mass and density and what you are referring to as infinite mass is supposed to be singularity of infinite density.
Also matter is not the thing that is expanding,it is the space time fabric itself which is expanding with no common point as centre.
Answer: The space that the matter from the Big Bang is expanding into has no matter itself, so there is no friction to slow down the process. Because of this, all matter is expanding outward in every direction at light speed.
Comment: [The Big Bang did not happen at a point](https://physics.stackexchange.com/questions/136860/did-the-big-bang-happen-at-a-point).
Comment: I agree, but all of the matter from the Big Bang still expands at light speed due to the lack of friction


Creating a new user role with Drush

Question: I can do loads of user-related stuff with Drush, but I can't see how to create new user roles. Is it possible to do this with Drush?
Answer: This functionality is available in Drush 8.x-6.x:
 role-add-perm (rap)   Grant a specified permission to a role.
 role-create (rcrt)    Create a new role.
 role-delete (rdel)    Delete a role.
 role-list (rls)       Display a list of all roles defined on the system.  If a
                       role name is provided as an argument, then all of the
                       permissions of that role will be listed.  If a
                       permission name is provided as an option, then all of
                       the roles that have been granted that permission will be
                       listed.
 role-remove-perm      Remove a specified permission from a role.
 (rmp)

Unfortunately, this has not been backported to the 7.x-5.x branch, so it probably won't be in the soon-to-be-released Drush-5.9, and isn't in Drush-5.8.  For now, you'll have to use the dev branch to get it.
Answer: To get a list of all drush based commands just type drush at the command prompt and it will list all the set of commands available.
drush help [command] to view command-specific help.
Run drush topic to read even more documentation.
Drush user specific commands

User commands: (user)
user-add-role (urol)  Add a role to the specified user accounts.
user-block (ublk)     Block the specified user(s).
user-cancel (ucan)    Cancel a user account with the specified name.
user-create (ucrt)    Create a user account with the specified name.
user-information      Print information about the specified user(s).
  (uinf)
user-login (uli)      Display a one time login link for the given
  user account (defaults to uid 1).
user-password (upwd)  (Re)Set the password for the user account with
  the specified name.
user-remove-role      Remove a role from the specified user accounts.
  (urrol)
user-unblock (uublk)  Unblock the specified user(s).
Comment: Can you add in the syntax that generate this?
Comment: drush help --filter=user
Answer: Here's a Drush script I made to use with Drush 5.9. Just name as user_roles.drush.inc under ~/.drush and then drush cc drush.
<?php
// user_roles.drush.inc
// author: yuvals

function user_roles_drush_command() {
        $items = array();

        $items['roles-delete'] = array(
                'description' => 'Delete one or more user roles.',
                'arguments' => array(
                        'ids' => 'Comma delimited list of user role IDs (rid).',
                ),
                'examples' => array(
                        'drush roles-delete 30,31,32' => 'Deletes the specified user roles.',
                        'drush roles-delete' => 'Prompts for selection of user roles to delete.',
                ),
                'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL,
        );

        $items['roles-list'] = array(
                'description' => 'Lists user roles.',
                'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL,
        );

        return $items;
}

function drush_user_roles_roles_list() {
        foreach (user_roles() as $rid=>$name) {
                        drush_print(sprintf("%-7d\t%s", $rid, $name));
        }
}

function drush_user_roles_roles_delete($ids = NULL) {

        $roles = user_roles();

        if ($ids == NULL) {
                $options = array();
                foreach ($roles as $rid=>$name) {
                        // keys must be string otherwise array_merge inside drush_choice_multiple overwrites them
                        $options['.'.$rid] = $name;
                }
                $selection = drush_choice_multiple($options, FALSE, 'Choose which user roles you would like to delete.', '!value');
                if ($selection == null) {
                        return;
                }
                $ids = array();
                foreach ($selection as $id_string) {
                        $ids[] = intval(substr($id_string, 1)); // hack - remove '.' prefix; see above
                }
        }
        else {
                $valid_ids = array();
                $ids = explode(',', $ids);
                foreach ($ids as $id) {
                        $id = intval($id);
                        if (isset($roles[$id])) {
                                $valid_ids[] = $id;
                        }
                }
                $ids = $valid_ids;
        }

        if (count($ids) == 0) {
                return drush_log(dt('No user roles to delete.'));
        }
        $message = dt("The following @number user roles will be deleted:\n", array('@number' => count($ids)));
        $role_table = sprintf("%-7s%s\n", dt('rid'), dt('name'));
        foreach ($ids as $id) {
                $role_table .= sprintf("%-7d%s\n", $id, $roles[$id]);
        }
        $role_table = sprintf("%-7s%s\n", dt('rid'), dt('name'));
        foreach ($ids as $id) {
                $role_table .= sprintf("%-7d%s\n", $id, $roles[$id]);
        }
        $message .= $role_table;

        if (drush_confirm($message)) {
                foreach ($ids as $rid) {
                        user_role_delete($rid);
                }
                drush_log(dt("@number user roles were deleted:\n@role_table", array('@number' => count($ids), '@role_table' => $role_table)));
        }

}

Creating a new user role with Drush


the difference between multiple active record objects on a given timestamps

Question: i have a simple problem: imagine a calendar with 1:N events. at some point i would like to know what is changed between two timestamps.

which events where created, updated or destroyed?
i don not need to know about events which are created after the first timestamp, and destroyed before the second timestamp.

i experimented with papertrail, but it seems to me that there should be an simpler way to do that.
simple right ? :)
UPDATE: fetching created and updated records:
Calendar.last.events.where("created_at >= :timestamp OR updated_at >= :timestamp", {timestamp: timestamp})

UPDATE: fetching destroyed records through papertrail:
PaperTrail::EventVersions.where("created_at >= :timestamp", { timestamp: DateTime.now}).where(calendar_id: calendar.id, event: "destroy")

note: you need to add a metadata reference to the (custom) verion model.
UPDATE:
@ck3g suggested "soft deletes", after reading this post. i decided to rethink my model. Meaning: If an event has a user assigned to it, i have to "cancel" (not delete) the event. if it has no association i can safely destroy the event.
Answer: I think you should perform some kind of soft delete (archive) records. You can find a bunch of realizations in the web. Later you can find records by deleted_at.
Comment: good point, after reading this http://railspikes.com/2010/2/26/acts-as-archive i decided to rethink my model (event destroyed VS event cancelled.)


base board transition piece

Question: We have already laid baseboard in both rooms but when we got to where they meet, two different levels. Is there a way to put maybe a sloping piece so they meet? What should I do? The flooring has about a half inch difference.   Also one side is at a corner and the other is just at a straight wall
Answer: IMO, a sloping piece would look awful.
Better to find something that 'explains' the transition. Normally, this wouldn't be an issue if you have a doorway or archyway between the two rooms, so that you would have an architrave that would create a vertical division between the two rooms.
If the two rooms merge, the ideal would obviously been to have discovered the difference beforehand and to cut down the height of the baseboard in the room with the higher floor to end up with a consistent baseboard height. I am assuming that you don't wish to remove any and cut it down (or build up the lower baseboard, if that's possible, for example if it is not molded then you could add additional height without removing what's there).
If it is molded, then I would cut a section of the molding and create vertical 'ends' to both the high and low sections (for example with a mitered joint, like a picture frame), making sure that the vertical pieces join neatly to both ends of the existing horizontal runs, and also to each other, thus creating a division, but one that will hopefully look sensible.

base board transition piece


How to authenticate/verify login credentials & check for user meta without logging in?

Question: I have custom login form and i used wp_signon() to authenticate. However, i wanted to run an additional check for usermeta and if the user has account_status === pending, throw an error or  or prevent them from getting logged in. How do i do that? I can't seem to find a filter
Comment: @Rup Thanks for the heads up, i missed the title when i was typing it. As i was saying, i plan to intercept any login authentication. I wanted to run a **usermeta check** to see if their **account_status** is pending or active. If it's active then continue to log them in and if not, throw an error and prevent them from logging in. Yes this is a custom login form and i used wp_signon() as mentioned above.
Answer: You could do this with a low-priority authenticate filter. I'm surprised there aren't more appropriate hooks in the login process, but I can't see one. (There is already an example of a filter like this though: wp_authenticate_spam_check.)
If the value the filter is given is a user, that means a previous filter has accepted the username & password. We can then perform our check and then either return the user if good or an error if not:
<code>function authenticate_reject_account_status_pending( $user, $username, $password ) {
    if ( $user instanceof WP_User ) {
        if ( $user[ 'account_status' ] === 'pending' ) {
            return new WP_Error( 'user_is_pending',
                __( 'Account is pending approval. Please contact support for help.' )
            );
        }
    }

    return $user;
}
add_filter( 'authenticate', 'authenticate_reject_account_status_pending', 999999, 3 );
</code>
I have not tested this, but the general pattern should work even if this code doesn't. This runs before the cookie is created etc.


Accessing WCF service sql membership provider from client

Question: I have created a WCF service that is used for authentication. It uses an asp.net SQL membership provider for the accounts.I need a way for the client application to be able to register an account, change password ETC. The way I had originally planned and have started doing was basically interfacing the code within the service by creating matching methods that I could call from the client.
For instance to create the user I would create a method that has all the needed parameters and then within the code body I would access the membership provider so the client could just pass the details into it. So it is all actually done from within the same project/service.
Now that I have started I have began to wonder if I can access the sql membership provider directly from the client so I don't have to waste my time and interface the code.
If so could anyone point me in the right direction on how exactly I create an instance of the sql membership provider in another project so I can access it?
Answer: Microsoft has a standard framework that is targeted at what you're trying to do, it's called Client Application Services. There's a walkthrough on the MSDN site


Whitney embedding codimension for compact simply connected manifolds

Question: I know that for smooth embedding a manifold $M^n$ into $\mathbb R^N$, the Whitney embedding theorem says it's possible if $N\geq2n$. Moreover this codimension is tight (at least as a linear function of $n$) thanks to $\mathbb{RP}^n$ for certain $n$. My question is whether you can improve the codimension if $M$ is say compact and simply connected. For example, in the case $n=1,2$ we can take $N=n+1$.
Answer: Every closed orientable (smooth) n-manifold (smoothly) embeds in $\mathbb{R^{2n−1}}$. This is true for $n>4$ by Haefliger-Hirsch, $n=3$ by C.T.C. Wall.(which says that every closed 3 manifold canbe embedded in $\mathbb R^5$).
And we know that every simply connected manifold is orientable. So it gives us a better bound as you desired.
Observe that when $n=3$ any simply connected closed manifold is actually $S^3$ (Poincare conjecture). So in n=3, you can choose $N=4$. But For $n>4$ it is not true. For example take $\mathbb{CP^2}$. {Since it's signature is non-zero so it cannot be a boundary of a orientable $5$ manifold.}


How to get Product Submit Url on Category page?

Question: On product page the product form has given action = <?php echo $this->getSubmitUrl($_product) ?>. I want to get this submit url on category page for each product but on category page it returns different URL for Configurable Product. how to get the same Submit url  on category page for Configurable Product.
Answer: use following code
<?php echo $this->helper('checkout/cart')->getAddUrl($_product) ?>

instead of
<?php echo $this->getSubmitUrl($_product) ?>

for the configurable products.
Answer: The reason that the configurable product urls are different is that they need to be configured before they can be added to the cart. Unlike simple, virtual and downloadable products that can be added to the cart without any configuration.
Comment: I have added the Configurable product option to the list page as well and is working very fine.
and now i want to add to cart that products directly from the category page that's why i am trying to get the url's.
Comment: Is there any other way to do this?
Comment: Suppose one knows all ids/options: how would we generate the addtocarturl that adds the configurable product and associatedoption in 1 click?


Swap values "true" and "false" via ctrl+a, ctrl+x

Question: I think it would be useful to have possibility to swap true and false values in the code rapidly, with combination ctrl+a or ctrl+x. Is there some plugin for that or something else?
Answer: There is switch.vim, and it's customizable.

The main entry point of the plugin is a single command, :Switch. When the command is executed, the plugin looks for one of a few specific patterns under the cursor and performs a substition depending on the pattern.

For example if the cursor is on the true in the following code:
flag = true

then upon executing :Switch, the true will turn into false.
Comment: You're welcome! I have this crazy idea of a 'vim-dwim' plugin that acts differently based on syntax under cursor (e.g. when hitting Enter), and I think I'll heavily inspire myself from this plugin. If I ever get to start making it, that is.
Answer: Plethora of Plugins
Toggling true/false and similar has been implemented by many plugin authors. Two of them have already been mentioned:

switch.vim by Andrew Radev (#4172, github)  and
toggle-bool by Sagar Rakshe (github).

Others are toggle by Timo Teifel (#895), monday by Stefan Karlsson (#1046), toggle_words by Vincent Wang (#1676), toggle_word by Alexandru Ungur (#1748), incbool.vim by Dmitry Petrov (#4361, github), nextval by Michael Arlt (#4536, github).
Just in case you want to increase numbers according to a custom series, e.g. the Fibonacci series, check out nexus by Barry Arthur (github).
Plugins Supercharging Ctrl-A/X
However, not all of them follow by default the idea to extend Ctrl-A/X but define a new command and/or a new mapping (incl. switch.vim and toggle-bool). I want to highlight those plugins which 'supercharge' Ctrl-A/X out of the box and, therefore, provide by default what the OP has asked:

SwapIt by Michael Brown (#2294, github),
Increment-activator by Takuya Nishigori (#4817, github),
CtrlXA by Konfekt (#5600, github),
Cycle by Zef Houssney (github),
Cycle by bootleq (github)

A related plugin which also extends Ctrl-A/X is speeddating by Tim Pope (#2120, github) which allows you to increment dates.
Fallback
Some plugins allow to combine a second Ctrl-A/X incrementor plugin as a fallback, e.g.

SwapIt by Michael Brown:
nmap <Plug>SwapItFallbackIncrement <Plug>SpeedDatingUp
nmap <Plug>SwapItFallbackDecrement <Plug>SpeedDatingDown
vmap <Plug>SwapItFallbackIncrement <Plug>SpeedDatingUp
vmap <Plug>SwapItFallbackDecrement <Plug>SpeedDatingDown

cycle by bootleq:
map <silent> <Plug>CycleFallbackNext <Plug>SpeedDatingUp
map <silent> <Plug>CycleFallbackPrev <Plug>SpeedDatingDown

switch.vim by Andrew Radev:
nnoremap <c-a> :if !switch#Switch()<bar>call speeddating#increment()<bar>endif<cr>
nnoremap <c-x> :if !switch#Switch({'reverse': 1})<bar>call speeddating#decrement()<bar>endif<cr>

Note
If you use the seek behavior of the builtin Ctrl-A/X (find next possible value in line to increment), supercharging them can interfere.
Answer: I wrote a plugin (toggle-bool) to toggle the boolean values you can try it. It supports the following boolean values:

true <-> false
yes <-> no
on <-> off
0 <-> 1
Comment: @lucidbrot corrected
Comment: Oh, It's what I was looking for. But I have a small problem. Can you fix it? https://github.com/sagarrakshe/toggle-bool/issues/1
Answer: change the mapping to what you want to use
the undo is in case you use it on top of a space, since ciw will edit the space instead of the word (and there's no easy way to get to the right word reliably)
function SwapBool ()
  let s:w = expand("<cword>")
  if s:w == "false"
    normal ciwtrue
    if expand("<cword>") != "true"
      normal u
    endif
  elseif s:w == "true"
    normal ciwfalse
    if expand("<cword>") != "false"
      normal u
    endif
  endif
endfunction
noremap <C-F> :call SwapBool()^M

also note the ^M needs to be <C-V><Enter>, not literally ^M
Comment: Welcome to this site! Note that it would be interesting to add a condition which would make the function like the built-in `` and `` when the current word is not a boolean, this way OP would really be able to use these mappings. Also you can use `` instead of `^M` in your mapping, and it is usually a best practice to provide a mode to your `map` command, here `nnoremap` would be more appropriate than `noremap`.


What is the audio file in Portal that plays when a radio is destroyed?

Question: In Portal, there are radios littered throughout the game playing elevator music and encoded transmissions. However, when put one through the Material Emancipation Grill, it makes a distorted noise as it disintegrates. I am looking for the audio file for that.
Answer: The disintegration sounds are in (for standard Windows configuration of Steam) C:\Program Files (x86)\Steam\steamapps\common\Portal\portal\portal_pak_dir.vpk.
This file has a bunch of folders with files used in Portal. I opened it in GCFScape and found that dinosaur_fizzle.wav, dinosaur_fizzle2.wav, and dinosaur_fizzle3.wav. As seen in this video these files were added along with the other radio-related audio to the 2010 update and play when the radio is "emancipated".
The three specific files are in this Google Drive folder I made.
Answer: I couldn't find an exact audio file for it from the game files (although maybe someone can find it with more time).
I did manage to record the sound of the radio being destroyed by an Emancipation Grill.
I'll leave the link right here
you might have to cut off some extra sounds, unless you wish to keep them


Add my appengine application to Moodle

Question: I'm new with moodle in fact create java application using GWT and deployed it to appengine, really it was about keystroke authentication in which detect the unauthorized users from their typing behavior on keyboard, so I make a text area that takes some data form key and send it to the server side and make some comparisons with data in the app store, i found that it would be Awesome if i add that to module meanwhile this application is my graduation project so when i integrate with moodle it is useful point for me. My question is how can i integrate my application to moodle taking in consideration that i use the appstore .
Answer: I suggest you look into something called IMS LTI. Here is a good video introduction to it:
http://vimeo.com/14100773
Before IMS LTI in order to hook into Moodle you needed to write a Moodle plugin. But using IMS LTI you should be able to just enter in some details about your app, like the url and a shared key and using IMS LTI user data and responses should be passed between Moodle and your app. Future versions of the IMS LTI standard will also allow you to pass grading information.

Add my appengine application to Moodle


How do I rename the Column Name on Acumatica Customers screen?

Question: How do I rename the Column Name on Acumatica Customers screen?
I tried the below method on other screens, but for the customers page, it does not seem to be working:
PXUIFieldAttribute.SetDisplayName<PX.Objects.CR.CRRelation.BAccount__AcctName>(this.Transactions.Cache, "Customer Name");

Answer: Not sure which Customers screen are you referring but AR.30.30.00 does not have view called Transactions out of the box.  Also, SetDisplayName in your case should take 3 parameters -
PXUIFieldAttribute.SetDisplayName(PXCahce, fieldname, displayName)
And changing display names for grid columns are best handled at DAC attribute level. At runtime, there is lesser know (read undocumented) repaintcolumns property that forces redraw of column headers which might work.
best of luck!
Answer: Try this
PXUIFieldAttribute.SetDisplayName<DAC.field>(this.Transactions.Cache, null, "Field Name")

I don't have VS here so I don't remember the syntax correctly, hope it'll help


Bounce rate segmentation

Question: I want to segment an event label together with its bounce rate. I create  a segment condition regular expression with two conditionals: one for the event label and the other for the bounce. For this last one, I search the dimesion Bounces, but I don´t know what value to put in. Any idea?
Comment: What are you trying to separate out with this segment? Events and bounces are an unusual combination.
Comment: I am trying to find out the next scenario: every time the user clicks the button Match result in a bettting game, what frequency of bounce rate appears
Answer: This is a difficult segment to get at; you will have to kind of circle around it, and may or may not get the exact numbers you are hoping for.
Bounces are not what you are looking for - a bounced session is a session consisting of only one hit, and if your session includes a pageview and an event (as I assume it does) it will never be a bounce. In addition, the dimension Bounces (as opposed to the metric Bounce Rate) is a User-level dimension, so you will get all sessions from users who had the number of bounced sessions you specify for Bounces.
What I would try is a sequence segment that gets at sessions where the only instance of the event is the final hit of the session. You will have two filters, one 1-step sequence and one 2-step sequence. The 1-step sequence will include sessions in which your event occurs. The 2-step sequence will exclude sessions in which your event is followed by a page containing /. Example screenshot from Google's demo account attached:

The idea here is to include sessions in which the event occurred, but exclude sessions in which the event was followed by any other hit. Every hit on a website includes a Page setting, which will always include a forward slash (unless you have things filtered to change that).
Do note that this will exclude any session in which your event occurs as a non-final hit, even if it also occurs as the final hit - it will select the sessions in which your event happened once, and nothing happened after it. That is the closest equivalent to Bounce Rate for an event, though, I would say.
I don't know a way to allow any number of repetitions of the event but then also require one of them be the final hit of the session. You could make additional segments catching additional fixed numbers of event hits, but that will not get you the general number.
You can also compare two segments to get a sense of when people are not proceeding; this will work best if there is a specific event they should be triggering or page they should be viewing after the event you're considering. You would make a segment for sessions in which your event occurs, and a second segment for sessions in which your event occurs and is followed by the hit that signals they are proceeding (the "non-bounces", in a sense). By comparing how many sessions are in the second segment versus the first you can get a sense of drop-off, but the gap between them is still going to be sessions in which the event happened only once, not all sessions in which the event was the last hit.
Comment: Oh! thanks for the explanation. I will read it deeply and if I have any doubt I will tell you. Have a nice day :)

Bounce rate segmentation


Are Multiple DataContext classes ever appropriate?

Question: In order to fully use LinqToSql in an ASP.net 3.5 application, it is necessary to create DataContext classes (which is usually done using the designer in VS 2008). From the UI perspective, the DataContext is a design of the sections of your database that you would like to expose to through LinqToSql and is integral in setting up the ORM features of LinqToSql.
My question is: I am setting up a project that uses a large database where all tables are interconnected in some way through Foreign Keys. My first inclination is to make one huge DataContext class that models the entire database. That way I could in theory (though I don't know if this would be needed in practice) use the Foreign Key connections that are generated through LinqToSql to easily go between related objects in my code, insert related objects, etc.
However, after giving it some thought, I am now thinking that it may make more sense to create multiple DataContext classes, each one relating to a specific namespace or logical interrelated section within my database. My main concern is that instantiating and disposing one huge DataContext class all the time for individual operations that relate to specific areas of the Database would be impose an unnecessary imposition on application resources. Additionally, it is easier to create and manage smaller DataContext files than one big one. The thing that I would lose is that there would be some distant sections of the database that would not be navigable through LinqToSql (even though a chain of relationships connects them in the actual database). Additionally, there would be some table classes that would exist in more than one DataContext.
Any thoughts or experience on whether multiple DataContexts (corresponding to DB namespaces) are appropriate in place of (or in addition to) one very large DataContext class (corresponding to the whole DB)?
Answer: I disagree with John's answer. The DataContext (or Linq to Entities ObjectContext) is more of a "unit of work" than a connection. It manages change tracking, etc. See this blog post for a description:
Lifetime of a LINQ to SQL DataContext
The four main points of this blog post are that DataContext:

Is ideally suited
for a "unit of work" approach
Is also designed for
"stateless" server operation
Is not designed for
    Long-lived usage
<code>Should be used very carefully after
any SumbitChanges() operation.
</code>

Considering that, I don't think using more than one DataContext would do any harm- in fact, creating different DataContexts for different types of work would help make your LinqToSql impelmentation more usuable and organized. The only downside is you wouldn't be able to use sqlmetal to auto-generate your dmbl.
Answer: I'd been wrangling over the same question whilst retro fitting LINQ to SQL over a legacy DB. Our database is a bit of a whopper (150 tables) and after some thought and experimentation I elected to use multiple DataContexts. Whether this is considered an anti-pattern remains to be seen, but for now it makes life manageable.
Answer: I think John is correct.
"My main concern is that instantiating and disposing one huge DataContext class all the time for individual operations that relate to specific areas of the Database would be impose an unnecessary imposition on application resources"
How do you support that statement? What is your experiment that shows that a large DataContext is a performance bottleneck? Having multiple datacontexts is a lot like having multiple databases and makes sense in similar scenarios, that is, hardly ever. If you are working with multiple datacontexts you need to keep track of which objects belong to which datacontext and you can't relate objects that are not in the same data context. That is a costly design smell for no real benefit.
@Evan "The DataContext (or Linq to Entities ObjectContext) is more of a "unit of work" than a connection"
That is precisely why you should not have more than one datacontext. Why would you want more that one "unit of work" at a time?
Comment: Yes, the OP is not correct in assuming that a large DC takes more time to instantiate. In fact, after the first instance is created in a running process, subsequent instances of the same DC can be created almost instantaneously.
Answer: I have to disagree with the accepted answer. In the question posed, the system has a single large database with strong foreign key relationships between almost every table (also the case where I work). In this scenario, breaking it up into smaller DataContexts (DC's) has two immediate and major drawbacks (both mentioned by the question):

You lose relationships between some tables. You can try to choose your DC boundaries wisely, but you will eventually run into a situation where it would be very convenient to use a relationship from a table in one DC to a table in another, and you won't be able to.
Some tables may appear in multiple DC's. This means that if you want to add table-specific helper methods, business logic, or other code in partial classes, the types won't be compatible across DC's. You can work around this by inheriting each entity class from its own specific base class, which gets messy. Also, schema changes will have to be duplicated across multiple DC's.

Now those are significant drawbacks. Are there advantages big enough to overcome them? The question mentions performance:

My main concern is that instantiating and disposing one huge
  DataContext class all the time for individual operations that relate
  to specific areas of the Database would be impose an unnecessary
  imposition on application resources.

Actually, it is not true that a large DC takes significantly more time to instantiate or use in a typical unit of work. In fact, after the first instance is created in a running process, subsequent copies of the same DC can be created almost instantaneously.
The only real advantage from multiple DC's for a single, large database with thorough foreign key relationships is that you can compartmentalize your code a little better. But you can already do this with partial classes.
Also, the unit of work concept is not really relevant to the original question. Unit of work typically refers to how much a work a single DC instance is doing, not how much work a DC class is capable of doing.
Answer: In my experience with LINQ to SQL and LINQ to Entities a DataContext is synonymous to a connection to the database. So if you were to use multiple data stores you would need to use multiple DataContexts. My gut reaction is you wouldn't notice to much of a slow down with a DataContext that encompasses a large number of tables. If you did however you could always split the database logically at points where you can isolate tables that don't have any relationship to other sets of tables and create multiple contexts.