How to Choose Broker

Question: Isn't it true that the lower trade fee is better?
Comment: If your typical trade is in the vicinity of $100 then a $3 difference in cost might matter. If it's in the vicinity of $5000 it doesn't.
Comment: The financial market people are simply mean. For what the sake of reasons, people felt so much compulsion to downvote my question? I don't get it. Even if it's a silly question, it is not ridiculous. This only shows that, there are always many **narrow-minded** suckers at some corner of this world.
Comment: @PeteBecker if someone trades many times, it does matter. But, no, nowadays, no transaction fees anymore. It doesn't matter much.
Comment: I am guessing the downvote were because the question didn't show evidence of having looked at past questions or tried to find answers yourself, and because it's so broad a question. Stack Exchange generally tends to be impatient with fuzzy questions, or ones that can be answered by websearching.
Answer: Lower fees are always better, everything else equal. A lower fee makes your transaction overall a better deal, all else equal.  Other transactions costs (like the SEC fee on sales) are mostly the same across brokers and there is unlikely to be any difference in execution quality either.  When comparing brokers be sure to consider the other issues:

Account minimums
Margin rates, if applicable
Any tickers that are free to trade (like, vanguard lets you trade vanguard ETFs for free.  This is becoming a more common practice)
Ease of moving money in and out--amazingly some brokers still require physical checks
Annual account fees (rare, in online brokers)
Any asset classes that may not be allowed
Ease of unusual transactions, like purchasing a corporate bond

To me, most of these are minor issues.  For that reason, I'd say let transaction cost be your guide.
I hear a lot of talk about the quality of the interface.  If you just want to buy or sell a stock, they are all pretty easy.  Some brokers have better tools for monitoring the market or looking at technical indicators, if you are into that.
Answer: Every brokerage is different, on all of their websites they have an actual list of fees. There are tons of different charges you may encounter.
Answer: That all depends on you. The cheaper places are certainly going to cost less, but when it comes to comparing value that is a subjective decision that only you can make. Maybe the more expensive one has an easier to user website, friendlier customer service, or something else you value enough to pay more for trades.

How to Choose Broker


Ruby RubyGems: Why do I always get error messages when trying to install gems?

Question: So I always seem to get error messages when I'm installing new gems. I'm new to Ruby, Rails, and RubyGems so it makes it very frustrating. I'm not sure if I need to configure something, or if I installed something incorrectly...So hopefully you can help. Here are some examples of the problems that I am having:
#1: sudo vs. not using sudo
In tons of tutorials/documentation they always use:
gem install gem-name

For me, this almost always results in some sort of error...until I do...
sudo gem install gem-name

...then the gem usually installs fine. How is it that people are able to run gem install without starting with sudo?
Solution:
Install Ruby Version Manager!
Seriously! I wish I would have done this sooner. Ruby Version Manager makes it possible to run multiple versions of Ruby, each with their own set of gems, and switch between the different versions seemlessly. Plus, you won't have to use sudo anymore. Plus, it's super easy to install, so you should do it!

#2: "Can't find header files"
Sometimes I get a message like this, even when running under sudo...
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h

What does that even mean?
Solution:
The problem is that it can't find the make command. It's installed automatically when you install XCode. And for some reason, even though I had XCode installed, it couldn't find it. I downloaded the latest version of XCode and reinstalled. Now when I run which make it correctly returns /usr/bin/make.
Using Lion with the new version of Xcode, download 'Command Line Tools for Xcode' from https://developer.apple.com/downloads.

#3: "Insecure world writable dir"
Here's a new one.
/Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/source.rb:352: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777

That doesn't look good. What do I need to do to fix it?
Solution:
Something I installed, at some point in time, changed the permissions on my /usr/local/bin directory (as well as my /usr/local and /usr/local/mysql directories). To change these back:
sudo chmod 755 /usr/local/bin

#4: Can't install bcrypt-ruby
Finally, I am trying to run bundle install on my brand new Rails 3.0.0.beta4 app and I'm getting this error:
Installing bcrypt-ruby (2.1.2) from .gem files at /Users/andrew/.bundle/ruby/1.8/cache with native extensions /Library/Ruby/Site/1.8/rubygems/installer.rb:483:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h

Gem files will remain installed in /Users/andrew/.bundle/ruby/1.8/gems/bcrypt-ruby-2.1.2 for inspection.
Results logged to /Users/andrew/.bundle/ruby/1.8/gems/bcrypt-ruby-2.1.2/ext/mri/gem_make.out
    from /Library/Ruby/Site/1.8/rubygems/installer.rb:446:in `each'
    from /Library/Ruby/Site/1.8/rubygems/installer.rb:446:in `build_extensions'
    from /Library/Ruby/Site/1.8/rubygems/installer.rb:198:in `install'
    from /Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/source.rb:170:in `install'
    from /Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/installer.rb:34:in `run'
    from /Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/spec_set.rb:12:in `each'
    from /Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/spec_set.rb:12:in `each'
    from /Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/installer.rb:21:in `run'
    from /Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/installer.rb:6:in `install'
    from /Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/cli.rb:91:in `install'
    from /Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/vendor/thor/task.rb:33:in `send'
    from /Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/vendor/thor/task.rb:33:in `run'
    from /Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/vendor/thor/invocation.rb:109:in `invoke'
    from /Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/vendor/thor/invocation.rb:116:in `call'
    from /Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/vendor/thor/invocation.rb:116:in `invoke'
    from /Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/vendor/thor.rb:137:in `start'
    from /Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/vendor/thor/base.rb:378:in `start'
    from /Library/Ruby/Gems/1.8/gems/bundler-0.9.26/lib/bundler/vendor/thor.rb:124:in `start'
    from /Library/Ruby/Gems/1.8/gems/bundler-0.9.26/bin/bundle:13
    from /usr/bin/bundle:19:in `load'
    from /usr/bin/bundle:19

It looks like bcrypt-ruby is some sort of dependency that it's trying to install. So how do I get that to work? How can I know the reason that it is failing?
Solution:
This was fixed by reinstalling XCode.

Sorry for the laundry list, but I really want to get rid of all these issues!
Thanks in advance!
Answer: This would be better as separate questions as I can only answer some.

sudo - On OS X, gems are installed in a directory under /Library. Anything here is shared by all users on the Mac and so to be able to write to it you need root access which is what sudo gives you.
You see commands without the sudo when either people are explaining things quickly as they expect people to know when to use sudo or if they have setup ruby to install in a user directory as per Ruby documentation
and 4.: Can't find header files for ruby.
I suspect that you have not installed XCode, the Apple developer tools. They are on your OS X DVD or can be downloaded from Apple or the App Store if you are using OS X Lion.
/usr/local/bin - that is bad.
Run /Applications/Utilities/Disk Utility.app, choose the boot drive and repair permissions.
Comment: running Disk Utility didn't fix that permissions message =\
Comment: I already have XCode installed, so I don't know why that would be the issue
Comment: for 2&4 - I don't use ruby that much (and if I did I use macports)  but I note that the path to ruby.h is /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0/ruby.h - have you installed another ruby?
Comment: re permissions do sudo chmod 755 /usr/local/bin
Comment: re: 2 & 4, I reinstalled XCode and that seemed to fix the problem
Comment: changing /usr/local/bin (and a few others) to 755 seemed to work. I'm assuming that's what they should have been in the first place, and somehow, something modified it behind the scenes.
Answer: I suggest installing Ruby Version Manger, and you don't have to worry about sudo issues, and can switch easily between different ruby versions and gem sets.
Comment: If I would have known how easy it was to install I would have done it sooner. I love RVM!!!
Comment: @Andrew Sweet! Glad I could help. RVM has made ruby/rails development soooo much easier for me, too.
Answer: Re #4:
If you are missing XCode and have an Apple Developers account, you can also install only the Command Line Tools (about 180MB) - a download available on the ADC site.
Answer: The reason of the permission error is because you are not logged in as the root user on terminal.
If you already have root use enable on your mac in terminal type (without the $)
$ su

If you dont have root user, you need to enable it using the following steps

From the Apple menu choose System Preferences….
From the View menu choose Users & Groups.
Click the lock and authenticate as an administrator account.
Click Login Options….
Click the "Edit…" or "Join…" button at the bottom right.
Click the "Open Directory Utility…" button.
Click the lock in the Directory Utility window.
Enter an administrator account name and password, then click OK.
Choose Enable Root User from the Edit menu.
Enter the root password you wish to use in both the Password and Verify fields, then click OK.

More at the same on http://support.apple.com/kb/ht1528
Atleast it works for me after getting stuck for couple of hours.


Calculation of a spread light on a surface

Question: Suppose we have a light of power $P$ distributed on a plane $(x,y)$.
The distribution of the power is of the form:
$$P=f(x,y)$$
If we have a lens conjugating every point of the plane $(x,y)$ in another plane $(X,Y)$ (focal plane) in a way that for every point in the plane $(x,y)$ we have a circle of radius $r$ in $(X,Y)$, what is the distribution of the power in $(X,Y)$?
Thanks.
Answer: The wave amplitude in the focal plane is the Fourier transform of the wave amplitude in the pupil plane of the lens $L$. Assuming we are dealing with a diffraction-limited lens, the relationship between object amplitude $A_o$ and image amplitude $A_i$ is thus a convolution:
$$A_i(x,y) = \iint_{\mathbb{R}^2} dx' dy' \, L(x',y') A_o(x-x',y-y')$$
Note that $A_0(x,y) = \sqrt{f(x,y)} e^{i \phi(x,y)}$, where $\phi$ is some undetermined phase function - it could be a constant or zero, but it might not be.  (This may be specified or determined through experiment.)  The power distribution in the conjugate plane would then be $|A_i(x,y)|^2$.
Comment: I understand you supposed the lens 'focuses' the light of a point in the object plane in a point on the image plane. In this case, the focal plane isn't located in the focus of the lens; it's defocused. What changes in your analysis?
Comment: @Riccardo.Alestra: Not much.  Defocus introduces a quadratric (or more complicated for faster lenses) phase variation in the lens function $L$.  The expression in general remains the same.  This is true even in the presence of reasonably small lens aberrations.


What causes the elongation of Genome down the evolutionary time line

Question: Theory of natural evolution says that complex life forms arose from simpler ones e.g. starting from Eubacteria to modern day multicellular eukaryotes. {If we try to reduce these changes happening at molecular level, it should be like, from Eubacteria like E.Coli. (20 kilobasepair genome/DNA strand size ) evolving, over time, to Multicellular Eukaryotes ( 3 Gigabasepair genome size) e.g. (humans and other hominids.)}
Now if we see molecular changes happening inside cells, the molecular changes are within nucleus as extra nuclear changes are largely function of nuclear information (and a smaller extent external stimuli). For biochemical changes to take place inside cell Nuclear information is the major guiding force. But according to Central Dogma elongation of DNA shouldn't have happened as there is no scope for it in either doubling, translation or transcription. But actually it is not so according to evolution. So what allows changes to be imbibed in the DNA that also increases it's length ?
Comment: @iayork — You can say that the word Dogma was ill-chosen (Crick admitted he misunderstood the meaning of the word) and that it is dangerous to give students the idea that there are dogmas in science. Or you can say that the concept is so obvious now that we know the mechanisms of gene expression that it is difficult to justify teaching it as such. However the expression "outdated concept" suggests that it is incorrect. It is not. Suggestions about the nationality of the OP and the teaching of science in India are not relevant, and I suggest you think about withdrawing them.
Comment: Your question is unclear. One interpretation is that you think there is some principal of nature that would prevent DNA elongating, and you perhaps also think this is Crick's mistakenly-named Central Dogma. There is no such principle, and Crick's Central Dogma was that molecular genetic information transfer could proceed from DNA to RNA to Protein, but not from Protein to RNA or DNA. Regardless of what Crick said, gene expansion is known to occur and the mechanisms involved are understood and can be found from an internet search. Or did you mean something else?
Comment: Yes exactly if information flows from DNA to RNA to protein and in no way from protein towards DNA than how come the changes that happened in external environment (that should mostly affect cellular cytoplasm and not nucleoplasm) went to the DNA and made such changes that started getting reflected in offsprings of the organism (as adaptation to the environmental change that happened). More intriguing is the fact that Nuclear DNA in modern primates have genome size of up to three gigabase pairs but there is no mechanism described that elongates the DNA.
Answer: DNA misreplication events can lead to accidental duplication of DNA (even the entire genome), misalignements in recomibination events, integration of DNA from extracellular sources e.g. viruses. All these events can lead to large scale changes in the genome size of an organisms, smaller scale changes can be insertions and deletions in the DNA from repair pathways such as non homologous end joining.


IRR -> Reinvestment Assumption Or Myth (And What It Actually Means)

Question: I've been trying to wrap my head around a downside of using IRR - the reinvestment assumption. I don't really understand the concept on how IRR assumes that we reinvest at the IRR, if IRR is for discounting backwards. Would be great if someone had an analogy or example so I can understand the actual concepts. Also, some people say that it's a myth or fallacy, and the IRR does not actually assume anything, which makes me even more confused. There's barely any information available, and I've tried to read all the research papers yet I still do not understand. Please help.
Answer: The idea behind the IRR is that there is some discount rate that makes the discounted cash flows add up to zero. That is, given a set of cash flows with amount a_i at time t_$, the sum over all i of a_i*d^(t_i) is zero (this is including all money put into the investment, including the initial principal, as negative). The IRR is then 1/d-1, or (1-d)/d. In other words, we find some number that when substituted in results in zero, and we take that as the associated return. (There are some situations where it can have more than one solution, though.)
This analysis does require that the total discount at any particular time be given by some constant raised to the time of the discount. So if we take A1 dollars out Y1 years after our initial investment, and A2 out Y2 after, we're treating A2 as being less valuable than A1, by a factor of d^(Y2-Y1). Equivalently, we're treating A1 as being more valuable by a factor of d^(Y1-Y2), or by a factor of (1+IRR)^(Y2-Y1). This implies that we're assuming that between receiving A1 and receiving A2, we were able to invest A1 somewhere that received a return of IRR, i.e., we reinvested all our returns at the IRR.
For example, suppose we invest $100k initially, and we get $60k back the first year, and $70k the second year. To calculate the IRR, we assume there is some r such that the $70k is the result of getting a return of r for two years, while the $60k is the result of getting r for one year. If we calculated everything in terms of current dollars, we divide the $60k by 1+r, and the $70k by (1+r)^2, while the $100k stays the same:
-$100k + $60k/(1+r) + $70k(1+r)^2 = 0
If we calculate everything in terms of final dollars, the $70k stays the same, the $60k is multiplied by 1+r, and the $100k is multiplied by (1+r)^2:
-$100k(1+r)^2 + $60k(1+r) +$70k = 0
Note that these two equations are equivalent, as the second can be obtained by the first by multiplying by (1+r)^2.
So going through the second equation, at the end of the second year, we have $70k that is just right there, we have $60k that we're assuming we were able to invest at a rate of r, and then there's $100k that has an opportunity cost (and thus is negative) that we could have invested and gotten (1+r)^2, and so we lost out on $100k(1+r)^2 by putting it in this investment instead.
Basically, IRR is asking "If there were some constant rate of return that allowed us to compare all our cash flows, what would it be?" There's a time value for the $60k being received a year before the $70k, and for us to be using a single rate of return that applies to not just time value, but to all the other returns, we assume that we reinvested the $60k at the IRR.


Apache rewrite url : remove text between last backslash(including) and last dot

Question: I'm trying to convert links like :
http://domain.com/images/67/ajjk3jj/7fdbf3a6a338ae5032ec2d1f08a2670f_81acc0dfd24507aa74b1de52767edca7/image.jpg
in links like :
http://domain.com/images/67/ajjk3jj/7fdbf3a6a338ae5032ec2d1f08a2670f_81acc0dfd24507aa74b1de52767edca7.jpg
So actualy i want to remove the text "/image" from the original link.
"image" text varies
I did something like but doesn't work. I need it only to show original file name in the images links but to store them in files generated names.
RewriteEngine On
RewriteRule ^/(.*?)\/(?!.*\/)(.*?)\.(?!.*\.)(.*?)/$ /$1.$3 [L]

Tested the regular expresion with php preg_replace and it works,but i get 404 error with apache.
i want to put the htaccess file in the root of the uploads folder.
If I manually remove the text from the link it leads to good image, so the only problem is the htaccess code.
LATER EDIT:
if i make something like this works so is not a problem with modrewrite module :
RewriteRule ^images/67/ajjk3jj/7fdbf3a6a338ae5032ec2d1f08a2670f_81acc0dfd24507aa74b1de52767edca7/image.jpg$ images/67/ajjk3jj/7fdbf3a6a338ae5032ec2d1f08a2670f_81acc0dfd24507aa74b1de52767edca7.jpg

jpg extension is not fixed, can be any kind of image
Answer: You can use this rule:
RewriteEngine On

RewriteRule ^(.+?)/[^/.]+(\.jpg)/$ /$1$2 [L,NC,R]


Wireguard routing issues IPv4+IPv6

Question: I'm trying to get a "simple" VPN working between two Linux boxes using Wireguard. Unfortunately, existing tutorials I've found weren't that helpful, because they usually A) only set up IPv4 and B) usually use IP masquerading ...
Config of machine A:
[Interface]
Address = 192.168.10.2/24
ListenPort = 51820

[Peer]
AllowedIPs = 192.168.10.0/24, 172.16.0.0/24, fdbb:bbbb:bbbb::/48, 2001:db8:bbbb:0000::/64
Endpoint = [2001:db8:bbbb:0000:1234:56ff:fe78:90ab]:51820
PersistentKeepalive = 20

Config of machine B:
[Interface]
Address = 192.168.10.1/24
ListenPort = 51820

[Peer]
AllowedIPs = 192.168.10.2/32, 10.0.0.0/16, fdaa:aaaa:aaaa::/48, 2001:db8:aaaa:0000::/64
Endpoint = [2001:db8:aaaa:0000:ba09:87ff:fe65:4321]:51820
PersistentKeepalive = 20

(Leaving out the keys because the tunnel itself is passing traffic so I know these are correct).
So, simple config, in theory. Machine A has no local firewall (only a typical consumer router with its built-in firewall, with UDP/51820 opened), machine B has ip(6)tables but only for all the Docker rules, and the default policies are set to Accept.
Both machines have net.ipv4.ip_forward=1 and net.ipv6.conf.all.forwarding=2.
That config didn't work, because Wireguard apparently tries to route its own wireguard traffic through the tunnel itself because the Endpoint IPv6 is included in the AllowedIPs network. Why would that not be excluded by default...
I tried to get around that by adding a fixed route to send traffic for that endpoint through the normal interface, not wg0:
PostUp = /usr/sbin/ip -6 route add 2001:db8:aaaa:0000:ba09:87ff:fe65:4321/128 via fe80::1 dev enp1s0
PreDown = /usr/sbin/ip -6 route del 2001:db8:aaaa:0000:ba09:87ff:fe65:4321/128 via fe80::1 dev enp1s0

With that setup (on both sides), the peers can ping eachother A) through the WG peer addresses (192.168.10.X), B) through their local IPv4 (10.0.X.X or 172.16.X.X), and C) through their ULA addresses.
However, I still have two issues with my tunnel:
A) Because I had to add that IPv6 route to the endpoint, that means traffic to the other peer's public IPv6 address does not go through the WG tunnel but travels directly over the internet. The peers cannot ping eachother using their public GUA IPv6 addresses. I would need something like that IP route I added using the PostUp parameter, but for that to only apply to the tunnel itself, not for traffic going through the tunnel. Like an IPv6 route where I can say "route UDP/51820 over this route (directly to the internet), but other traffic to that same IP over that route (wg0)".
B) I can't get everything to work from other machines in my network (over IPv4). On another machine on network A, I added a static route to the other network's IPv4: 172.16.0.0/24 via 10.0.1.25 dev enp7s0 metric 100.
When I now do a traceroute, the 1st hop is the wireguard machine (10.0.1.25), and the 2nd hop is the WG peer's address of the remote machine (192.168.10.1) (so it does go through the tunnel!), but after that, boom, that's it. No third hop with the actual destination (even though the other side's default gateway does have a static route to route 10.0.0.0/8 to that side's wireguard machine. I do not want to do IP masquerading which is the "solution" I found multiple times using Google. I want the other machines on the other network see exactly where the requests are coming from - a machine on the other side of the tunnel.
Over IPv6, using the ULAs, everything is fine. Added an IPv6 route on the gateway to route the other side's ULAs to the wireguard machine, and done. I just need to find a solution for the GUAs, probably with radvd on the wireguard machine announcing a route to that network.
TL;DR: Wireguard connection between two peers works, but A) how do I send non-Wireguard traffic to the wireguard endpoint IP over the tunnel as well, and B) why does IPv6 ULA routing work and IPv4 routing doesn't even though they're set up the same.
Comment: Check with tcpdump whether the gateway system is actually not forwarding _requests_ or whether it's not forwarding _replies._ Remember that the machine you're trying to ping needs to know a route back to the client's network...
Comment: Thanks for the hint. With tcpdump running on all four machines (source, wg source, wg destination, destination) I figured out the issue with the IPv4 route so IPv4 is now working. Only question remaining is the IPv6 one.
Answer: I managed to get that to work by using IP rules, using these commands in the wireguard config:
PostUp = ip -6 rule add to 2001:db8:aaaa::ba09:87ff:fe65:4321/128 ipproto udp dport 51820 table 200
PostUp = ip -6 route add default via fe80::1 dev eth0 table 200

PreDown = ip -6 rule del lookup 200
PreDown = ip -6 route del default via fe80::1 dev eth0 table 200

This adds an entirely seperate routing table 200 with only one (default) route to send all traffic to the local router, and then it adds an IP rule so that any UDP traffic to the endpoint's IPv6 on port 51820 will be handled according to that new routing table.
That way, UDP traffic for the WG tunnel itself will go to the router, but any other packets with that same destination IP will go through the WG tunnel.
And then I just added radvd on both sides of the tunnel, announcing a route to the other side's GUA prefix so devices in the network send traffic to the wireguard machine.
Comment: I think you might want to use `fwmark` to tag traffic and use 2 routing tables, reading this https://www.wireguard.com/netns/ helping me to understand some ways to manage this kind of problems, wg-quick use by default fwmark if you have 0.0.0.0/0 allowed

Wireguard routing issues IPv4+IPv6


Sql Server 2005 efficiency savings?

Question: Are there good efficiency savings using Sql Server 2005 over Sql Server 2000?
Or does it just have more services etc
Has anyone seen their system work any quicker after making the upgrade?
Answer: The surrounding tools such as Analysis Services were substantially rewritten and can get you a variety of wins depending on your requirements.  However I don't see a lot of really fundamental changes from 2000 to 2005 in the core database engine.
There are some improvements that may get you better performance in certain situations.  SQL2005 has much better support for 64-bit architectures and better table partitioning than SQL2000 (you can partition a table as opposed to making partitioned views).  64-bit support is the most likely to give you a performance win on a large system as it allows you to set up much larger caches.
Apart from those features I don't believe that there is really a large difference.  There are probably minor performance tweaks.
The main reason to move from SQL2000 to SQL2005 will be when SQL2000 goes out of support.  If you have a running application on SQL2000 there are not a lot of compelling reasons to switch to 2005 while 2000 is still supported by Microsoft.
Data Warehouse systems will get quite a few wins from moving to SQL2005.  SSIS, SSAS2005 and SSRS2005 are much better than their SQL2000 counterparts.
Answer: 2005 provides MVCC - row level versioning essentially - so as a developer there are some efficiencies: less locking to worry about.
Answer: I haven't migrated a system from 2000 to 2005 - I've either started with one or the other - so I don't have a comparison of my own. But there is a reasonable chance you will see a perf difference; if not by taking advantage of some of the new features like snapshot isolation, then at least by virtue of the fact that SQL2005's licensing model allows you to go multi-core at no additional licensing cost, and by the fact that SQL2005 has improved memory management.
Answer: SQL 2005 does a better job of working with caching. You used to have to poll SQL 2000 periodically to check for updates to a whole table. Now you can subscribe to a notification when something changes. It also works for queries, tables, and a few other elements.
Answer: Things will absolutely run faster with 2005.  There were several improvements made to the query optimizer.  And now you can create covering indexes so that the included columns only exist at the leaf level and don't have to get sorted.  That alone is an enormous improvement and reason enough to upgrade.
Comment: Only if the database is well designed. I've had the privilege of working with a monstrosity which actually ran slower under 2005
Answer: I would say yes for all of the reasons listed by others, but even if your SQL skills are not that strong and your queries are not that great they will probably run faster on 2005.  We moved from 2000 to 2005 and we had some complex queries that we could not get properly optimized in 2000.  When we moved to 2005 it ate the queries up!  Clearly the optimizer was making much better decisions out of the box.
I would strongly recommend moving to 2005 unless you have no issues with 2000.

Sql Server 2005 efficiency savings?


Proving $\frac{1}{\sin^{2}\frac{\pi}{14}} + \frac{1}{\sin^{2}\frac{3\pi}{14}} + \frac{1}{\sin^{2}\frac{5\pi}{14}} = 24$

Question: How do I show that:
$$\frac{1}{\sin^{2}\frac{\pi}{14}} + \frac{1}{\sin^{2}\frac{3\pi}{14}} + \frac{1}{\sin^{2}\frac{5\pi}{14}} = 24$$
This is actually problem B $4371$ given at this link. Looks like a very interesting problem.
My attempts: Well, I have been thinking about this for the whole day, and I have got some insights. I don't believe my insights will lead me to a $\text{complete}$ solution.

First, I wrote $\sin\frac{5\pi}{14}$ as $\sin\frac{9 \pi}{14}$ so that if I put $A = \frac{\pi}{14}$ so that the given equation becomes, $$\frac{1}{\sin^{2}{A}} + \frac{1}{\sin^{2}{3A}} + \frac{1}{\sin^{2}{9A}} =24$$ Then I tried working with this by taking $\text{lcm}$ and multiplying and doing something, which appeared futile.
Next, I actually didn't work it out, but I think we have to look for a equation which has roots as $\sin$ and then use $\text{sum of roots}$ formulas to get $24$. I think I haven't explained this clearly.

$\text{Thirdly, is there a trick proving such type of identities using Gauss sums ?}$ One post related to this is: How to prove that: $\tan(3\pi/11) + 4\sin(2\pi/11) = \sqrt{11}$ I don't know how this will help as I haven't studied anything yet regarding Gauss sums.
Comment: Most people would write *complete*, not $\text{complete}$. :)
Comment: In your first bullet, you probably mean $\sin \frac{5\pi}{14} = \sin \frac{9\pi}{14}$.  I would be more interested in the arithmetic progression of 1,3,5 than the geometric one because of the angle-sum identities.
Answer: The roots idea should work, but first convert to $\cos$ using the formula $1 - 2\sin^2 x = \cos 2x$.
You will need to get a polynomial of which $\cos (2k+1)\pi/7$ is a root (polynomial corresponding to $\cos 7\theta = -1$) and you are interested in finding out $\sum \frac{1}{1-r}$ over the roots $r$. By using the fact that $\cos 5\pi/7 = \cos 9\pi/7$ etc, you get your sum.
To complete it,
We have that the Chebyshev Polynomial $T_7(\cos x) = \cos 7x$
Thus the polynomial we seek is $\displaystyle Q(x) = T_7(x)+1 = 64x^7 - 112 x^5 + 56x^3 -7x +1$
Its roots are $\cos (2k+1) \pi /7$, $0 \le k \le 6$.
For any polynomial $P(x)$ with roots $r_1, r_2, \dots, r_n$ we have by differentiating $\log P(x)$ that
$$ \sum_{j=1}^{n} \frac{1}{x - r_j} = \frac{P'(x)}{P(x)}$$
Thus the value we seek is $\displaystyle \frac{Q'(1)}{Q(1)} - \frac{1}{2}$ (one of the roots is $\cos \pi = -1$) and this can easily be calculated to be $24$.
Comment: @Chandru: Yes you can. You can actually derive the polynomial yourself using $(\cos x  + i \sin x)^7 = \cos 7x + i \sin 7x$.
Comment: Without knowing chebyshev polynomials, can't this be solved?
Comment: I believe the roots of $T_7$ are $\cos(\frac{(2k+1)\pi}{14})$
Comment: @Thomas: That might be true, but we are looking at $Q(x) = T_7(x) + 1$.
Comment: @Aryabhata: one help. I need to find value of $\cos\frac{2\pi}{13} + \cos\frac{6\pi}{13} + \cos\frac{8\pi}{13}$. In this link: http://www.isibang.ac.in/~sury/luckyoct10.pdf Prof.Sury finds using Gauss sums magar another method se mey verify karna chahta hoon. Aap suggest karo.
Comment: @Chandrasekhar: Numerical verification is not enough? In any case, try to expand $(2x + 1)^2$, where $x$ is that expression. I have a feeling it will come to a neat value.
Answer: Use $\sin(x) = \cos(\frac{\pi}2 - x)$, we can rewrite this as:
$$\frac{1}{\cos^2 \frac{3\pi}{7}} + \frac{1}{\cos^2 \frac{2\pi}{7}} + \frac{1}{\cos^2 \frac{\pi}{7}}$$
Let $a_k = \frac{1}{\cos \frac{k\pi}7}$.
Let $f(x) = (x-a_1)(x-a_2)(x-a_3)(x-a_4)(x-a_5)(x-a_6)$.
Now, using that $a_k = - a_{7-k}$, this can be written as:
$$f(x) = (x^2-a_1^2)(x^2-a_2^2)(x^2-a_3^2)$$
Now, our problem is to find the sum $a_1^2 + a_2^2 + a_3^2$, which is just the negative of the coefficient of $x^4$ in the polynomial $f(x)$.
Let $U_6(x)$ be the Chebyshev polynomial of the second kind - that is:
$$U_6(\cos \theta) = \frac{\sin 7\theta }{\sin \theta}$$
It is a polynomial of degree $6$ with roots equal to $\cos(\frac{k\pi}7)$, for $k=1,...,6$.
So the polynomials $f(x)$ and $x^6U_6(1/x)$ have the same roots, so:
$$f(x) = C x^6 U_6(\frac{1}x)$$
for some constant $C$.
But $U_6(x) = 64x^6-80x^4+24x^2-1$, so $x^6 U_6(\frac{1}x) = -x^6 + 24 x^4 - 80x^2 + 64$.  Since the coefficient of $x^6$ is $-1$, and it is $1$ in $f(x)$, $C=-1.$  So:
$$f(x) = x^6 - 24x^4 +80x^2 - 64$$
In particular, the sum you are looking for is $24$.
In general, if $n$ is odd, then the sum:
$$\sum_{k=1}^{\frac{n-1}2} \frac{1}{\cos^2 \frac{k\pi}{n}}$$
is the absolute value of the coefficient of $x^2$ in the polynomial $U_{n-1}(x)$, which turns out to have closed form $\frac{n^2-1}2$.
Comment: Thanks a lot. I could have never thought of Chebyshev's polynomials even after @aryabhata had given a hint.
Answer: Another method would involve use of complex numbers.
** added **
OK, elaboration.

Let $w = \exp(i \pi/14)$ so that $w^7 = i$.  In (1) I factored $w^7-i$ and in (2) obtained the relation satisfied by $w$.  (3) is what we want to compute.  (4) is the relations of the trig functions to $w$.  In (5) we wrote the thing to compute in terms of $w$.  In (6) we took the denominator, and reduced it using the relation satisfied by $w$.  In (7) the same thing for the numerator.  So (8) is our answer, which is simplified in (9).
Comment: Could you elaborate?
Answer: We can derive $\cos7x=64c^7-112c^5+56c^3-7c$ where $c=\cos x$(Proof Below)
If $\cos7x=0, 7x=\frac{(2r+1)\pi}2,x=\frac{(2r+1)\pi}{14}$ where $r=0,1,2,3,4,5,6$
So, the roots of $64c^7-112c^5+56c^3-7c=0$ are $\cos\frac{(2r+1)\pi}{14}$ where $r=0,1,2,3,4,5,6$
So, the roots of $64c^6-112c^4+56c^2-7=0$ are $\cos\frac{(2r+1)\pi}{14}$ where $r=0,1,2,4,5,6$ as $\cos x=c=0$ corresponds to $r=3$
So, the roots of $64d^3-112d^2+56d-7=0$ are $\cos^2\frac{(2r+1)\pi}{14}$ where $r=0,1,2$ or $r=4,5,6$ as $\cos \frac{(7-k)\pi}7=\cos(\pi-\frac{k\pi}7)=-\cos\frac{k\pi}7$
If $$y=\frac1{\sin^2\frac{(2r+1)\pi}{14}}, y=\frac1{1-d}\implies d=\frac{y-1}y$$
So, the equation whose roots are  $\frac1{\sin^2\frac{(2r+1)\pi}{14}}$ where $r=0,1,2$ is $$64\left(\frac{y-1}y\right)^3-112\left(\frac{y-1}y\right)^2+56\left(\frac{y-1}y\right)-7=0$$
On simplification, $y^3(64-112+56-7)+y^2\{64(-3)-112(-2)+56(-1)\}+y()+()=0$
So using Vieta's Formulas, $$\sum_{r=0}^2\frac1{\sin^2\frac{(2r+1)\pi}{14}}=\frac{24}1$$
[
Proof:
(1) Using $\cos C+\cos D=2\cos\left(\frac{C-D}2\right)\cos\left(\frac{C+D}2\right)$
$$\cos7x+\cos x=2\cos3x\cos4x=2\cos3x(2\cos^22x-1)\text{ using }\cos2y=2\cos^2y-1$$
$$\text{ So, }\cos7x=-c+2(4c^3-3c)\{2(2c^2-1)^2-1\} \text{ using } \cos3y=4\cos^3y-3\cos y \text{ where } c=\cos x$$
$$\cos 7x=-c+(8c^3-6c)(8c^4-8c^2+1)=64c^7-112c^5+56c^3-7c$$
(2) Alternatively using de Moivre's formula,
$$\cos 7x+i\sin7x=(\cos x+i\sin x)^7$$
Expanding and equating the real parts $\cos7x=c^7-\binom72c^5s^2+\binom72c^3s^4-\binom76cs^6$ where $c=\cos x,s=\sin x$
So, $\cos7x=c^7-\binom72c^5(1-c^2)+\binom72c^3(1-c^2)^2-\binom76c(1-c^2)^3$
]
Answer: This may be a $3$ year old question, but I would like to add to the list an answer that relies on the sum of $\tan^2$ identity.
Let $$\begin{align}S &= \frac{1}{\sin^{2}\frac{\pi}{14}} + \frac{1}{\sin^{2}\frac{3\pi}{14}} + \frac{1}{\sin^{2}\frac{5\pi}{14}}\\
&=\frac{1}{\cos^{2}\frac{3\pi}{7}} + \frac{1}{\sin^{2}\frac{2\pi}{7}} + \frac{1}{\sin^{2}\frac{\pi}{7}}\\
&= \sec^2{\frac{3\pi}{7}} + \sec^2{\frac{2\pi}{7}} + \sec^2{\frac{\pi}{7}}\\
&= \tan^2\frac{\pi}{7} + \tan^2\frac{2\pi}{7} + \tan^2\frac{3\pi}{7} + 3\\
&= \sum_{k = 1}^3 \tan^2\frac{k\pi}{7} + 3\end{align}$$
From the sum of $\tan^2$ identity discussed over here, we have
$$
\sum_{k=1}^n\tan^2\frac{k\pi}{2n+1} = 2n^2+n,\quad n\in\mathbb{N}^+.
$$
In our case, set $n = 3$. Then,
$$\begin{align}S &= 2(3)^2 + 3 + 3 \\&=24 \end{align}$$
as desired.
Comment: If I'm not mistaken, this generalizes to give $\sum_{k=1}^n \csc^2 (k\pi/(2n+1)) = 2n(n+1)$, with $n = 3$ being the original question.
Answer:
$$S=\csc^2\frac{\pi}{14}+\csc^2\frac{3\pi}{14}+\csc^2\frac{5\pi}{14}$$

For people unknown to complex-number:
Let $s:=\sin,c:=\cos$ and the subscript as in $s_k$ denote $\sin\left(\frac{k\pi}{14}\right)$ and similiarly for other trigonometric ratios.
$$\csc^2\frac{\pi}{14}+\csc^2\frac{3\pi}{14}+\csc^2\frac{5\pi}{14}=\frac{(s_3s_5)^2+(s_5s_1)^2+(s_1s_3)^2}{(s_1s_3s_5)^2}\\
=\frac{(c_2-c_8)^2+(c_4-c_6)^2+(c_2-c_4)^2}{4s_1^2s_3^2s_5^2}
$$
Now, numerator is:
$$\begin{align}
(c_2-c_8)^2+(c_4-c_6)^2+(c_2-c_4)^2
&=2c_2^2+2c_4^2+c_6^2+c_8^2-2(c_2c_4+c_4c_6+c_2c_8)\\
&=1+c_4+1+c_8+1+\frac12(c_{12}+c_{16})-2(c_6+c_2+c_{10})\\
&=3+c_4+c_8-c_2-2(c_2+c_6+c_{10})\\
&=3-c_2+c_4-c_6-2(c_2-c_4+c_6)\\
&=3(1-c_2+c_4-c_6)\\
&=3(c_0+c_4+c_8+c_{12})\\
&=\frac3{2s_2}2s_2(c_0+c_4+c_8+c_{12})\\
&=\frac3{2s_2}(2s_2c_0+2s_2c_4+2s_2c_8+2s_2c_{12})\\
&=\frac3{2s_2}(s_2+s_2+s_6-s_2+s_{10}-s_6+s_{14}-s_{10})\\
&=\frac3{2s_2}(s_2)\\
&=\frac32
\end{align}$$
One thing to note is $\displaystyle c_0+c_4+c_8+c_{12}=\frac12$.
Now denominator is (do similarly for this):
$$\begin{align}
4s_1^2s_3^2s_5^2
&=4\frac1{16}(2(2s_1s_3)s_5)^2\\
&=\frac1{4}(2(c_2-c_4)s_5)^2\\
&=\frac1{4}(s_7+s_3-s_9-s_1)^2\\
&=\frac1{4}(1-s_1+s_3-s_5)^2\\
&=\frac1{4}(c_0+c_8+c_4+c_{12})^2\\
&=\frac1{4}\left(\frac12\right)^2\\
&=\frac{1}{16}
\end{align}$$
Comment: +1 You have a nice proof, but I don't think people who have not studied complex numbers would be given this type of problem.
Answer: We can prove (below), the roots of  $$z^3-z^2-2z+1=0 \ \ \ \ (1)$$
are $2\cos\frac{(2r+1)\pi}7$  where  $r=0,1,2$
So,if we set $\displaystyle t=\frac1{\sin^2{\frac{(2r+1)\pi}{14}}}$ where  $r=0,1,2$
$\implies 2\cos\frac{(2r+1)\pi}7=2\left(1-2\sin^2{\frac{(2r+1)\pi}{14}}\right)=2\left(1-\frac2t\right)=\frac{2(t-2)}t$ which will satisfy the equation $(1)$
$$\implies \left(\frac{2(t-2)}t\right)^3-\left(\frac{2(t-2)}t\right)^2-2\left(\frac{2(t-2)}t\right)+1=0$$
On simplification we have $$8(t-2)^3-4t(t-2)^2-4t^2(t-2)+t^3=0$$
$$\text{or, }t^3(8-4-4+1)-t^2(8\cdot3\cdot2-4\cdot4-8)+()t+()=0$$
$$\text{or, }t^3-24t^2+()t+()=0$$
Now, use Vieta's Formulas
[
Proof:
Let $7x=\pi$ and $y=\cos x+i\sin x$
Using De Moivre's formula,  $y^7=(\cos x+i\sin x)^7=\cos \pi+\sin\pi=-1$
So, the roots of $y^7+1=0\ \ \ \ (1)$
are $\cos \theta+i\sin\theta$ where $\theta=\frac{(2r+1)\pi}7$ where $r=0,1,2,3,4,5,6$
Leaving the factor $y+1$ which corresponds to $r=3,$
we get $y^6-y^5+y^4-y^3+y^2-y+1=0$
Dividing  either sides by $y^3,$ $$y^3+\frac1{y^3}-\left(y^2+\frac1{y^2}\right)+y+\frac1y-1=0$$
$$\implies \left(y+\frac1y\right)^3-3\left(y+\frac1y\right)-\{\left(y+\frac1y\right)^2-\}+y+\frac1y-1=0$$
$$\implies  z^3-z^2-2z+1=0\ \ \ \ (2)$$ where $z=y+\frac1y=2\cos\theta$
Now, since $\cos(2\pi-A)=\cos A,\cos\left(2\pi-\frac{(2r+1)\pi}7\right)=\cos\left(\frac{(13-2r)\pi}7\right)$ where $r=0,1,2$
So, the roots of equation $(2)$ are $2\cos\frac\pi7=2\cos\frac{13\pi}7, 2\cos\frac{3\pi}7=2\cos\frac{11\pi}7$ and $2\cos\frac{5\pi}7=2\cos\frac{9\pi}7$
]


PNP/NPN - Why do we not just use one of the two types?

Question: Using PNP instead of NPN merely requires one to make circuit upside down and reverse current direction, if this is true then why don't we just do everything with NPN transistors? Are there any applications where we can only use one of the two types? Why?
Comment: If all circuit designs used only one type (NPN or PNP) of transistor then it would be easy to redesign it with the other type. However, many circuits are designed to utilise the properties of both types (e.g a class B output stage) then its pretty difficult to substitute only one type of device. Even in the H bridge example you end up with one transistor acting as a switch and the other as an emitter follower - the circuit works but not as efficiently as the PNP/NPN combo. Take a look at the internal circuits of logic chips, op amps etc. We need and use both types.
Comment: Sure, there are plenty of applications that use only one type- A common emitter single stage amplifier for example.  But certain applications like a push-pull output are best constructed with both types of transistors.
Comment: H-bridges, cars where the entire chassis is GND
Comment: @kolosy - you can build H bridge using only npn transistors, using pnp+npn is definitely easier though. OP - most circuits that use both can be modified to use just one type of transistor, but in a lot of those cases it is cheaper/simpler to use both npn and pnp. Reducing the number of unique components does not always make the circuit simpler...
Answer: There have been times when transistors with specific characteristics were feasible in NPN, or PNP, but not vice-versa.
Two examples :
The 2N3055 power transistor was NPN, at a time when PNP transistors of the same power were simply not available (115W I think, later pushed to 150W).
That led to the "output triple" - a combination of 3 transistors that could replace either NPN or PNP output transistors, with the power handled in either case by the 2N3055. This was used in the famous Quad 303 amplifier of the early 1970s.
Another example : the BC214 PNP transistor could achieve lower noise in a microphone amplifier or audio input stage than contemporary NPN transistors.
With further developments in process technology, these considerations are less important than they were.
Comment: The point of the output triple isn't really to solve the PNP problem, it is to solve the bias problem without thermal feedback. It's the Lin circuit that solves the PNP problem, and a version of that is used in the Quad triple.
Answer: For many years, we did use only NPN transistors.  Well actually, they weren't called transistors but "vacuum tubes".  It would have often been convenient to have the complement of NPN or N-channel vacuum tubes, but those didn't exist.  So yes, it's possible.  You could do similar things today by designing a audio power amplifier, for example, using only NPN or only PNP transistors.
However, having complementary parts can be very useful and allows for circuit topologies not possible using just one polarity.  Think of something like a audio power amplifier that needs to drive its output equally above and below ground.  Individual transistors pull in one direction, and the rest of the circuit has to pull in the other direction if you want the signal to go that way.  It shouldn't be hard to imagine that you can use one polarity transistor to pull high and the opposite polarity to pull low.  The tops and bottom halves of such circuits are then mirror images of each other about ground, which requires flipping the polarity of the transistors.  The output stages of most transistor audio power amplifiers exploit this NPN/PNP symmetry and really do work this way.
Answer: Having both pnp and  npn transistors gives designers more flexability .Remember that all valves were N channel or npn .The filament dont emit positrons.Electrons are more mobile than holes so one would expect npn to give better performance .For Si BJTs the differences are very noticable at the high power area .Small signal  GP transistors  perform the same regardless of pnp or npn .Ge transistors are mainly pnp due to fabrication issues .In fact the npn types were worse .
Answer: If you go back to the early 1960's we only had Germanium transistors and they were all PNP; circuit diagrams were drawn with the -ve supply at the top. To provide enough power for a speaker the standard six transistor radio used transformer coupling to provide a push-pull output.
Germanium was very prone to thermal runaway so transistor power amps didn't come into their own until the silicon 2N3055. Having PNP and NPN with matched characteristics makes symmetrical design so much easier.
Answer: One application where you can only use one type is when you implement the BJT as a "parasitic" PNP in a standard CMOS process.  In a typical CMOS process NPNs are impossible to implement but a useful PNP can be made in which the collector is implemented in the substrate, the base is an n-well, and the collector is a p diffusion within that n-well.  For more detail see pg. 3 of the following:  notes on IC biasing This is extremely useful in the implementation of temperature-insensitive bias circuits, most notably the bandgap reference.  Bandgap references.  Note that a CMOS implementation using substrate PNPs must have the collector at ground, but the circuit in the link can be recast.


Cluster Arrow+Loaded For Bear=low dps, what should i do?

Question: Every time I use Cluster Arrow with the Loaded for Bear rune, my DPS drops from 41K to 16K. what is happening and what should I do?
Comment: Try out the cluster bombs rune, its what I run on my DH and its great.  As for DPS dropping, are you using sharp shooter by any chance and getting a crit hit?
Comment: What were you using before?
Comment: It will most likely be what you are not getting then what you are getting from the Loaded for Bear rune.
Answer: While consecutive rune unlocks are generally upgrades, the actual difference is relative to the situation you use it in. Consider a level 70 player:

Cluster Arrow deals up to 1100% base damage as fire to a target location.
Dazzling Arrow deals up to 1100% base damage as lightning to a target location, and also applies the stun effect.The stun effect will only have an impact on DPS if you have any abilities that amplify or impart damage if an enemy is stunned, or if you are otherwise being hindered in your ability to damage the enemy by the enemy's attacks. You will likely have a higher DPS against enemies that freeze with attack, for example, as you will be able to stun them to limit being frozen.
Shooting Stars deals up to 1800% base damage as physical.
Maelstrom deals up to 2250% base damage as cold, and heals you for every enemy hit. Healing has almost no effect on DPS. Consider that you might have an item that gives you guaranteed critical hits at below 20% health, and that the healing could potentially bring you out of that automatic critical buff, reducing your expected damage output.
Cluster Bombs drops a bombing line of explosives, each dealing 525% base damage as fire. You will likely find this rune a lot less effective against smaller groups of enemies, as most of the bombs along the line will probably miss the target. This will be far more useful against larger clusters of enemies, or larger bosses, where you can ensure maximum grenades hit an enemy along the line.
Loaded for Bear increases the initial impact, giving you a potential 1320% base damage in fire against an enemy.

Taking the element into account goes a long way, given you can have buffs to damage of a certain element, and certain enemies are strong against a particular element.
Looking at the comparisons, Loaded for Bear is only giving you a more powerful, condensed, fire attack. Unless you are in a situation where fire is most favorable, you could expect a better damage output from pretty much every other rune, excluding Dazzling Arrow.
Numbers taken from the battle.net entry for Cluster Arrow.
Comment: You are wrong on several points. 1) Abilities that increase damage versus stunned enemies, as any other "situational buff", are never shown in sheet DPS. 2) Elemental damage is not shown in sheet DPS (though can be viewed by hovering on "Element Damage +x%" line). 3) There are no monsters in Diablo 3 that are "weak or strong against a particular element".
So the only piece relevant to the question is about healing and crit buff. (still less likely that losing the Sharpshooter bonus).
Comment: I considered the question in relation to true DPS, but if the extra effects do not show up on the DPS output that would not account for the drastic change.

There are, however, enemies with elemental resistance.
Comment: I was going to ask you about any specific monsters with elemental resistances, now that Corrupted Angels' Unholy Shield is removed (and it was still more of a fancy health buff than a proper resistance due to its flexibility), but then I found them myself. There are now *exactly two monsters with elemental resistances* in Diablo 3. They are called Rogoth the Eternal and Keeper Hashemel, and they spawn in two dungeons under Battlefields of Eternity. I am defeated :-D
Comment: Makes me wonder what the point of the highest rune adding a meager 220% increase to the base impact is, when the missile runes unlock earlier and do a lot more damage. I have not played Demon Hunter in a long time.. am I right to presume that missiles do not, in fact, do splash damage? Or rather, they target a single enemy?

It might make sense, then.
Comment: Yes, the key is splash damage. Rockets also do not hit the same target, so max damage against a single monster is initial impact + 1 rocket. LfB, SS and Maelstrom are all popular for endgame builds. LfB for its splash damage (in parties with a puller), Maelstrom somewhat for its healing, but mainly SS vs Malestrom depends on the build's main element. SS may be a bit weaker, but Fire builds allow for a larger elemental bonus.


How to plot the discrete time signal $u[2k - 3]$?

Question: I am having a hard time plotting this graph. Do I express it as $u[2(k - 1.5)]$? But then still the step occurs for $k = 1.5$ which isn't possible for discrete time signals as they take integer values for $k$. So how to approach this?
Answer: $u[n]$ is the unit step function with the definition
$$ u[n] = \begin{cases}{ 1 ~~~, ~~~n \geq 0 \\ 0 ~~~,~~~ n < 0 } \end{cases} $$
Then you will have for $u[2k-3]$ as
$$ u[2k-3] = \begin{cases}{ 1 ~~~, ~~~ 2k-3 \geq 0 \\ 0 ~~~,~~~ 2k-3 < 0 } \end{cases} $$
$$ u[2k-3] = \begin{cases}{ 1 ~~~, ~~~ k \geq 2 \\ 0 ~~~,~~~ k< 2 } \end{cases} $$
I think this last line is easy to see. You can plot it wrt the variable $k$.
Answer: Dealing with indices, shifts ($-3$) and scaling ($2k$) can be confusing.
Most functions used in such exercices are made of combinations of basic signal functions like discrete $\delta$ Diracs, unit steps or discrete Heaviside, etc.
Hence, in such exercices, they are often piece-wise constant or piece-wise  linear. So you can determine the resulting signal from the breakpoints only, and "interpolate" the remaining points.
A first option is to take a  graph paper, and sketch the function around its change points: the change point (if it exist), and the closest points on the left and right.
Here, $u[2k-3]$ will be a shifted and time-scaled  version of $u$, so it is piece-wise constant. It changes when $k=3/2$ (does not exist on the discrete axis). Let us check:

at $k = 1$ (just below $3/2$): $u[2\times 1- 3] =u[-1]=0$,
at $k = 2$ (just above $3/2$): $u[2\times 2- 3] =u[0]=1$.

Then, you have it, by extending the constant on each side. Same works for piece-wise linear (even polynomials). For a non-graphical clean proof, there you have @Fat32 answer.


Transformer ratings

Question:
What physical factors one needs to take into consideration (like maximum core field and saturation) to rate the "voltage rating" of a transformer?
Suppose that the voltage rating of a transformer isn't known (or you aren't allowed to look at its nameplate), is there an experimental way to determine the voltage ratings of the transformer?
As far as I understand, transformers are usually operated at their rated voltages. Also, if supply exceeds the rated voltage, current starts leaking through insulations, the core gets heated up and so on. Why then is it so that transformers are operated at a verge, voltages beyond which beyond could possibly harm the transformer?
Comment: 1. Core saturation. 2. Measure the magnitizing current. When it starts to distort/duck tail at the end of the sine wave, you have reached the limit. 3. Incorrect. You reach saturation and magnitizing current becomes excessive, tripping some protection, fuse or breaker.
Answer: 1) Core saturation limits the maximum voltage.time product you can apply. Therefore at a higher frequency, you can use a higher voltage.
2) If you have a variable voltage supply, say a variac, or a sine-wave generator and a power amplifier, then measuring the magnetising current while increasing the voltage into a single winding on an unloaded transformer is the best way. Plot the measured current against the applied voltage. The graph will suddenly kick upwards at the onset of saturation. Exactly where you want to operate in the vicinity of this 'knee' is up to you.
If you don't have a variable voltage supply, then a constant or limited current supply from a high voltage is a good second. Use a low power filament lamp in series with a high voltage to limit the current into a low voltage winding. Measure the voltage developed. Note this is likely to be already in saturation, so you should operate comfortably below this.
3)  Operating at the rated voltage, core heating occurs through hysteresis loss (function of the core magnetic properties alone) and through eddy current losses (function of its electrical conductivity and lamination thickness). If supply exceeds rated voltage, magnetising current rises dramatically and increases heating in the primary winding. Core heating increases a little due to the slightly increased field.
Transformers are operated at winding voltages suitable for their core saturation, and at maximum voltages between windings given by the insulation between the windings. If you exceed either of these, the transformer will fail.

Transformer ratings


How can I print multiline output on the same line?

Question: Is there a method to print multi-line output (single output) on the same line?
For example, if the output is:
abc
def
qwerty

Is it possible to print:
abcdefqwerty

Answer: You can remove all occurrences of characters from a given set with tr -d. To remove the newline character use:
tr -d '\n'

As always you can use input and output redirection and pipes to read from or write to files and other processes.
If you want to keep the last newline you can simply add it back with echo or printf '\n', e. g.:
cat file1 file2... | { tr -d '\n'; echo; } > output.txt

Comment: For those that want to keep a space between each line, you can use `tr '\n' ' '`
Answer: Many ways. To illustrate, I have saved your example in file:
$ cat file | tr -d '\n'
abcdefqwerty$
$ cat file | perl -pe 's/\n//'
abcdefqwerty$

That removes all newline characters, including the last one though. You might instead want to do:
$ printf "%s\n" "$(cat file | perl -pe 's/\n//')"
abcdefqwerty
$ printf "%s\n" "$(cat file | tr -d '\n')"
abcdefqwerty

Comment: I think the `printf` + `cat` + `perl` combo is much better handled via `perl -pe 's/\n//;END{printf "\n"}' input.txt`  Single process, no command-substitution and messing with quotes, and no UUOC. Perhaps.
Answer:
You can pipe your multiline output through awk
awk '{printf "%s",$0} END {print ""}'

or use sed:
sed ':a;N;$!ba;s/\n//g'

Example run
$ echo -e "1\n2\n3\n4" | awk '{printf "%s",$0} END {print ""}'
1234
$ echo -e "1\n2\n3\n4" | sed ':a;N;$!ba;s/\n//g'
1234

Further reading: remove line break using AWK · serverfault.SE
Answer: Also your_command | paste -sd '' which preserves the trailing newline.
Answer: This answer has a solution to the problem you are trying to create: Why does bash remove \n in $(cat file)?
If you type cat myfile.txt you will see:
abc
def
ghi

But if you type echo $(cat myfile.txt) you will see:
abc def ghi

Note this method inserts a space where separate new lines used to be. This makes the output easier to read but doesn't strictly adhere to your question scope.
Answer:
If you want to use Perl for this, you can use its chomp function:
perl -pe chomp

Some more details, for those who are interested.
You can pass one or more filenames as subsequent arguments.
perl -pe chomp file1 file2 file3
In some cases you might not want to do that, but you can pipe or redirect to that command instead. (These abilities--and that caveat--all apply to any other perl -p or perl -n based solution, too.)
So, if you want to process output from running some-command:
some-command | perl -pe chomp
This is potentially faster than the Perl command in terdon's answer. Newline characters (represented by \n) only appear at the end of lines in this situation--because they are what Perl is using to decide where each line ends. s/\n// searches through the entire line for newlines, while chomp just removes the one at the end (if any, as the very last line might or might not have one).
Performance might not really be the main reason to prefer chomp. The  perl command in terdon's answer would only be slightly slower unless you're processing a huge file with very long lines. And if you need speed, David Foerster's way is still probably faster. chomp is, however, exactly the right tool for this if you are using Perl, and I think the intent of chomp is clearer than that of s/\n//. Ultimately there's probably no objective answer as to which is better.
Printing a final newline.
However, I do recommend against the use of command substitution ($( )) just to ensure a trailing newline gets printed. Unless the text you're processing is short, that's likely to be quite slow--it has to collect all the text at once and then print it--and it makes your command harder to understand. Instead you can do as David Foerster suggested and run echo or printf '\n' afterwards.
perl -pe chomp; echo

If you're piping from or (as David Foerster shows) redirecting from that command, then you can enclose it in { ;} so that the output of both commands is taken together. If you're just printing it to the terminal, then you can run it exactly as shown above. This works even if you're piping or redirecting to the command, because echo/printf '\n' does not actually read any input. That is, this works:
some-command | perl -pe chomp; echo
While here you cannot simply remove the { ;}:
{ perl -pe chomp; echo; } | some-other-command
Or, if you prefer, you can make perl print the final newline itself. Like enclosing the perl and echo commands in { ;}, this approach works even if you're piping or redirecting from it (and, like all approaches, this works when you're piping to it, too):
perl -wpe 'chomp; END { print "\n" }'

Note that the command in terdon's answer works fine with these methods of printing the final newline, too. For example:
perl -pe 's/\n//'; echo

perl -pe 's/\n//; END { print "\n" }'

Comment: `perl -wpe 'chomp; END { print "\n" }`  is same process, minor advantage over adding trailing echo
Answer: Using shell-only way:
while IFS= read -r line || [ -n "$line" ]; do printf "%s"  "$line"; done < inputfile.txt

Answer: If you are using Bash, then you can do it without any external tool.
x=($(echo line1; echo line2))
echo "${x[@]}"

Result:
line1 line2

The first command turn multiline output into an array, the second command expand array into multiple arguments on one line.


Why doesn't a car slide down a banked road when there is no friction?

Question: In case of banked roads without friction, there is an additional $mg \sin(\theta)$ which is unbalanced. Why isn't this taken into account because it is responsible for making the vehicle slide down the inclined plane?
Comment: Can you elaborate on this? Are you talking about a stationary car or a moving car? If the latter, what speed is the car moving?
Comment: When describing a physical situation it is important to *communicate clearly*.  Otherwise people will be left to guess.  (This is too-often a fault in published papers, which makes me wonder if anyone read them prior to publication.)  In addition to not specifying the motion of the car, you leave us guessing as to what $\theta$ is.  Here it's not a big deal because it's clear from context, and a little work.  Contributors here are volunteers;  it's good form not to give them extra work in figuring out your meaning.  On an exam, you'll get points off.
Answer: When you're in a vehicle turning on a road, you'll feel a centrifugal force on the vehicle. This will be in the horizontally outward direction. The centrifugal force and weight add up vectorially.
\begin{align}
\vec{F_w} &= m\vec{g} \\
\vec{F_c} &= m |\vec{\omega}|^2 \vec{r} \\
\therefore \vec{F_{net}} &= \vec{F_w} + \vec{F_c}
\end{align}
Now, it so happens that, if your velocity through the turn is just right, the forces line up such that the net force is perpendicular to the road, and this is what you get:

This would mean that the only force on the vehicle is pushing it into the road, so it doesn't slide down.
In this case,
\begin{align}
\tan(\theta) &= \frac{|\vec{F_c}|}{|\vec{F_w}|} \\
\therefore \theta &= \tan^{-1} \left( \frac{\omega^2 r}{g}\right) \\
&= \tan^{-1} \left( \frac{v^2}{gr}\right)
\end{align}
Where,
$r$ is the radius of the turn
$v$ is the velocity through the turn
$\omega$ is the angular velocity through the turn
Comment: Interestingly, a bobsled track has a "continuously varying" bank angle, and as the sled goes faster it "climbs" more as it attempts to maintain exactly the equilibrium described here.
Comment: Isn't there a reaction force exerted on the car by the road?
Comment: @User58220, the reaction is equal and opposite to the net force, so it cancels it out. This is why the car doesn't sink into the road. The reaction force is always perpendicular to the surface, so it is irrelevant when you're thinking about the car sliding down the road.
Comment: So when the missing force is added, there is no net force on the car, and thus no acceleration in any direction?
Comment: @User58220, The car is not an inertial reference frame, so no force does not entail no acceleration.
Comment: Even after you explicitly include the fictitious force that lets you apply Newton's laws in a non-Newtonian frame?
Comment: @User58220 Well, yes. From the point of view of the car, it is at rest, and the road is moving. However, it experiences a force which is trying to push it outwards. This is the centrifugal force. Your analysis of the situation is exactly the same as mine, but in an inertial frame. If you're trying to make a point, please do so and spare me the riddles.
Answer: The normal analysis of this problem involves working in the frame of reference of the road;  one where Newton's laws of motion apply, and there are no fictitious forces needed.
In this diagram:

the two solid lines represent the only two real forces acting on the car:  the force of gravity, $mg$, acting downward, and the reaction force of the road, $N$ , acting upward at right-angles to the road.
Since the car is not accelerating vertically, we have that, vertically:$$N\cos\theta=mg$$and, since there is enough horizontal Centripetal Force to keep the car moving in a circle  $$N\sin\theta=\text{Centripetal Force}$$
The Centripetal Force is specified by the mass of the car, the velocity, and the radius of the curve.
You could chose to resolve all these forces along the road and at right angles to the road;  the results would be messier, but not basically different;  for forces along the road (down to the right positive)$$mg \sin\theta = (\text{Centripetal Force})\times \cos\theta$$ and for forces acting at right angles to the road (above the road positive)$$N-mg\cos\theta=(\text{Centripetal Force})\times \sin\theta$$


How to isolate bad sectors on a hard disk in Windows 7?

Question: If I know that a hard disk has bad sectors, how can I "mark" them so that Windows 7 doesn't write to them when I copy files and stuff?
Answer: According to Microsoft, running a regular (or full) format (as opposed to a "quick" format) on a partition will mark all bad sectors within the partition (emphasis mine):

When you choose to run a regular format on a volume, files are removed from the volume that you are formatting and the hard disk is scanned for bad sectors. The scan for bad sectors is responsible for the majority of the time that it takes to format a volume. source

In Vista and later, this is accomplished by writing zeros to the entire partition.
Running a full format on a disk is as simple as right-clicking on the disk, selecting Format, and unchecking the quick format box:

Note that a full format takes a lot more time than a quick format. The time scales with the size of the disk (i.e. big disks will take more time to format than small ones).
Comment: This is what I ended up doing on a hard drive with bad sectors - the linux equivilent would be mkfs -c. If its got bad sectors, it may be sign of other nasty things happening, so, be careful and don't keep anything critical and not backed up on it
Comment: k i`m going to try this after i finish copying existing stuff on another hdd. I think it has bad sectors bc I didn't use the hdd for a long time, and I kept the hdd out of the original case
Answer: This is done automatically by the OS and NTFS.  To check this now, just run CHKDSK.  Any bad sectors are marked and are not used. CHKDSK /R will try to recover the bad sector.
One (of several!) ways to get there: open Windows Explorer; right click on the drive and select Properties from the context menu; select Tools tab; select Check Now.  This runs on the next reboot because it can't make changes to files that are in use.
Note: You must be logged in on an administrator account to check your disk at this level.  You may also get a UAC prompt.
If you want to run CHKDSK directly:

Click on Windows Start button; type comma in the search box; select Command Prompt from the list to open a Command Prompt window (or right click on it; select Run as administrator from the context menu; etc.)
Type CHKDSK /? to get a list of options (upper or lowercase doesn't matter).
Type CHKDSK C: /F /R to check your C: drive for errors and automatically repair them.
Restart so scan runs.

I assume you're referring to a standard rotating hdd with NTFS format (though FAT isn't really different for this answer).  Solid state drives handle this problem internally.
A few bad sectors (typically size of 4k but even 64k if optimized for storing large files) on a 50 GB, 500 GB, or 2 TB disk is not worth worrying about (and if the drive is only a few GB, maybe it is time to replace it).
I suppose if you really want to fiddle, you could partition around the bad tracks that contain the bad sectors (so the read/write heads don't pass so directly over them) but if your time is worth a more than $1/day or you're that worried, consider buying a new disk.  I think I've seen some software that semi-automates this but I have a hard time coming up with a scenario where I would want to do this.  (I look forward to seeing good stories in the comments though!)
From Command Prompt
chkdsk /?
CHKDSK [volume[[path]filename]]] [/F] [/V] [/R] [/X] [/I] [/C] [/L[:size]] [/B]

  volume          Specifies the drive letter (followed by a colon),
                  mount point, or volume name.
  filename        FAT/FAT32 only: Specifies the files to check for fragmentation.
  /F              Fixes errors on the disk.
  /V              On FAT/FAT32: Displays the full path and name of every file
                  on the disk.
                  On NTFS: Displays cleanup messages if any.
  /R              Locates bad sectors and recovers readable information
                  (implies /F).
  /L:size         NTFS only:  Changes the log file size to the specified number
                  of kilobytes.  If size is not specified, displays current
                  size.
  /X              Forces the volume to dismount first if necessary.
                  All opened handles to the volume would then be invalid
                  (implies /F).
  /I              NTFS only: Performs a less vigorous check of index entries.
  /C              NTFS only: Skips checking of cycles within the folder
                  structure.
  /B              NTFS only: Re-evaluates bad clusters on the volume
                  (implies /R)

The /I or /C switch reduces the amount of time required to run Chkdsk by
skipping certain checks of the volume.

Comment: Note that the /R parameter implies (or includes, if you prefer) the /F parameter. Thus, while including /F with /R won't do any harm, it is redundant to do so.
Answer: If you didn't dropped drive and you have just 1-2 have bad sectors:
1) Scan with HDtune then find bad sectors lba (ex : 10000000)
2) Download HDDreg.iso , write to USB Flash drive (or CD) and boot from it >  select your disk > select option 3 ( regenerate all sectors in range ) >  write lba and start operation .
3) Then rescan with HDtune : If didn't fixed , format drive with windows, but don't thick "Quick format" checkbox (When it formats , it will hide sector).
4) If still didn't fixed,try this - install hard disk sentinel > select disk > open surface scan > select "reinitailize disk surface" and start test. It will remap bad sector to spare area . "Reallocated sectors" SMART attiribute will improve


How do I convert image files to .edj format from the command-line?

Question: I have recently installed the E17 fork, Moksha, on my Sabayon Linux machine the problem is that the graphical tools for changing the wallpaper to JPG or PNG files are causing me grief (and yes I have tried to get support for this from the Bodhi Linux community, see this forum post), but I seem to be able to use wallpapers (including animated ones) in .edj format quite easily. So I was hoping that someone would have a shell script (that's simple enough for me to be able to use) or something I can run from the command-line to convert my JPG and PNG wallpapers to the .edj file format.
Answer: I'll give you the extract of the code for variety that does this. This version of the code just embeds a path to the image rather then including the image in the edj file as well.
OUTPUT_DIR="$HOME/.e/e/backgrounds"

TEMPLATE='
images { image: "@IMAGE@" USER; }
collections {
  group {
  name: "e/desktop/background";
  data { item: "style" "4"; item: "noanimation" "1"; }
  max: @WIDTH@ @HEIGHT@;
  parts {
    part {
    name: "bg";
    mouse_events: 0;
    description {
      state: "default" 0.0;
      aspect: @ASPECT@ @ASPECT@;
      aspect_preference: NONE;
      image { normal: "@IMAGE@"; scale_hint: STATIC; }
    }
    }
  }
  }
}
'

OFILE="$OUTPUT_DIR/variety_wallpaper_$RANDOM"

DIMENSION="$(identify -format "%w/%h" "$WP")"

if [ ! -z "$DIMENSION" ]; then
    WIDTH=$(echo $DIMENSION | cut -d/ -f1)
    HEIGHT=$(echo $DIMENSION | cut -d/ -f2)
    IMAGE="$(echo "$WP" | sed 's/[^[:alnum:]_-]/\\&/g')"

    if [ -z "$HEIGHT" -o "$HEIGHT" = "0" ]; then
        ASPECT="0.0"
    else
        ASPECT=$(echo "scale=9; $DIMENSION" | bc)
    fi
fi

printf "%s" "$TEMPLATE" | \
sed "s/@ASPECT@/$ASPECT/g; s/@WIDTH@/$WIDTH/g; s/@HEIGHT@/$HEIGHT/g; s|@IMAGE@|$IMAGE|g" > "$OFILE.edc"
edje_cc "$OFILE.edc" "$OFILE.edj" 2>/dev/null
rm "$OFILE.edc"

Full source is http://bazaar.launchpad.net/~peterlevi/variety/trunk/view/head:/data/scripts/set_wallpaper
If you want to embed the image you might do the following, I got this by creating a wallpaper through enlightenments UI and decompiling it with edje_decc
images { image: "1920x1080.png" LOSSY 90; }
collections {
  group { name: "e/desktop/background";
  data { item: "style" "4"; }
    data.item: "noanimation" "1";
    parts {
      part { name: "bg"; mouse_events: 0;
        description { state: "default" 0.0;
          aspect: 1.777777778 1.777777778; aspect_preference: NONE;
          image { normal: "1920x1080.png";  scale_hint: STATIC; }
        }
      }
    }
  }
}

you would then build the theme with edje_cc -id . -fd . e_bgdlg_new.edc -o 1920x1080.edj presuming the above was in the file e_bgdlg_new.edc and your image was in the same directory as where you were calling the script


Can I put a GFCI outlet on a 3-way switched feed to a garage?

Question: I'm running 14/3 UF cable from my house to my garage. I start with a two wire source to a 3-way switch to a 3-way switch in the garage to a few lights. Can I put a GFCI receptacle on the outside of the house between the 3-way switches? if I run 14/3 will that give me the extra wire I need?
Comment: Any reason you can't put the GFCI upstream of the switches (or on a breaker, or _after_ the switches)? This seems like needless complexity.
Comment: If you haven't buried the cable yet, take look at running conduit instead for future upgradability. Bonus points if you oversize the conduit large enough that a future owner can easily run cable for EV charging - I've heard that can bump the house's resale value a bit.
Comment: Do you want the GFCI receptacle to be controlled by the two switches?  Or always on?    I don't know what you mean by "between the switches".  The cable to the receptacle will be connected in a junction box, presumably *at* one of the switches.    Usually one of the boxes will have an always-on wire, and the other one will have a source of switched power available.   If you add a junction box in between, you have power that is controlled by one of the switches but not the other one, and it will be randomly out of sync with the lights.
Comment: *Can I put a GFCI outlet on a 3-way switched feed to a garage?* Sure, as long as it's next the switch with the incoming power and the neutral is present.
Answer: No, you cannot put a receptacle on a 3-way cable (14/3) which consists of ground, neutral, and two travelers - there is no "hot" in this cable.
To add a receptacle where you want it, run a proper 14/2 cable out to it.
Answer: A /3 cable running between 3-way switches carries two travelers and one other wire. In your case, that extra wire is neutral. You need to either use a /4 cable and include hot, or use a separate /2 cable with hot and neutral for the receptacle(s).
As far as where to put the GFCI (no matter how you get there), I highly recommend putting a GFCI/receptacle inside the garage and then use the LOAD connection to wire up an ordinary receptacle (weather resistant, with an in-use cover, but not GFCI) outside. That will protect the GFCI from rain and help it last longer, while still keeping the GFCI reset location nearby.
Comment: I know what you intended, but saying " wire up an ordinary receptacle (weather resistant, with an in-use cover, but not GFCI) outside. ..." risks them connecting it upstream from the GFCI. You said " ... use the LOAD connection ..." So it should be very clear already, but my "things can go wrong" engineers brain suggests adding eg " so that the outside socket is protected by the GFCI...". You may (undwerstandably) consider that's overkill. (I'm 71. I'm still alive. I look for traps.)
Comment: Just an FYI, The /4 solution will work with a standard 3-way, but not with a smart switch that needs to use a neutral to power the switch. I ran into this exact same problem where the original 3-ways worked fine, but as soon as I replaced with smart switches, it kept tripping the GFCI between the switches. In this case I think the best solution would be to use the separate /2 cable.
Answer: Your question is how to deliver 3-way control and receptacle power on a single 14/3.
Only way I know is Smart Switches.  But that's powerful.
You will have two choices of how to wire it, depending on the product selection you use.
First, a smart switch master in the garage - take care to select one that has a partner "smart switch remote" that has the control features you want at the house.  Now the wires in the 14/3 will be:

Black = always-hot
White = neutral
Red = datacomm signal line between the switches (if needed; otherwise free. Feel free to make this an MWBC if it's not otherwise used, which will give you Perfectly Respectable Level 2 EV charging in the garage.)

Alternately, a smart switch master at the house, and at the garage a smart-switch remote that communicates wirelessly or via powerline signaling. This remote can tap always-hot and neutral for its own power; it just won't have any spare data wires.   Here, the wires are assigned:

Black = always-hot
White = neutral
Red = switched-hot to the light (which goes right past the remote in the garage, not interacting with it at all).

With either wiring scheme, the circuit can be tapped anywhere to power anything - receptacles, smart switch remotes, you name it.  In the second case, switched-hot is available so additional lights could be hung off that which will respond to the switch.

* How do you get Level 2 EV charging out of this? By using the first trick with a wireless-communicating smart switch, giving a spare red. Then, wire it as a MWBC.  MWBCs are allowed to have both 120V and 240V outlets on them, so you stick a NEMA 6-15 general purpose receptacle on it.
Then you plug in an EVSE built or configured for a 15A circuit (which means 12A actual given to the EV). This will deliver 2.9 kW to your EV, or 75-90 miles in a 10-hour charge session.  (more if longer). If you need more in a single day, you can catch up over several days. If even that is not enough, DC fast charging is REALLY fast.
Comment: Interesting answer to a different question, I think... It should also mention that if you're going to use a hot/hot/neutral/ground cable to supply both 240V and each leg separately, the two opposing-phase hots MUST come from a linked pair of breakers since otherwise in some failure modes you may exceed the rating of the wiring.

I'm also going to quibble with "must" here. This is an interesting solution; it is certainly not the only solution, even for the question you are actually answering.
Comment: @keshlam well, I have been known to do that lol... I thought the question was crystal clear and I added language restating it. Don't be *that guy* who disclaimers must be written for lol. That is only one *of several* MWBC safety requirements; rather than write a book LOL, I gloss over MWBCs and send you to a link. What's wrong with that?  As for "must", that's a bold claim. Bold claims need bold proofs. The answer box beckons!   No fair using ground for neutral :)
Comment: The edit helps clarify your intent; thank you. Let me reread and see if I want to retract my grumble
Comment: "But that's powerful." ???
Comment: @Mazura lets you turn a 3-way circuit into 3-way + 120V outlet + level 2 EV charging, so yeah.
Comment: Only way I know is Smart Switches, *and* you can even get 220 out of it. (Why is there a *but* at all, especially if it's not followed by *it's expensive*?)


Global find and replace in Trello

Question: In Trello, is there a way to search and replace text across all cards in a given list?
Comment: Where does the text you want to replace reside on the card? The card description or on a checklist, or comment?
Answer: Trello doesn't provide "search and replace" functionality.  Best you can do is use the API to find the relevant cards:
<code>https://developers.trello.com/advanced-reference/search#get-1-search
</code>
...then loop through the results, calling e.g. https://developers.trello.com/advanced-reference/card#put-1-cards-card-id-or-shortlink-desc to update the description.  You'd need to do the same for whichever fields you wanted to update.

Global find and replace in Trello


Wifi range Cisco AE3000

Question: Can a cisco wifi adapter AE3000 extend my wireless range? I want to connect to some hotspots about 1/2 mile away from me
Comment: If you're looking at half a mile of distance (!), no consumer WiFi equipment is going to help you.
Answer: If you're using a crummy old wireless-B PCI card from ten years ago, yes, you may experience an increase in range when plugging in a Cisco AE3000. If you're using a wireless-B router to go with it, no.
Regardless, you won't get a half mile range. To accomplish this you will need an antenna with a narrow field that results in very high gain within that field, and you will need to aim it at the source, preferably a source with a similar antenna. Look in to 802.11AC and maybe a cantenna.

Wifi range Cisco AE3000


microphone selection to record boiling of water

Question: I want to record boiling sound of water with less surrounding noise and trying to record as much detail it can be . please suggest me an affordable microphone who can does the job and can give me much nicer data to process.
Answer: Boiling water has collapsing bubbles: you really want a very no-nonsense mic for that in order to keep the phases.  Measurement microphones are usually omnidirectional but with moderate SNR ratio, so the noisiness may be a problem.  However, any microphone is going to be unhappy about vapors, though the ones taking damage fastest may be electret condensers.  So you want to keep some distance from the steam.  Maybe put up a slanted metal sheet over your pot that will deflect the sound sideways while the steam sort-of continues upwards?
So in short: you'll have to take a number of compromises: I don't see an obvious "best way" here.


Is possible to short sell stocks without using CFD?

Question: the title is all my question :)
Is possible to short sell stocks without using CFD?
Comment: CFDs are illegal in the United States but short selling is not.
Answer: Yes. Here's how:

You borrow the stock from someone (paying them interest in return)
You sell that stock on the open market

If you want to close your position, or the person that you borrowed the stock from wants it back, you have to buy the stock back on the open market. You profit if you buy the stock back for a lower price than you sold it for. If the stock price is higher, you will incur a loss.
Note that this is done through your broker, who may or may not support (or allow) short selling.
Comment: Forced buy back by short seller only occurs if lender sells stock and it is non borrowable from another lender.  If not borrowable, once notified, broker usually buys it back EOD unless you close it sooner.
Comment: so basically it is managed by the broker and is transparent for us, I mean if the broker allows to short, it should be the same as shorting with CFD (in terms that we only click "sell" button)? or shorting without CFD is more complex or has some advantage/disadvantage?
Comment: Mainstream US brokers who allow shorting have a straightforward transparent process. They provide  the borrow rate and the number of shares available for borrowing.  The short selling mechanism  is exactly the same as selling long stock. You enter the number of share and the price that you want and you click the Sell button. And as mentioned elsewhere, in the U.S, for stocks that have dropped 10% or more, there is the Alternative Uptick rule to contend with. That may hinder your ability to short at a given price. Depending on the numbers, a synthetic short with options may be an alternative.


How to convert an OFDM symbol to a signal?

Question: How can I convert an OFDM symbol generated from an IFFT block to an OFDM signal for the purpose of transmitting it?
Comment: there's no conversion necessary
Answer: I think if you added more details about your signal and the specifications of your hardware, that would be helpful to help you in that issue.
What you basically need is to multiply it by carrier signal and take the real part of the resulted signal, after that you need to do the inverse at the receiver end.  You might need also to upsample and use such filter equivalent to your system specifications.
Again, I think if you added more details about your system, we can also give you more information which may guide you.
Good luck
Answer: If you are asking how would you transmit continuous time waveforms corresponding to IFFT blocks output, then, you need to look at DAC. You will have to add Cyclic prefix if channel is multi-tap to mitigate ISI and then these samples would be input to DAC after some filtering for pulse shaping.
DAC will convert these discrete complex samples to Analog waveforms for transmitting.
Answer: 1.- I recommend you read this Mathworks white paper:
Bridging Wireless Communications Design and Testing with MATLAB
https://uk.mathworks.com/campaigns/offers/bridging-wireless-communications-design-and-testing-with-matlab.html
2.- OFDM would you please be a bit more specific?
You said you aim at generating a 'signal' and such request includes a really wide term referring to the type of modulation you need the signal to have. OFDM signals have many different parameters.
3.- What band should the carriers occupy?
How much frequency spacing do you need each carrier to have with adjacent carriers?
How many pilots? steady pilots or shifting?
4.- The modulation is just one critical, yet nevertheless just one point, to solve when generating signals.
Should it be compliant to for instance wifi standard?
6.- Wired? wireless? by this I mean do you also need to select signal transducer?
Anyway Mathworks has a complete solution to generate all sorts of real time or just recorded signals, from bits to waves.
7.- If you have Keysight Tektronix Rohde&Schwarz Anritsu Advantest .. (among others) test equipment, they now come with applications to build custom signals in an external computer, or even in the same test equipment if it's a good generator or tester, and directly produce for instance a test signal with the modulation you choose and using 'all ones' or 'all zeros' or a pseudo-random sequence.
If you buy them equipment they may even help you write code to send your 'signal in a file' or real-time baseband stream to the generator or exciter.
Hope it helps


how do you sync phone & computer?

Question: I passed level 365, but it doesn't let me move ahead on the phone. Works fine on computer.
Answer: Update your game on the phone to the latest version. The sync is done via facebook. It should sync automatically, if it does not sync, restart the game and make sure your internet is working.
If you get the wrench symbol on the phone, that means the version of the game on your phone is limited to that level, usually updating the game will let you play more levels.
The newest version of the game should definitely let you move pass level 365.
Answer: Link both devices with Facebook, assuming you have an account there, or a Google account instead.

how do you sync phone & computer?


My iPad Mini isn't responding to the magnets in the cover; any fix?

Question: Recently, my iPad Mini has stopped responding to the sleep/wake magnets in my cover. Is there any fix for this other than taking it in for a hardware fix?
Comment: @IronCraftMan It's a magnet. If you've ever replaced the digitizer on an iPad, you'll have to put the magnets from the old digitizer onto the new one. Also, the iPad won't lock the screen just because it detects something on top of it, you can test that yourself, just put a magazine or something on top of your iPad and it won't lock.
Comment: It's not a magnet, it's just a light sensor detecting if the cover is on or off.
Answer: Go to Settings > General and if "Lock / Unlock" is off, turn it on. If it's on, turn it off, then back on and then restart your iPad by holding the home button and lock button together until you see an Apple logo appear. Don't worry, it won't effect any content on your iPad, but it might be necessary to fix your problem.
Comment: Thanks. It turns out that someone turned Lock/Unlock off.


Is educational transcript mandatory for Australian skill assessment PR visa process?

Question: I want to apply for Australian PR visa as Skilled Migrant in the visa subclass 190 or 489.
Hence I have to assess my skill with ACS, but I have all the documents except the Education Transcript. I am confused whether the transcript is mandatory for Skill assessment?
Will a scanned colour copy of all the results (documents) work for assessment?
Answer: You need ECA to apply for PR and organizations that run ECA need your academic transcripts.
I am not sure if skill assessment process requires transcripts, however I am quite certain that you need that for ECA.
So I would like to suggest to prepare your transcripts first.
ECA : Educational Credential Assessment


Capture Facebook content to a Sharepoint library

Question: Does anyone know if it's possible to capture Facebook content to a SharePoint library.  By this I don't just mean view a Facebook feed in a web part which seems to be what most people do. I want to capture the content in some readable  form and eventually then send that content to a record center that I will set up. Is this feasible or am I dreaming again? Thanks.
Answer: Its feasible, but that would be a lot of work. First you would probably need to set up a custom BCS connection that hits a Facebook web service or RSS feed. Then create a facebook content type(s) that is Posts, etc. How often do you want to query Facebook for content? You will have to pick apart the data and put the data where it needs to go, in specific lists. The record center should be easy to set up, just set up an information management policy to move a content type to a record center.


Collinearity in linear mixed models

Question: Is collinearity of the independent fixed effects (covariates, so not the variables I'm interested in) a problem when you create a linear mixed model?
Is there a good resource I can point to to support a claim that is or isn't a problem?
Answer: The difference between a linear mixed effects model and a linear model is that the former has random effects and the latter does not. Both have fixed effects and the same considerations apply regarding collinearity. If you have perfect collinearity then you won't be able to fit either type of model because the model matrix for fixed effects will be singular. If you have just high correlations among covariates them you may be able to fit the model but just as with linear models there can be problems with linear models such as stability and large standard errors. It would be worth considering dropping variables completely or applying dimension reduction techniques such as principal components analysis.
Comment: @Henke if this answers your question please consider marking it as the accepted answer

Collinearity in linear mixed models


Does the sun have angular momentum?

Question: The sun was formed like this: Clouds of dust and gas were moving and so this cloud of gas and dust pulled together its particles by the gravity of these particles. Since this cloud used to move in order to conserve momentum the sun should rotate. Does the law of conservation of angular momentum hold true? The distance to the center is reduced compare to the radius of the original cloud so the velocity of the sun should increase. So does the sun revolve around its own axis? Also does the sun revolve around any other object like the earth revolves around the sun?
Comment: Did you try looking at, say, Wikipedia, which has a handy sidebar with things like rotational periods and so on?
Comment: Angular momentum **about** which point/axis?
Comment: @xasthor - it can reasonably be assumed that OP means "is there no axis about which the Sun has no angular momentum" which is the more precise way of formulating what I think is intended.
Comment: yes, it takes about a month.  25 days in some parts, 38 days in others....http://www.universetoday.com/60192/does-the-sun-rotate/
Comment: Jupiter has more angular momentum than the sun.
Answer: The Sun certainly has angular momentum.  You are correct that if two objects are of the same mass, the speed of rotation of the smaller denser object must be greater than the speed of the larger more diffuse object if both are to have the same angular momentum.  The Sun is estimated to contain 99.86% of the total mass of the original nebula from which it formed, packed into a much smaller diameter.
Helioseismology has been used to probe the density, composition, and motion of the interior of the Sun.  It's estimated that the Sun's angular momentum of rotation about its axis is $S = 1.92\times 10^{41}\ kg\cdot m^2\cdot s^{-1}$.
In addition to rotating on its axis, the Sun (and the entire Solar System) revolve around the center of the Milky Way Galaxy. One revolution takes one galactic year, which equals about 225 to 250 million terrestrial years.  It's estimated that the speed of galactic revolution at our Sun's distance from the center of the galaxy is 1/1,300 the speed of light, c.
So the Sun has angular momentum from revolving around the galactic center, as well as from rotating around its own axis.  The Sun's angular momentum of revolution around galactic center is part of the entire angular momentum of the Milky Way, just as angular momentum of the planets is part of the entire angular momentum of the Solar System.
Comment: @Nick Your edit removed the last part of the answer, too. I fixed it, but next time please be more careful.
Answer: I think I have the answer. Lets look at it intuitively. Lets say the nebula that formed the sun had a mass of 100kg and had a velocity of 10 km/sec. So the momentum was say 1000 kg m/s. Now when the sun formed it had the same mass (Roughly 99.8 % of solar mass) as that of the nebula. So in order to conserve momentum it should have a speed of 10 km/s. Lets substitute 10 km/s with 27 days needed for one rotation.
In other words I am saying that the nebula that formed the sun would have been moving very slowly, so slow that it takes 27 days for the sun to revolve on its axis and complete a rotation. This is so because of the law of conservation of momentum.
Correct me if I am wrong.
Comment: Hmmm .. while the sun makes up more than 99% of the mass of the solar system that does not imply that material now in the sun was the same fraction of the material in the collapsing protostellar nebula. A non-trivial amount of dust and gas is lost to radiation pressure as the forming star first grows hot from compression.

Does the sun have angular momentum?


Updating linux kernel

Question: Is it possible to update the Linux kernel without installing a new version of the Linux distro? If I want to download the kernel from the Linux website and manually install by compiling it, how can it be exactly done?
Answer: Yes you can update linux kernel without updating your linux distro.
To install the latest kernel you can always visit http://kernel.ubuntu.com and https://wiki.ubuntu.com/Kernel to see what's going on.
As of today the latest kernel is 3.17.
If you are using ubuntu 14.04, for example goto this link: Install/Upgrade to Linux Kernel 3.17 in Ubuntu 14.04
Similar tutorials are for other Ubuntu version and other linux kernel version are available, just google it or comment here i'll help you.

Updating linux kernel


Module that will display certain facebook content?

Question: I realize there are quite a bit of facebook possibilities main having to do with facebook account connections. What I'm interested though, is content (especially videos!) that is being put up in a facebook group that was created and having that display on the drupal site. Is there a module out there that does that?
Answer: I think that you can use this jquery plugin http://www.neosmart.de/social-media/facebook-wall to put an specific wall inside a block or node, and then you can improve the javascript code (I guess in Parse feed data / wall section of jquery.neosmart.fb.wall.js file) to show only items with specific content, in this case, for example, a content using uiVideoThumb class (according my review uiVideoThumb is one class used to thumbns that link to videos).
specifically, in the js, in the section Parse feed data / wall line 81:
for(var k=0;k<max;k++){

you can add some lines to detect the specific content, for example:
var pattern=/uiVideoThumb/g;
var stringContent = JSON.stringify(data[k]);
if(stringContent.match(pattern)){

do not forget close this new IF declaration (near line 162).
Acording my test, only content with these condition is displayed.
one note: seems that the code has a Drupal´s module version http://drupal.org/project/fb_walls but not was clear to me how this module works over Drupal.
Comment: Hi, thanks for your answer yes that looks quite promising I found that a while ago too. Fiddled with it a while until I realised I was going to have to spend a couple more hours figuring why and how I needed to 'create an app' if I wanted to get an identifier for my wall that I could use for the neosmart stuff.
Comment: Hi, If I understand well, you have problems with the sugestion? I have tested the suggestion against a wall with messages including video, and only is loaded messages with video thumbs. You must inspect, for example, the CSS ID or CLASS around the video to extract the respective value to parse. Appart of this and the suggestion, there is no other work to make.
Comment: I don't recall anything that has to do with a suggestion. Only thing I was stuck with has to do with an application ID of the facebook wall and the confusion (to this day) about how to retrieve it. Untill now, the answer still seems to 'create an application' which I still don't understand why that is.
Answer: Facebook API requires you to "make an application" so it can assign you an API key you can use to connect things, like a drupal module, to your Facebook account. That is how it knows what content to pull from the Wall and let you manipulate it.
You might want to check out Drupal for Facebook Module as it has a lot of facebook functionality you might be looking for.


What insect is this, large swarms?

Question: I live in Brisbane, Australia and these creatures arrived a few weeks ago for a day or so and then they disappeared. There were thousands of them. I would love to know what they are.
Answer: That is some sort of ant. Many species of ants have this huge "nuptial" flights, particularly after rains, where winged males and females leave the nest in swarms. Males die shortly after, while females lose their wings and start a new nest in the soil. I'm not familiar with Australian species, but the fact thatyou can see a "waist" shows you that those are winged ants.

What insect is this, large swarms?