How do I decrease the size of the page file?

Question: I just upgraded my laptop RAM to 12GB (W510, 4 DIMM slots), and since I am using a SSD, I find hard drive space to be quite precious. However, since I have more than enough RAM for most stuff, I think I can get by with probably around 4GB of page file. however, on C drive, there is a pagefile.sys which I assume to be reserving space for page files in the OS, how would I decrease the size of this file?
Answer: To adjust the pagefile size, press Windows Flag Key+Pause/Break.
From here, on the left hand side, choose Advanced system settings, this will open System Properties on theAdvanced tab`.
Next click on Settings in the Performance Group.
Now click the Advanced tab.
Next click Change under Virtual Memory
And, deselect Automatically manage paging file size for all drives, and then click Custom size and change it whatever you want.
Answer: You can decrease the size of the page file, but see this warning from Microsoft first:

64-bit versions of Windows and Windows Server support more physical memory (RAM) than 32-bit versions support. However, the reason to configure the page file size has not changed. It has always been about supporting a system crash dump, if it is necessary, or extending the system commit limit, if it is necessary.  For example, when a lot of physical memory is installed, a page file might not be required to back the system commit charge during peak usage. The available physical memory alone might be large enough to do this. However, a page file or a dedicated dump file might still be required to back a system crash dump.

The reason your page file is the same size as your RAM isn't for performance; it's in case Windows needs it for a crash dump.
Answer:
When Windows creates pagefile.sys it
  typically makes it a "large" size -
  usually the size of RAM installed on
  your machine.

Take a look at this to change the size of the file: What is pagefile.sys and can I move it? It should help you to change the size of it.


Can someone explain the different relay schematics contact types?

Question: I'm looking at relays and there are multiple types of contacts forms, such as: A, B, C, X, Y, Z and much more. Searching around found different schematics for same form.
Can someone explain them or show me a picture of the different contact forms?
Comment: [Here's](http://www.leachintl2.com/english/english2/vol6/properties/00005.html) a nice reference.
Comment: @EMFields: No longer, unfortunately - it's now a "404". However, [this reference at DigiKey](https://forum.digikey.com/t/understanding-form-a-form-b-form-c-contact-configuration/811) is useful.
Answer: There is a mesh in symbols because even manufacturer agree on a common language, marketing issues differentiate them frequently.
Even the common assosiation RELAY AND SWITCH INDUSTRY ASSOCIATION I think it is not existe anymore, but they are publish a handbook about relays, the "Engineer's Relay Handbook"
Bellow is en extract of the above handbook (5th edition) the types of contacs are available throught the market.
Answer: Form A
Normally open, held close. In it's un-powered state the contacts is open.  Also referred to as a "Make" relay.
Form B
Normally closed, held open.  In it's un-powered state the contacts are closed.  Also referred to as a "Break" relay.
Form C
This is a DPDT relay where one contact is Normally Open and the other is Normally Closed.  Basically, a Form A and a Form B in one package.
Form X
This is a variation of the Form A relay, that is Normally Open, Held Closed, but the contact is double make.

Form Y
This is a variation of the Form B relay, that is Normally Closed, Held Open, but the contact is double break.

Form Z
As I'm sure you've guessed by now, this is a variation of the Form C relay.  One side is Normally Open, the other is Normally Closed but as the relay is engaged each contact is double make or double break.
Some references:
Gigavac
TE-Relay_Definitions.pdf (see pg 5)
Answer: A form A contact is single throw, normally open, closes when relay is operated.
A Form B contact is single throw, normally closed, opens when relay is operated.
A form C contact is double throw - the moving contact is connected to one "output" when the relay is released, and to another when the relay is operated.

simulate this circuit – Schematic created using CircuitLab
(Our handy schematic editor doesn't have a Form B switch)
A single pole relay will have only one set of switch contacts.  Double Pole will have two sets, so can switch two circuits.  Relays are available with four or more poles.
The Form A, B, and C terminology is also used with switches. Form C contacts may be described as "shorting" or "non-shorting".  In a "sorting" switch, all three terminals will be connected together briefly as the switch moves between positions.
Relay and switch contact arrangements are often given as "SPST-NO" (Single Pole, Single Throw, Normally Open) for a single Form A contact, or "DPDT" (Double pole, Double Throw) for two form C contacts.
A Double Throw (form C) switch or relay can be substituted for either Form A or Form B - just ignore the unwanted contact.
I'm not familiar with X, Y, or Z contact arrangements.
Answer: Form X, Y and Z are the same as Form A, B and C, except there are two sets of contacts instead of one.   They are usually used for power relays where the contacts have to carry a lot of current, e.g. 40 A at 440 V.  The double contacts I presume would reduce wear and arcing when the contacts are separated.
Here are the schematic diagrams for a Form Z and Form x:
Comment: I think these are what electricians call "contactors"...
Comment: @PeterBennett yes, I've heard of that.  Thank you.
Answer: The bifurcated contacts of Forms X, Y, and Z are actually designed to reduce noise when switching low power signals for the sake of digital circuitry, as two small contacts bounce much less than one massive one.
Forms U, V, and W are similar to X, Y, and Z, respectively, but the armature itself is doubled, not the contacts. And I'm at a loss as to why that was done...
And of course, GR Tech's detailed chart shows there are still more derivatives available.
There is, however, some debate as to whether or not the bifurcated contacts are really worthwhile, as they tend to be more expensive, and a good software debounce is usually just as good as a hardware debounce.
https://forums.qrz.com/index.php?threads/are-bifurcated-relay-contacts-any-better-than-paired-contacts.281935/


Split polygon by polygon

Question: I have a polygon which I want to split using overlapping polygons in order to create 3 polygons (with the original attributes)
How can i achieve it using R ?
Comment: Can you put together a reprex, I think your q is fair but it's hard to do this stuff without an example. Any chance you can subset out the relevant rows, save as rds or write to gpkg and share?
Comment: probably `sf::st_intersection`
Comment: I've tried st_intersection but it doesn't divide the polygon. Instead it generates the same geometry everytime it overlaps the other polygons (in this case I ended up with 5 polygons)
Answer: For sure you just need to do an st_intersection like:
st_intersection(pol1, pol2)

If you get a 5 features polygon is because your pol1 is overlaping five "colored" polygons. If you are looking for 3 polygon result, you should just dissolve blue/green polygons and yellow/pinky ones bufore. You can do it by assign them a unique ID, group_by that ID and summarize them.

Split polygon by polygon


Lost apps during jailbreak

Question: I lost some functions of my iPhone 4 with iOS 7 after jailbreak like making phone calls, the camera app, and others too. I don't want to remove the jailbreak.
Comment: Restore your iPhone to factory settings and re-jailbreak?
Answer: This problem was happened for me on my iPhone 4 with iOS 7 when there was few free space (less than 1GB) with lots of apps on it. The only solution that helps me was disabling find my iPhone, full backup with iTunes and manual backup the data of Messages and other apps with iExplorer and PhoneView. And then restore the iOS 7 again and jailbreak.
Because there wont be any iOS updates after 7.1.2 you will not lose the jailbreak opportunity.

Lost apps during jailbreak


How to apply filter while indexing Sitecore contacts

Question: We would like to apply custom filters while indexing Contacts in Sitecore. How can we apply filters on Mongo Data so that only specific contacts will get indexed
Comment: Which version of Sitecore?
Comment: 8.2 Initial version
Answer: It looks like the code that decides if a contact should be indexed is defined in the contacts pipeline in the analytics.aggregation pipeline group. Specifically, the default processor is Sitecore.ContentSearch.Analytics.Aggregators.ContactChangeContactAggregator, which just checks contact.ShouldBeIndexed(), which in turn just checks if it is an anonymous contact, and if it is, whether anonymous contacts should be indexed. If you would like to add more complex logic, you should override this processor with a custom implementation and then patch in your own processor.
Comment: Thanks. I am able to add filter but contact which does not have Lease.Owner.Type are not getting indexed. I am getting null exception for those contacts. Please note we have migrated contact from External System to MongoDB.


How to edit php files locally?

Question: With HTML files, I can work locally and preview the files in my browser after I've saved and made changes (and use LiveReload), but with PHP the browser just loads the code. Do I need to run a local server to work on it locally, or is there an easier way?
The extent of my PHP is using include statements for headers and footers.
Answer: Yes you will need a local server to run PHP scripts locally. Check out MAMP for Mac or XAMPP for PC.
Answer: Yes, you'll need to install something such as WAMP
Answer: No - since php is a serverside interpreted language you have to run a server. The easiest way is to install xampp whick brings everything you need - apache, mysql, php.
On windows you could also install IIS server which is part of windows
Answer: You can very easily download and set up a server - and on that note, yes do do need to have PHP and Apache set up to have PHP working.
I would probably suggest something like WAMP - it is basically pre-setup and requires very little config to get up and running. This will come with Apache Server, MySQL and PHP set up nicely to work together and comes with a very easy to use point and click interface. Oh, and it even installs PHPMyAdmin so that you can easily work with your databases if you are not familiar with console controls.
Answer: You need to set up a server that can serve php requests appropriately.  However, this is incredibly easy to do.  Just google how to install a LAMP server (on Linux), or look into WAMP (on windows).  If this is still too much for you, look into purchasing a shared hosting account or something.  I have a small one for like $15 a year.  They will have the servers set up with everything you need already; you'll just have to upload the files.
Answer: Yes, you need to run a local server to 'work with it'.  I would suggest XAMPP.  To actually edit the files, you of course need a text editor.  Any editor will do as far as I'm aware, but I use Notepad++ myself, or even the NetBeans IDE.

How to edit php files locally?


Falling Object Rebound

Question: Can someone please explain to me how to calculate the rebound velocity, rebound acceleration, and rebound height of an object of mass=m dropped from height=h? Thank you.
Comment: Do you know the coefficient of restitution of the ground and ball ?
Comment: Can you please add more details and what you've tried?
Comment: @quirkyturtle98 - I've tried ALOT of googling but most information is related to before impact or at impact and not much is out there about the post impact dynamics
Comment: @ Tausif Hossain - Thanks for your help. Unfortunately, I dont know the coefficient of restitution.  Any good sources that you can recommend or ways to determine it empirically?
Answer: In order to calculate the rebound velocity and rebound height you need to know something called the coefficient of restitution which tells you how elastic/ inelastic the collision between the ground and object is.
The coefficient of restitution,$e$ is:
$$e=\frac{v_(rebound)}{v_(impact)}$$
Thus if you know $e$ then you can find rebound velocity.( Notice if collision is perfectly elastic then e=1 and rebound velocity = impact velocity and rebound height= original height)
For rebound height just use $v^2=u^2+2gh$ to find $h_(after-rebound)$ setting $v=0$ and $u=v_(rebound)$.
Now to find the acceleration you need to know the collision time between object and ground.
Then acceleration,$a$ is simply given by :
$$a=\frac{v_(impact)+v_(rebound)}{Collision Time}$$
Comment: Thank you very much Tausif.  It seems that determining the coefficient of restitution is the tricky part.
Comment: You don't have to determine it as it's usually given in questions like this. You're welcome. Please verify the answer if you find it satisfactory.
Comment: In reality we can actually measure the coefficient of restitution by measuring the rebound heights.

Falling Object Rebound


Breaker Breaker, Which should I use?

Question: I have setup a new water heater where I used 10-2 wire to a disconnect box. Then, connected a square D 30 Amp dbl pole in my breaker box. Water heater connections were black to black white to red and grounded to plate. My breaker was Square D QO230 wired with Black to one pole and white to the other. I then grounded it. As soon as I turned it on the circuit tripped. I thought maybe I had my connections switched on the breaker so I switched them and the same thing happened. I am starting to think I am supposed to use two 30 amp single pole breakers but I thought that was the same thing as a 30amp double pole breaker does that sound right? Could it be I have a different issue?
Comment: Photos of the wiring may help us identify anything amiss. FYI the white conductor should be marked with a 'hot' color (black, red, blue, orange, etc) at both ends by means of a marker, tape, etc to indicate that it's not being used as a neutral.
Comment: Does the breaker still trip when you open the disconnect, then try to turn the breaker back on?
Answer: You're in a QO panel; fortunately has unique busing so you can't misfit a breaker that doesn't belong, you can use either the OEM Square D QO230, or one of the UL-classified competitor models the CHQ230 or ITED230.
Since both wires will be hot, you must use tape or paint to re-mark the white wire a color. Typically this is done by wrapping it with black tape.
Ground first, not last
You should hook up the ground wire first.  You said you hooked up the hots, then hooked up ground, then had a problem.  You were lucky.  You could have been shocked if you tested it without grounds present.  The fact that you did grounds last makes it seem like the ground is at fault. It's not.  It's simply the "canary in the coal mine" warning you of the problem.  Hook it up first, and the problem will be more apparent.
Divide and conquer
Unhook all the wires, except for - anyone, anyone, Bueller? Ground wires.  That's right, leave all ground wires attached.
Now, hook up one wire to the disconnect, open the disconnect, and see if the circuit can power up.  If so, power down and attach the other wire to the disconnect, and test again. Now close the disconnect and test again.   Now attach one onward wire to the water heater.  Test again.  Etc. etc.
At some point, adding a wire will cause the breaker to trip when turned on. Divide that further if possible.  Now you're pretty close to the answer.  If you're still stuck, ask.
Answer: Assuming that the water heater is rated for a 30A breaker:

You MUST use a double-pole breaker
10/2 is black/white so you use black to one pole of the breaker, white to the other. At the water heater, depending on the water heater you will typically have two identical wires or one black, one red. If one is black and one is red, connect black to black and white to red.
A double-breaker should always show ~ 240V between poles. If it doesn't then somehow you have it installed wrong and strange things can happen. So check (a) at the breaker and then (b) at the water heater (i.e., the ends of the black & white wires) for 240V. If you get 0V or 120V then STOP because you have major problems.
The ground wire should not be contiguous to either wire. If it is then you have a problem (which would explain the trip). Connect the wires at the water heater but NOT at the breaker and check continuity - you should get a resistance between black & white and no connection at all between ground and black or between ground and white.

Breaker Breaker, Which should I use?


Music and dancing in weddings?

Question: When I go to weddings (muslim women only weddings) there is usually loud music and a dance floor. The women wear nice dresses (sometimes showing too much skin) and they dance while the loud music is playing. Is this permissible? Should I not dance? Should I not go to these weddings? (even though most or all muslim women only weddings are like this). What about the family hosting the wedding, would they be judged for paying for the singer and the dance floor?
Comment: Some forms of Music may be permissible at times of celebration, if there is nothing else haram about it. If the gathering consists of only muslim women then the dress is not of concern as the 'awrah between the same gender is relaxed.
Answer: In Islam just duf is allowed all other music haraam. For women perda is must. Dance and loud music and pay for danceres too haraam in Islam.because it get away human from the right path.
Comment: Welcome to Islam.SE! Please check out a [tour](https://islam.stackexchange.com/tour) of our site to learn more about how this site works, and it is preferable to please cite sources and thoroughly answer the question asked.

Music and dancing in weddings?


Auto generate PlantUml Class Diagrams C# Code

Question: Looking for software/extension/nuget package recommendations to easily generate PlantUml Diagrams. More specifically for class diagram with C#. I know there are a few out there, but they all require .net core or .net 4.5+. The main base of our code is older than this and struggling to find something that would work.
Answer: You might want to look at https://github.com/pierre3/PlantUmlClassDiagramGenerator It can be run standalone.  It looks at your source file and generates rudimentary class diagrams.
Might be worth a look.


can we have 2 Database server for the single sharepoint Farm?

Question: We are having huge data around 4tb in our sharepoint site and we want to get new set of database server and point our application to new database server but we have other web applications also which needs to be on old Database server. so we want just one web application to point to new database server for better performance so can we have 2 database server for single farm.
Answer: Yes, you can. Please take the below steps:
Go to SharePoint CA-> Application Management-> Manange Database, choose your web application and add new conetent dabase. You could choose a new DB server for your web application.


Define "reactivity"

Question: Does reactivity of a compound depend on kinetic factors, thermodynamic factors, or both? i.e. how is reactivity defined? For example, out of a) 2-bromopropane and b) 4-bromobutan-2-one, which is more reactive to alcoholic KOH? Does the answer account for kinetic factors, or the fact that b) forms a conjugated ketone, and is hence more reactive?
Answer:
Does reactivity of a compound depend on kinetic factors, thermodynamic
  factors, or both?

The reactivity of a compound depends on kinetic factors, but... The "but" arises because thermodynamic factors can be a part of the kinetic factors.  Let me explain.
The following figure shows the conversion of a "Reactant" to a "Product".  The product is more stable so the reaction is exothermic, heat is released.  The rate of the reaction is determined by the height of the barrier (the activation energy, $E_{a}$) that a reactant molecule must pass over in order to become the product.  The higher the barrier, the slower the reaction.  Since the barrier height is contained in the kinetic equation describing the speed of a reaction  (for example, the Arrhenius equation)  we say that reactivity is determined by kinetics.

But now look at the reverse reaction.  Suppose you had a bottle of "Product" and heated it to convert it to "Reactant".  This reaction is endothermic, heat must be supplied.  The free energy difference between product and reactant ($\Delta G^o)$ is a thermodynamic factor telling us whether the product or reactant is more stable.  In the reverse reaction, the barrier that we must surmount is higher than it was for the forward reaction.  The barrier for the back reaction is given as $E_{a} + \Delta G^o$.
So while the rate or reactivity depends on the barrier height which is a kinetic phenomenon, we can see how the free energy difference ($\Delta G^o$), a thermodynamic quantity, can be viewed as a factor influencing the barrier height.

out of a) 2-bromopropane and b) 4-bromobutan-2-one, which is more
  reactive to alcoholic KOH? Does the answer account for kinetic
  factors, or the fact that b) forms a conjugated ketone, and is hence
  more reactive?

1-bromobutane might make for a better comparison, in this case the bromine is attached to a terminal carbon as in 4-bromobutan-2-one, and both molecules contain 4 carbons - the only difference is that one is a ketone.  In any case, the answer is based on kinetic factors.  I don't know which one will react faster, but here's my thinking. They should have similar activation energies, but since the ketone reacts to produce a more stabilized conjugated $\alpha,\beta$-unsaturated ketone, the reaction of the bromo-ketone will be thermodynamically more exothermic than the bromo-alkane.  This thermodynamic difference will reduce the height of the kinetic barrier for the bromo-ketone and make this reaction faster.
Comment: Small nitpick to an otherwise very good answer: The depicted graph shows an exergonic reaction as it is based on $\Delta G$ It does not make any assumptions if the reaction occurring is also exotherm.|| Another note, the bigger $\Delta G^o$ is, the more energy is provided to following reactions, therefore fueling itself and speeding up the process. This is often the case for explosions.

Define "reactivity"


Does the Message Integrity Check in WPA(2) standard solve the problem of non-repudiation?

Question: Whether the receiver can be sure that the message is sent by the source only and not spoofed by someone else?
Comment: There are 3 answers. Could you indicate if any answers your selection and accept the one that does? Otherwise please indicate what is missing...
Answer: No it doesn't.
Message Authentication Codes (MACs, which in networking some may call MIC in order to differenciate from Media Access Control) are symmetric-key primitives that only provides authenticity and integrity of the message exchange. Non-repudiation requires public-key cryptography.
Answer:
Does WPA(2) solve the problem of non-repudiation?
Whether the receiver can be sure that the message is sent by the source only and not spoofed by someone else?

You appear to be a bit confused about what non-repudiation actually means.
What it means that the receiver could prove to a third party that the sender (and not anyone else) sent the message.  In this case, that is not true; the receiver could also generate the message.
On the other hand, in WPA(2), that's not what the receiver cares about.  What the receiver does know is that someone with the WPA2 keys generated the message, and that (unless one of the two sides leaked it) those two sides are the sender and the receiver (and so if the receiver knows he didn't generate the message), the sender must have.
Hence, it proves what the receiver cares about (even if it doesn't meet the definition of "non-repudiation").
BTW: WPA uses a Message Authentication Code known as Michael; it was designed (in a hurry) specifically for WPA; it was designed under the constraint that it had to be implementable on every product that implemented WEP (hence doing something like HMAC, which would have been preferable, wasn't an option).  Neils Fergusson did (IMHO) an excellent job in putting it together within the constraints he was given.  However, I do believe some results have been found against it since; it'd be wiser to migrate to WPA2 (now that hardware that can do that is now available)
Answer: It depends, but usually the answer is no. The MAC is only used to provide integrity and authenticity of the message exchange.
Usually non-repudiation is something that is performed on documents rather than transport protocols. You could possibly prove that data was send through a transport protocol by a certain sender. This of course requires the sender to be authenticated within the protocol (e.g. client authentication for TLS). However, generally the packets of the transport protocol are discarded after the data has been received. If the MAC would be lost after receiving the data, the data cannot be proven to be signed by a specific entity anymore.
Certificate and keys used for authentication may also have different properties when it comes to real time authentication. For instance a certificate may have a lower key strength, validity time and may not be verified as strict as a certificate used for non-repudiation. Furthermore, a certificate / key use for authentication will not have the non-repudiation key usage set. Furthermore, an authentication key may also have less protection; smart cards, for instance, usually only require one PIN entry to use the authentication key multiple times. This would however only come to effect when WPA is used with EAP protocol for authentication.
More importantly, even if the data can be proven to be signed from a specific key, the sender may not consciously have signed that data. You could think of a JavaScript script that deliberately sends data through a WPA channel with client authentication. In other words: even if you can prove that you received an otherwise unsigned document agreeing to sell my house, I won't have sold you my house. I can repute it: I may never have consciously send it to you and I certainly did not sign it with the intention to sell the house.
If you're stupid enough to use a unique password, leak that password to a third party and then establish a Wireless connection using WPA and then leak the data and keying material, somebody may be able to prove that you have send that data. That would not be non-repudiation as any party receiving the keys might just as well have signed the data themselves, but it may break the closely related notion of deniability.


Comparable ingredients in butter and mayonaise

Question: What ingredients (all) are shared between butter and mayonaise?
Comment: Butter only has one ingredient: Butter. Mayonnaise does not contain butter and so there is no intersection in their ingredient sets. Do you mean what molecules do they have in common? That doesn't seem particularly useful to me.
Comment: This is tagged as an allergy question. Are you asking whether mayonnaise is suitable for you if you have a dairy allergy, or vice versa?
Comment: Mayonnaise doesn't have much composition in common with butter, but would seem to join (now disfavored) hydrogenated-oil margarine in having vegetable oil as a major component.
Comment: Also, `clarified butter` is almost pure milkfat, with a relative minimum of the other milk components which most often cause bad reactions (though a given sample might not be entirely free of them).
Answer: Normally, there are no ingredients shared between butter and mayonnaise. The only ingredient in butter is milk, either fresh or cultured. The ingredients of mayonnaise are egg yolks, vegetable oil, mustard, water and acid. As you can see, there is nothing in common between the two.
There are two exceptions when they may share something.
First, you can get salted butter, and many mayonnaise recipes also incorporate some salt. Then the salt is the shared ingredient.
Second, fats are interchangeable in the making of emulsified sauces, and home cooks will frequently call their sauce "mayonnaise" when made with butter instead of oil. Technically, this makes it a hollandaise derivative and not a mayonnaise, but many people won't know the difference. If you happen to eat "mayonnaise" made with butter, then the shared ingredient is the butter itself. With commercially bought mayonnaise, you can be practically sure that there is no butter in it.
Comment: I would say that butter is an ingredient of milk not the other way around. Butter is entirely a subset of milk.
Comment: @Sobachatina in cooking, I have always seen the meaning of "ingredient" as "what you need to start with to get the final product", which only accidentally also means "what is contained in the final product" most of the time, but not always. For butter, you start with milk, not the other way round.


is silverlight for developers or designers?

Question: i am a junior c# programmer and would like to learn silverlight.
is silverlight for progrmmers or for designers?
Comment: Is CSS for programmers or designers?
Answer: It is for neither - Silverlight is simply the branding for the runtime engine, library set, etc. The only thing that "uses" Silverlight directly is (broadly speaking) the browser.
The important thing for developers is Visual Studio (regular or Express:Web), and for designers: the Expression suite. Both can contribute to a Silverlight project. Also consider that you may be targeting Moonlight, so even "Silverlight" becomes misleading.
Answer: Silverlight is for both developers/programmers and designers.
The User Interface of a Silverlight application is defined in XAML script, which is based upon XML.
Microsoft explicitly target the Microsoft Expression (specifically Expression Blend) suite of products at designers, whilst Microsoft's Visual Studio is aimed at developers (although Visual Studio 2010 can be used for design work as well).
If you have a designer and a programmer working together to create the overall Silverlight application, you can utilise a programming design pattern called MVVM (Model-View-ViewModel) to help separate the concerns between the UI and the back-end functional program code.  This effectively allow the programmer to not really care about the names and ID values of specific UI elements that may have been defined by the designer, but simply to "bind" together specific User Interface elements with their "back-end" program code counterparts to create the complete Silverlight application.
Answer: It is for both.
Answer: Both,
As a programmer it's good to be familiar with the programming model, the related MVVM pattern, the object model etc.
As a designer you can build your designs in Blend and XAML. Then integrate them with the rest of the software
Answer: Both.
Usually a developer will do it all, but using the Expression products, designers and developers can work on the same project to utilise their skills.
Answer: I guess like most peep said, it is for both.
Being a developer myself, I tend to sway towards the coding.
But when I want to do animation, I will go back to xaml, which is way more simpler than doing in the code behind.
One good thing about silverlight that certainly prove that it is suitable for both is that, no matter how a designer place his UI and animations, and no matter how a developer codes, as long as 1 focus on functionality, another focus on UI.
Things will work out perfect, unless the designer deleted some UI that is suppose to have functionality. :)
Answer: It's for both.
However you're also going to need both developer and designer to make it quite good.


How to create a new action in an admin controller?

Question: How to create a new action in an admin controller which already exist to call a third party api ? Any idea ?
Answer: As you have mentioned, it is already an existing action and for every action there should be a controller. So as far as i understood , u can do this by changing existing controller.For changing existing controller, there are couple of methods how they can be changed. You can do that by preference, plugin or use "old" style after/before . Preference will change complete controller with your controller code (we can call that like complete rewrite). Plugins will change only desired controlled method. Lastly, after and before will change location of controller for custom front name. Example for this is how you add new controller on admin area.
<code><router id="admin">
        <route id="catalog" frontName="catalog">
            <module name="Magento_Catalog" before="Magento_Backend" />
        </route>
    </router>

</code>


How to get facebook login working with devise, omniauth - cannot overcome controller error

Question: I am working on getting Facebook working with devise and omniauth. I have been trying to figure this out for days now without success. When I press the 'Facebook connect' button, the login page comes up. Once an FB email is entered along with a password, I am redirected to a page with the url suffix "{root domain}/users/sign_in#-" along with an error that says " translation missing: en.devise.authentications.user.failure." Users are not being added to the database. I have been at this for a while and it is very frustrating so far. I have routes as follows:
routes.rb
new_user_session GET    /users/sign_in(.:format)    sessions#new

user_session POST       /users/sign_in(.:format)    sessions#create

destroy_user_session DELETE /users/sign_out(.:format) sessions#destroy

user_omniauth_authorize /users/auth/:provider(.:format) authentications#passthru {:provider=>/facebook/}

user_omniauth_callback  /users/auth/:action/callback(.:format)  authentications#(?-mix:facebook)

In devise.rb I have:
config.omniauth :facebook, Facebook::APP_ID.to_s, Facebook::SECRET.to_s
require 'devise/orm/active_record'
config.authentication_keys = [ :email ]
config.http_authenticatable = false
config.http_authenticatable_on_xhr = false
config.navigational_formats = [:js, :html, :json]
config.token_authentication_key = :auth_token
config.sign_out_via = :delete

The config initializers omniauth.rb
if Rails.env == 'development' || Rails.env == 'test'
  Rails.application.config.middleware.use OmniAuth::Builder do
    provider :facebook, 'XXXXXX', 'XXXXXXXXXXXXX'
  end
else
  # Production
  Rails.application.config.middleware.use OmniAuth::Builder do
    provider :facebook, 'PRODUCTION_APP_ID', 'PRODUCTION_APP_SECRET'
  end
end

In users.rb I have:
   def self.find_for_facebook_oauth(access_token, signed_in_resource=nil)
        data = access_token.extra.raw_info
        if user = User.where(:email => data.email).first
            if user.facebook_id.nil?
                    user.facebook_id = data.id
                    user.save
            end
        user
        else # Create a user with a stub password.
            token = Devise.friendly_token[0,20]
        User.create!(:email => data.email, :name=>data.name, :facebook_id=>data.id, :password => token, :password_confirmation=> token)
      end
    end

    def self.new_with_session(params, session)
       super.tap do |user|
         if data = session["devise.facebook_data"] && session["devise.facebook_data"]["extra"]["raw_info"]
             user.name = data["name"]
             user.email = data["email"]
             user.facebook_id = session["devise.facebook_data"]["extra"]["raw_info"]['id']
         end
       end
    end

In authentications controller (which is derived from the omniauth callbacks controller)
class AuthenticationsController < Devise::OmniauthCallbacksController
  def facebook
    # You need to implement the method below in your model
    @user = User.find_for_facebook_oauth(request.env["omniauth.auth"], current_user)

    if @user.persisted?
      flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Facebook"
      sign_in_and_redirect @user, :event => :authentication
    else
      session["devise.facebook_data"] = request.env["omniauth.auth"]
      flash[:notice] = "Please register an account first!"
      redirect_to "/"
    end
  end
end

In the development log, there is :
Started GET "/users/auth/facebook" for 127.0.0.1 at 2013-01-22 20:09:28 -0500
Started GET "/users/auth/facebook/callback? state=blah&code=blah" for 127.0.0.1 at
2013-01-22 20:09:29 -0500
Processing by AuthenticationsController#failure as HTML
Parameters: {"state"=>"blah", "code"=>"blah"}
Redirected to http://myapp.com/users/sign_in
Completed 302 Found in 2ms (ActiveRecord: 0.0ms)

On the Facebook app settings page, I have :
App Domain: (empty)
Site URL : http: //myapp.com/users/auth/facebook/callback?
and sandbox mode is enabled. I would appreciate any help at all in this. I have tried everything possible and check many sites, but I'm at a block.
Answer: There is a Devise issue on something like your immediate error message (found by web searching the "en.devise.authentications" part).
The Rails Internationalization (I18n) API guide describes the translations load path.
Apparently, here, Devise's lib/en.yml hasn't supplied the English string that Devise needs, but you can supply it yourself.
You haven't given us the contents of your config/locales/en.yml file, but that's where you can add:
en:
  devise:
    authentications:
      user:
        failure: User authentication failure

You can change the failure message to whatever you want.
See this example for the general i18n YAML format.
That should answer your question and solve your immediate error message.
Comment: If it answered your question, then (would you) please "accept" my answer? :)


How do they know Magnetic Field Lines run from South to North inside a magnet?

Question: I get how they can plot the field lines outside the magnet, but how do they know how it runs inside the magnet to form a closed loop? Isn't the direction fo the field lines the direction of the force acting on a north pole placed at that point in the field? Then what would be the direction of the force acting on a hypothetical North Pole at the center of the magnet. Thanks!:(Image Attached)
Answer: There are two (2) kinds of field inside a magnetic material $\mathbf B$ and $\mathbf H$. The one that has continuous loops is $\mathbf B$ field and it is "surface thing" by which is meant that if you cut a thin disk, a crevasse as Thomson called it, out of the material whose normal is parallel with the direction of $\mathbf B$ then this field across the slit is continuous. On the contrary, if you cut a thin cylinder, a  needle out of the material that is parallel with $\mathbf H$ field then $\mathbf H$ is continuous across the needle. Here $\mathbf B = \mu_0(\mathbf  H + \mathbf M)$, where $\mathbf M$ is the local magnetization density of the material. Inside a long permanent magnet the fields $\mathbf B$ and $\mathbf H$ are in opposite direction, the field lines of $\mathbf B$ are closed continuous loops but that of $\mathbf H$ are not closed originate but start at one pole and end at the other.
Within the crevasses, disks or needles, one can measure the local fields. If you place a wire loop in the disk you can measure the induced voltage when changing the $\mathbf B$ and its flux rate $\Phi$ in time, and thus both field magnitude and direction can be ascertained.
If you place a magnetic needle inside the thin cylinder carved out of the magnetic material then $\mathbf H$ will exert a torque and force that can be measured from which the field magnitude and its direction can be deduced.
Answer: Permanent magnets have their magnetic field from the self-sustaining alignment of the magnetic dipoles of the electrons involved in the magnetic body.
You can therefore imagine - in a very simplified way - the permanent magnet as a multitude of small bar magnets. Together, these produce the magnetic field that is represented by the field lines in your sketch.
The direction of the arrow on the outside is therefore the continuation of the inner orientation.


Transistor as a one-time switch

Question: I'm trying to develop some sort of a one-time switch.
Let's say when a criminal opens a switch - transistor opens and alarm sets on. I want it to continue working once switch is closed again.
I believe there are some special "clever" components for this purpose but can I achieve it by adding only simple stuff like transistors/capacitors/diodes/etc.?
Comment: Use a (low current) thyristor, or make one from two transistors. Google is your friend.
Comment: You can use one transistor and 2 or 3 resistors if you are allowed to blow a fuse to make action = one time.| Q1 = NPN or N Channel FET. Load in collector/drain. Pullup R1 Vcc to base/gate. Base via R2 to fuse to ground. R2 not needed if FET used. Switch from R2/fuse junction to Vcc. R1/R2 divider such as to hold transistor off when fuse is intact. Closing switch connects Vcc to ground via fuse. Add small R3 in series with fuse if desired to limit I_fuse_max. If a FET is used R2 not needed as pullup to Vcc during fuse blowing is OK (if Vgsmax < Vcc) and fuse clamps gate till blown.
Answer: Simplest circuit is by using a SCR (Silicon Controlled Rectifier), these are pretty common components, but not as common as transistors.

simulate this circuit – Schematic created using CircuitLab
To sound the alarm, it is enough to disconnect the gate from ground using the TRIGGER switch. A small current will flow through R1, to the gate and latch the SCR.
Once an SCR is latched, it can only be reset by interrupting the current through it (by pressing the RESET switch).
You can replace a SCR with two BJT's:

simulate this circuit
Circuit source
Comment: An inexpensive small TO-92 SCR is the 2N5064. 800mA http://www.onsemi.com/pub_link/Collateral/2N5060-D.PDF
Comment: Perfect, thank you! Just two transistors, what do you know.
Answer: What you want is something that latches.   You can do this with a couple of transistors, but for a one-off its probably simpler to use a flip-flop.  A simple S-R (set/reset) flip-flop will do.  The detector switch opening causes a set, and you have a reset pushbutton someplace so that you can shut it up once you know it's tripped.
However, while this can be done with transistors or a flip-flop, the simplest hardware-wise would be a microcontroller.  You do the latching logic in firmware, and you can wiggle a pin to make the alarm sound to drive a speaker with directly.  That way you an use a plain speaker, not a integrated buzzer unit.
Answer: A simple relay latch circuit would do: -

The red line is meant to indicate that when the relay coil is activated the contact at the top of the diagram shorts thus maintaining power to the relay contact until the push button is pressed. An alarm would simply connect to an unused contact or, if the relay contact were a changeover type, the normally closed contact would route power to the alarm.
Power comes in from the right.
Answer: An SCR may be used as per the above answers, however if you truly want to use FETs/Transistors then this circuit is a essentially a solid state latch.

R3 and R2 are selected to satisfy the VGS(th) conditions of the N-CH Power Fet. Choose a Power Fet suitable to drive your load.
Comment: Might be a an idea to put a resistor between R3 and the reset switch. The current through the BSS84 should be momentary and only an ampere or three, but still.
Comment: Good alternative. Essential difference though between your circuit and mine is that you use 'make' contacts where I use 'break' contacts. It depends on the application which version is most useful.
Comment: @Martin Won't work that way. Horizontally between the gate of Q2 and R3 top, and the RESET switch goes right to the gate of Q2.
Answer: you need a latch. a simple transistor design would be

simulate this circuit – Schematic created using CircuitLab
Under normal circumstances switch SW1 would be closed, hence transistor Q4 wud be closed and Q5 and Q2 would be open in the absence on a bias. Q3 would be biased through R3 and hence would be closed. Hence entire voltage of 5V would be dropped across R4 and thus at the collector of Q3, voltage would be negligible (around 0.2-0.5V). Thus the speaker would not get sufficient voltage to turn on. but when SW1 is opened by the infiltrator, Q4 opens, hence Q5 closes which in turn opens Q3. This action proceeds to relieve the 5V through the speaker path and through the base of Q2 since both paths have almost equal impedance. Thus Q2 closes and this prevents Q3 from closing ever again even if SW1 is closed. This is because SW1 closing or opening only affects Q5, but now Q3's base is being drained by Q2's collector and this has no way of being stopped other than by disconnection of the power supply of the circuit. The permanent opening of Q3 on the opening of SW1 ensures that the voltage keeps dropping across the 2 equi-impedance paths namely the speaker and the base of Q2, hence the speaker keeps resounding till disconnection of circuit supply.

Transistor as a one-time switch


Highlight current bash prompt line

Question: I want the terminal to highlight the current bash prompt line.
The effect I'm trying to acheive is the same as in text editors where the current line with the cursor is highlighted.
Something like this:
Comment: It's conceivable that your *shell* could support some customization like this, but it's irrelevant to the choice of terminal.
Comment: This depends on the shell, not on the terminal. Given the appearance of your prompt, I presume you use bash. Please edit your question if this is not the case.
Comment: oh ok sorry, kinda new to stackexchange and forgot the rules
Answer: If you're happy with highlighting only the prompt, then the following will apply reverse colors on whatever you have already in PS1:
PS1="\[\e[7m\]$PS1\[\e(B\e[m\]"

If you have a space at the end of the prompt (this is common practice) that you don't want to highlight:
PS1="[\e[7m]${PS1::-1}[\e(B\e[m] "

Some terminals, at least iTerm for macOS, have the option to set a "cursor guide". This is probably doing exactly what you want to achieve (I have exaggerated the guide in the picture, I usually have it much more transparent, and red, as in the second picture):

The cursor guide has nothing to do with the shell and will be always be displayed, regardless of what you're doing (very faint red cursor guide on the line reading AC_CONF_AUX_DIR([build]), here shown in the vim editor):

Unfortunately I only run iTerm on macOS, so I don't know if there are terminal emulators out there that can do this for your particular Unix.
Comment: PS1="\[\e[7m\]${PS1::-1}\[\e(B\e[m\] " Just to get rid of that extra highlighted space at the end.
Comment: @auselen Thanks. Finally got around to add that in.

Highlight current bash prompt line


Is it possible to access a history of your clipboard in Ubuntu?

Question: Every time I copy and paste something I save it to my clipboard. Is it possible to access a record of what I have copied and pasted on Ubuntu?
Comment: I guess this extension might help you...https://extensions.gnome.org/extension/779/clipboard-indicator/
Comment: I use Lubuntu, which includes `qlipper` by default (a *lightweigtht cross-platform clipboard history applet*)
Answer: It needs to be installed any Clipboard Manager tool to save clipboard history.
You may install CopyQ Clipboard Manager  from Ubuntu software center or by running following command in terminal:
sudo apt-get install copyq

CopyQ is an advanced clipboard manager with editing and scripting features. It is an open source software available for free for major Linux distributions. It monitors system clipboard and saves its content in customized tabs. It can save both text and images from the clipboard. Saved clipboard can be later copied and pasted directly into any application.
CopyQ sits in the system tray and you can easily access it from there. By default, it shows only five recent clips. You can open the main window using "Show / Hide main window" option in the system tray. CopyQ can save up to 200 clips. You can also edit clipboard items here.
Answer: You can install a clipboard manager to keep and manage entries that were previously copied to the clipboard. One such tool, developed for the Gnome Desktop, is gpaste. It also includes a Gnome Shell extension for tight integration in the Ubuntu desktop. You can install this Gnome Shell extension using Ubuntu Software, or Synaptic Package manager, or with the command
sudo apt install gnome-shell-extensions-gpaste

This will set up both gpaste and the gnome-shell extension. After installation, you will need to turn it on using Gnome Tweaks or the "Extensions" tool (Ubuntu 20.10 and up).
Alternatively, there is a stand-alone Gnome Shell extension, gnome-shell-extension-clipboard-indicator. That extension is not officially supported by the Ubuntu developpers, but can be installed from the Gnome Shell extensions website.
Other clipboard managers are also available in the Ubuntu software center, including CopyQ, Parcellite and  Diodon, among others.


how to tell if ms access file was created as 32-bit or 64-bit?

Question: I inherited a 2013 ms access db file but i do not know if the user created it with a 32- or 64-bit version of access.  I know how to check my system settings to see what type my OS and MSO are, but how do I tell how a specific third-party file was created?
Comment: There is no such info as the file format is not an executable.
Answer: As far as I know, it doesn't matter. I'm pretty sure that they use the same file format.
Answer: If you talking about a accDB, then the creating version x32 or x64 should not matter.
However if you using a compiled accDE, then the x64 bit version of Access can ONLY open a x64 bit accDE file, and the same applies to a x32 accDE (they can only be opened with Access x32).
I don't believe there is a "easy" way to determine if the file was created with x32 or x64 bit Access.
Answer: There is an interesting article about it.

The General Rule
As a general rule, a database (in accdb file format) developed on Access x32 should run fine on Access x64 and vice versa.
When the General Rule Goes Awry
Although, a database made on Access x32 should run fine on Access x64 (and vice versa), some people report issues. You have 2 options:

Create a new blank database in the target bitness and import everything
Decompile the original database and migrate it to the other bitness and then recompile it

The article also quotes the Microsoft:

"We recommend the 32-bit version of Office for most users, because it's more compatible with most other applications, especially third-party add-ins." — Microsoft, see: 64-bit editions of Office 2013

If you run into the above problem, you can choose a preferred bitness (e.g. 32 bit) and for users with 64-bit Access (see the VBA code) display a warning.


Can a negatively voted down answer be checked as the right one by the owner?

Question: This question is answered by the same OP and although it is negatively voted down, the owner has accepted his own answer! Can these type of answers be removed or deleted even though the owner has accepted it as the right answer?
Comment: Note: Since this meta-question was asked, that answer was deleted by a mod.
Answer: The asker cannot be forced to accept a particular answer. They can self-answer and accept it. Self-accepts are not auto-bumped to the first in the list. Accepted answers are not necessarily the right answer.
Answers can be deleted if they don't answer the question or if they lack references.
Comment: Maybe they'll find it weird, but that's okay. There's a lot about this site that is weird. I think in this case it is obvious that it doesn't answer the question, even to a new user.
Comment: But wont a first time user find it weird to find a negatively voted answer to have a tick mark next to it indicating that it is the appropriate answer?
Comment: But such answers do exist without getting deleted as noted by Oddthinking using the query search mentioned below!
Comment: @pericles316: Be careful of survivorship bias. My query didn't return results that had been deleted. Presumably (I haven't checked) the answers on the open questions *do* address the question.
Comment: @Oddthinking-we need to have a check on that!
Answer: This isn't a direct answer to the question, but it demonstrates the phenomena isn't a one-off:

Is a religious upbringing psychologically damaging to a child? [Closed]
Does food aid cause famines? [Self-Answer, competing with better one]
Alkaline diet afect cancer? [Duplicate, Self-Answer]
Have recommended calorie intakes increased significantly over the years, and if so is it due to food industry lobbying? [Self-Answer]
Does the combination of red wine and cheese cause bad dreams?
Can a person still fart after death?
Was Shakespeare Marlowe? What does stylometry say? [Duplicate, self-answer, competing with better answers]

This data was generated with this query.


AAG trigger a query when failing over

Question: I'm running a Failover cluster on windows 2016 servers (2 nodes) where I set up an AG in SQL 14.0.2027.2
This works good and I'm happy. But when it failover I need to fix my logins so I need to run a query. It doesn't happen often but when it happens we are always too late-running this script. So is there a good way of running this script automatically right after failover and just send us one e-mail that the node's failover?
Answer: I can not see your script but I am assuming you get orphaned users on the database after the failover because the users are linked to SQL Server local logins with different SIDs on the different instances.
The best way would be to recreate the login with the same SID in both instances CREATE USER SID=<sid> so you do not have to fix orphaned users every time you failover.
If this solution doesn't suit your needs, perhaps you can set up an alert for event 1480 - AG Role Change, and run the script as the response action.
Comment: Agree, this is the way my company manages it too - new logins are added on both instances during initial setup and the failover just works then.

AAG trigger a query when failing over


How to do an Unsub event on a shared publication list?

Question: I am working on a landing page, and right now, the code is all done in AMPScript (as that's what I'm most comfortable with).  I have a one-click unsub page that is working great, except for cases where the email was sent to a publication list that was a shared publication list. I already have a method to determine that

The list is a publication list
The list is top-level/ent

Existing code:
SET @ll_sub = CreateObject("Subscriber")
SetObjectProperty(@ll_sub,"EmailAddress", @SubscriberKey)
SetObjectProperty(@ll_sub, "SubscriberKey", @SubscriberKey)

set @subscription = CreateObject("SubscriberList")
SetObjectProperty( @subscription, "ID",@ListID)
SetObjectProperty( @subscription, "IDSpecified", "true")
SetObjectProperty( @subscription, "Status", "Unsubscribed" )
SetObjectProperty( @subscription, "StatusSpecified", "true" )
AddObjectArrayItem( @ll_sub, "Lists", @subscription )

SET @ll_statusCode = InvokeUpdate(@ll_sub, @ll_statusMsg, @errorCode)

I have a @Flag variable that tells me if it is enterprise level or not, and I have a @Type variable that tells me if this is a group, list, or publication list.
Any thoughts on how to log an unsub event to this publication list when it is top level?
Thanks for your help!
Answer: You can define the parent BU MID in the SetObjectProperty and use a SimpleFilterPart for the Publication List ID:
SET @MID = "Account MID Here"
SET @clientID = CreateObject("ClientID")
SetObjectProperty(@clientID, "ID", @MID)

set @sfp = CreateObject("SimpleFilterPart")
SetObjectProperty(@sfp,"Property","ListID")
SetObjectProperty(@sfp,"SimpleOperator","equals")
AddObjectArrayItem(@sfp,"Value","Publication ListID Here")


Why did Manwe choose the Vanyar as his favorite of the Elves?

Question: What unique quality does Manwe see in the Vanyar to make him love them the most of all Elvenkind.
Comment: They made him cookies that one time.
Comment: It's repeatedly mentioned how "fair" they are. Beyond that, he just seems to like them
Answer: We don't know
Very little was written about the Vanyar, so we're not told explicitly what qualities Manwë admired in them.
If I had to guess, I would suggest that they were the closest to the Elves of Arda Unmarred, the hypothetical result of a Music of the Ainur not disrupted by Melkor's discordance. We're told a few times in The Silmarillion that Manwë was the most attuned to the will of Ilúvatar; for instance:

Manwë was the brother of Melkor in the mind of Ilúvatar, and he was the chief instrument of the second theme that Ilúvatar had raised up against the discord of Melkor
The Silmarillion I Ainulindalë
Manwë is dearest to Ilúvatar and understands most clearly his purposes
The Silmarillion II Valaquenta

The Vanyar display a few qualities that would align with this worldview:

They were members of the first tribe of the Eldar, all of whom accepted the summons to Aman; this is contrast to the other two tribes, who experienced discord in their ranks and divided into the Avari (who refused the Great Journey) and the Noldor and Teleri. As I pointed out in my answer to the above-linked question, the Vanyar even still identified themselves as this tribe:

This name [Vanyar] was probably given to the First Clan by the Noldor. They accepted it, but continued to call themselves most often by their own numerical name Minyar (since the whole of this clan had joined the Eldar and reached Aman).
History of Middle-earth XI The War of the Jewels "Part 4. Quendi and Eldar" Part C: The Clan-names "Vanyar"

They were the greatest enemies of Melkor, wanting nothing whatsoever to do with him:

Now in his heart Melkor most hated the Eldar, both because they were fair and joyful and because in them he saw the reason for the arising of the Valar, and his own downfall. Therefore all the more did he feign love for them and seek their friendship, and he offered them the service of his lore and labour in any great deed that they would do. The Vanyar indeed held him in suspicion, for they dwelt in the light of the Trees and were content;
The Silmarillion III Quenta Silmarillion Chapter 6: "Of Fëanor and the Unchaining of Melkor"
Comment: They were the closest of all the elves to being free from Melkor's corruption in one very clear way:  the Vanyar only went into battle one time, and that was for the War of Wrath.
Comment: I'm not sure the Vanyar are "less corrupt" than the Teleri simply because the Vanyar weren't attacked by the Noldor. (And for that matter, the Teleri did not participate in the War of Wrath, beyond providing transport.)
Answer: Because they were being good boys and girls who readily accepted the summons to live in Valinor, didn't turn away on their way there, and didn't join the rebellion of the Noldor. They lived at the Valar's feet happily ever after and sang praises onto them.
All in all, they were the perfect idea of Elves.
Tolkien Gateway also states that Manwe and Varda loved the Vanyar especially for their great skill in poetry. http://tolkiengateway.net/wiki/Vanyar


Will Didi make a profit from listing and delisting on the New York Stock Exchange?

Question: You can find the news on all the media. Didi is planning to delist from the New York Stock Exchange after only six months. It floated shares for a value about 4 billions dollars last June. If they buy back those shares at the current prices they may pay about 2.5B, that is a big margin over the initial offering. I don't know how much they paid in commissions to float the company and I don't know if the proceedings of the initial offering went to the company or the shareholders. So I would like to know if overall the operation will make a profit for the company.
Comment: Why would the company buy back its shares?
Comment: @Flux This is what the news say. I don't know why.
Answer: From a Reuters article Didi shares plunge more than 20% on plan to delist from NYSE

HONG KONG, Dec 3 (Reuters) - Just five months after its debut,
ride-hailing giant Didi Global (DIDI.N) said it plans to withdraw from
the New York Stock Exchange and pursue a Hong Kong listing, a stunning
reversal as it bends to Chinese regulators angered by its U.S. IPO.

The shares will simply trade on other exchanges, just not those in the US. The company will not be buying back the shares. As you note, the news is all over the media, you just need to carefully read the details of what China is requiring the company to do.
Edit - I am stealing from a great comment  - "Shares are/were not at the exchange. They trade there. You either have the stock certificate or they're in Street Name at your broker." That should clear up any remaining confusion.
Comment: Shares are/were not at the exchange.  They trade there.  You either have the stock certificate or they're in Street Name at your broker.
Comment: Can they move the shares without executing a new flotation?
Comment: Consider - when I was your age, one bought stock and received shares, a certificate of ownership. The fact that the building we need to send our shares to for selling will no longer be in NY, but likely Hong Kong, doesn't affect that certificate. I still own 10,000 shares of that company, whatever fraction of ownership it represents. The shares now are with the shareholders' brokers, not at the exchange.


How to remove the Dock in Mac OS X Leopard

Question: I don't want the dock that is at the bottom of the screen. I don't want to hide it but completely remove it. How can this be done? If not possible, why not?
Comment: What? Remove the dock?!?! Why would you want to do something like that? That's like disabling the taskbar on Windows!
Comment: @musicfreak - It's not perfect and scales horribly. http://www.asktog.com/columns/044top10docksucks.html this question sorely needs some cleaning up.
Comment: @musicfreak, hence why I use Emerge Desktop on windows; the taskbar is totally useless to me.
Comment: My comment was actually made tongue-in-cheek. ;)
Answer: Your best bet is to leave it there so you won't mess with other services but shrink it to super small size using the following terminal command:

defaults write com.apple.dock tilesize -int 1

see below for example .. that's wicked small.

then pin it to one side with the following terminal command:

defaults write com.apple.dock pinning -string start

then hide it.  It should be totally out of the way at that point unless you mouse all the way over in the extreme bottom left hand corner.
Comment: To assign a shortcut to the above, see [In Mac OS X 10.6, is there a way to disable the trigger that shows the dock when the mouse is at the edge of screen](http://superuser.com/questions/187367/in-mac-os-x-10-6-is-there-a-way-to-disable-the-trigger-that-shows-the-dock-when/187396#187396)
Comment: Options for pinning it include `start`, `middle`, and `end`. Also you will need to restart the dock by using `killall Dock` (make sure Dock is capitalized). Tested and this answer works fine on Lion too. +1
Answer: You can remove Dock.app, change its permissions, or disable the launchd plist that opens it:
sudo launchctl unload -w /System/Library/LaunchAgents/com.apple.Dock.plist

To revert the changes, replace unload with load or remove the entry in /var/db/launchd.db/com.apple.launchd/overrides.plist manually.
It also disables Mission Control, full screen windows, the Notification Center sidebar, the application switcher, Launchpad, Dashboard, and it makes desktop backgrounds gray.
This would increase the delay before the Dock is shown to 2 seconds:
defaults write com.apple.Dock autohide-delay -float 2; killall Dock

Answer: There is a program called: Dock Disabler (Source)
The Dock isn't perfect but disabling the Dock entirely will break certain features (eg. Expose in Tiger and Panther)
Comment: If its not your system, you shouldn't be making changes to core services or installing software that modifies the OS.  The vast majority of companies *really* don't like that.
Comment: is it safe? if i install your source to mac, it wont make affect ot os. Because it's nt my mac. i am on job.
Comment: Disabling the Dock also disables cycling through apps via command-tab. It did for me anyway.
Answer: As you mentioned in a comment, you just want a full screen app. In that case, see this answer to do that.
Answer: What do you mean by "my application"? If it's a third-party application with a full screen mode, file a bug report with the developer. If you're developing your own application, use CGDisplayCapture. If you're trying to maximise everything, try using your Mac like Apple wants you to. It sounds obnoxious, but it'll be easier for you in the long run.
If, however, you really do want to bend the OS X UI to breaking point (not that far, admittedly), follow Bryan's advice. Better still, stick it in an AppleScript, along with code to reverse it, and stick it in the Script menu. Then just select that item to switch between normal and hidden-away-really-small-in-the-bottom-left mode. And don't forget to ask the developer for a full-screen mode!
Answer: To the best of my knowledge, you cannot disable the dock. Even quitting the dock process results in it auto-magically restarting.
You cannot disable the dock because it is an integral part of OS X.
Why do you want to remove it? What benefit do you believe you'll get from removing it?
Comment: i want my application in full screen.
there should a button at the bottom to on/off dock.
Answer: Theoretically anything is possible I suppose, the Dock application is in /System/Library/CoreServices so for starters you could pull it out of there I suppose.
But I don't think Finder will like that, and you also will lose the Expose feature, and maybe Dashboard too.  I can't imagine why disabling/removing it would be preferable to simply hiding it.
Comment: hiding - it re-appear when i dont require.
so i need to close it.
I want full screen for my apps.
Comment: Because your mousing up to the edge of the screen and it's sliding back on the screen?  You could change the position and pin it to the top of the screen so its REALLY hidden
Comment: Actually in 10.5 you can't pin it to the top of the screen anymore
Comment: and i am using mac 10.5.7


Specifying my key name while encrypting file to some receiver using GnuPG

Question: I would like to make sure of one thing. When I am encrypting file, the only needed key to specify  is --recipient, because I only need to specify key to encrypt (receiver key)? I don't need to specify name of my key. There is no point in specifying my key name, because encryption only uses only receiver key. Is that right?
Answer: There is no need for your own key when encrypting message to other recipients: only the recipient's public key is required.
There would be two scenarios though requiring to denote your own key: signing messages (which is an operation involving your own private key) and adding yourself as another recipient, consider encrypting mails also stored as encrypted copy in your sent mails folder. You wouldn't be able to read your own messages any more, if the only encryption key is the recipient's one. There is the --encrypt-to  option in GnuPG, which allows you to define additional keys to encrypt for.
Answer: Yes. There is no need to provide another key than the one specified with --recipient.
To encrypt your file using GPG, you only need to specify one public key, with the option --recipient. You can take a look at the GNU Privacy Handbook - Encrypting and decrypting documents for more information:

To encrypt a document the option --encrypt is used. You must have the
  public keys of the intended recipients. The software expects the name
  of the document to encrypt as input or, if omitted, on standard input.
  The encrypted result is placed on standard output or as specified
  using the option --output. The document is compressed for additional
  security in addition to encrypting it.
alice% gpg --output doc.gpg --encrypt --recipient email@example.com doc
The --recipient option is used once for each recipient and takes an
  extra argument specifying the public key to which the document should
  be encrypted. The encrypted document can only be decrypted by someone
  with a private key that complements one of the recipients' public
  keys. In particular, you cannot decrypt a document encrypted by you
  unless you included your own public key in the recipient list.

You can use your own public key to encrypt a document. However, as long as your private key stay private, you will be the only one able to decrypt it.
When you wrote about using your own key, you may have wanted to mention the concept of signature, which is slightly different. You can take a look at the GNU Privacy Handbook - Making and verifying signatures to learn a bit more on the subject.


Energy loss and power over one period?

Question: Let's say we have a ferrite core inductor connected to an AC sinusoidal source with period \$T\$.
Thus, we have voltage \$u(t)\$ across the inductor and current \$i(t)\$ through the inductor. How can we find the equations which describe the power and energy loss due to hysteresis over one period?
We know that power at any point in time is given by: \$p(t)=u(t)\cdot i(t)\$ and the energy loss over one period is:
$$W(T)=\int_T{p(t)dt}$$
But, where do we go from there?
Answer: P(t) = u(t) x i(t) is the total loss due to copper resistance, hysteresis and eddy-currents. The hysteresis loss must be calculating using the magnetization curve for the material, the current, number of turns and the material dimensions.
The magnetization curve required would be an AC magnetization curve or hysteresis loop. I believe the hysteresis loop for the specific operating frequency would be required. The material manufacturer would probably provide curves showing core loss per kilogram of material as a function of peak flux density at specific frequencies.
A core manufacturer would probably provide loss information for specific cores.
It may be very difficult to find information that separates hysteresis from eddy-current losses.
Comment: If we take arbitrary dimensions (let's say the core is shaped like a cylinder and has a radius \$ r \$) and there are \$ N \$ turns around the core. The length of the inductor is \$ l \$ and the relative permeability of material is 500, how do we go from here?
Comment: I revised my answer. The 14 pages that explain core losses in the text book that I have do not really say how to calculate hysteresis loss separate from eddy-current loss. It shows an example calculation using a core loss curve.

Energy loss and power over one period?


Stability of terrestrial planets orbiting in the Lagrangian points of Jupiter sized planets?

Question: Would it be possible for a terrestrial planet say atleast >0.3 Earth masses orbiting in the L3/L4/L5 and L1/L2 Lagrangian points of a Jupiter sized planet in the habitable zone of a Sun-like star remain stable for billions of years? Would this scenario be unlikely to occur naturally? And if it is stable what are some possible factors that might make it eventually become unstable?
Comment: You do mean L4 or L5, don't you?
Comment: Actually I said L3 or L4 because I thought they were more stable.
Answer: There are indeed natural objects (called Trojans) captured in Jupiter's L4 and L5 bands. One gotcha is that for planets the size of Jupiter to form at all, they must be out of the habitable zone. Closer to the habitable zone (our side of the Asteroid Belt) causes dense rocky planets to form, but the solar winds that close to the Sun blow away the massive clouds of dust and gas that compose Jupiter and all of the gaseous planets. (Parenthetically, this formation pattern is why many don't consider Pluto a planet. It's more likely a captured foreign object.)
According to Wikipedia article on Lagrangian points:

L3 in the Sun–Earth system exists on the opposite side of the Sun, a little outside Earth's orbit but slightly closer to the Sun than Earth is. (This apparent contradiction is because the Sun is also affected by Earth's gravity, and so orbits around the two bodies' barycenter, which is, however, well inside the body of the Sun.) At the L3 point, the combined pull of Earth and Sun again causes the object to orbit with the same period as Earth.

So an L3 planet would actually just have roughly the same orbit as the Jupiter-sized planet (which, to me, doesn't seem like it would be orbiting the planet at all, in the way you normally think of orbiting). Wikipedia also states that objects in L1 - L3 do eventually fall out of orbit, and I doubt they would stay there for billions of years before doing so. If you aren't tied to billions of years, that's a convenient way to explain it falling out of orbit - station keeping, i.e. orbital maneuvers with rockets, can be used to keep objects in the L3 orbit artificially, but eventually maybe you run out of antimatter fuel or a natural disaster occurs to damage your equipment? The planet still wouldn't be in the habitable zone, but if you went with this scheme, you may as well change it to be in the L3 range of an Earth-like planet.
One problem is, no matter what destabilizes the orbit, it probably wouldn't have disastrous consequences during the span of one person's life. The climate would very slowly change over several generations as the planet drifts further and further away.
So all in all, it is not likely for that exact scenario to occur naturally. Objects in L3 orbit slowly fall out, and wouldn't naturally stay over billions of years. Even given an L4 orbit, Jupiter-sized planets are not likely to be in the habitable zone.
Comment: as food for thought and discussion without regard to the L3/L4 placement,  Astrobiology magazine [(http://www.astrobio.net/news-exclusive/water-rich-moons-could-form-in-goldilocks-zone/)] has a great article about 'Goldilocks Gas Giants and the potentials for water-rich planet sized moons,
Comment: The article about water-rich exomoons as big as Mars sugests they could orbit super-Jupiters and form further out before migrating into the habitable zone. Super-Jupiters might work for habitable planets at their Trojan points.
Answer: The general rule of thumb is the objects in the Lagrangian points must be significantly less massive than the primaries in order to remain in place.

Objects in the L1, L2 and L3 positions are in an unstable environment, and gravitational perturbations will rapidly destabilize them, causing objects to drift away. Semi permanent orbits "around" the L points are possible in these locations, but even there they will be relatively unstable, and require some sort of long term station keeping in order to remain in place.
The L4 and L5 points are much more stable (although realistically, they too are metastable, and objects placed there will be drifting in an orbit around the L points), and an object placed there should remain stable for geological ages.
You should also consider the actual scale of what you are proposing. Objects in the L4 and L5 points are 60 degrees ahead of or behind the orbit of the primary, so an object at the L points in Earth's orbit will be incredibly difficult and time consuming to get to. The Jovian Trojans would take years to reach launching from Jupiter space using any current or near term technology, Getting to the Earth Sun L4 or L5 point will be somewhat easier, but still an arduous journey unless you have some pretty advanced spaceflight technology.
Answer: If you are willing to sacrifice those types of orbits and the habitable zone, consider a world like this:
Jupiter's moon Io is the most volcanically active body in the solar system, making its surface uncharacteristically hot for where it is. The tidal forces that Jupiter and Europa enact on it cause the activity.
Although Io is a harsh and toxic environment (with all the sulfur and volcanoes and whatnot), you could entertain a scenario with milder heating, making it warm enough to be have liquid water. Given the lack of sunlight, perhaps the creatures on the planet evolved to use chemosynthesis, like some of the animals that live near sulfur vents on the ocean floor? Who says that the "habitable zone" is the only place that can support life? This is where the fiction in Science Fiction comes in, and where it gets fun :)


Insulating garage

Question: Dallas, Tex.  Building a new home. Builder does not insulate garage. We had a friend put in r-13 faced but he installed it paper side against sheathing on outside wall. Is this ok?
Comment: Hello, and welcome to Home Improvement. Are you heating, cooling, or both?
Comment: Has the drywall been put up?
Answer: I have seen controversy about vapour barriers, especially in heating climates.
The potential problem is that when it's colder outside than inside the garage water vapour moves thorugh the wall and condenses on the paper.  This produces mould inside the wall.
I don't know if this would happen in Dallas's climate.  Wall mould tends to be a problem here (Canadian prairie to arctic) in extreme heating environments (high arctic) or houses that have very careful attention to air leakage, but don't have sufficient ventilation.  This results in high humidity inside, which then can condense inside the wall.  But we have a 10,000 degree day heating season spanning 6 months in Edmonton. Exciting hot spots like Grise Fjord and Cambridge Bay are far colder.
Neither seems likely.  Garages generally are not well sealed for air leakage -- it's tough to do this with a tracked garage door.  Nor do you have an extreme heating season.
If you get different advice, or want to check:

Embed a couple of cheap remote temperature/humidity sensors in the wall right next to the paper.
Leave a place where you can remove the inside sheathing and reach in burrow through the insulation and touch or look at the paper.
Answer: As a "primarily cooling climate" (which is how I, from a primarily heating climate, think of Dallas, but I've never been there) that's where you want the vapor barrier - on the side that is, on average for the year, warmer.
In a primarily heating climate, it goes on the inside.
In the pesky in-between zones there are arguments favoring none, and there's also the argument that either side is fine, or that you should look at the likely humidity (on average) as well as the temperature (on average) in making your call. You could also take the approach of looking at what was done on the house insulation...

Insulating garage


In Tomodachi Life, how can you make the apartments expand?

Question: How do you make the Mii apartments expand in Tomodachi life?
Answer: According to Tomodachi Life Wiki

Mii Apartments has 3 upgrades not including the original building.
  Each upgrade changes the number of available apartments and the
  appearance of the building.
The first upgrade will have a brownish, brick-like appearance. It will
  expand to have 48 apartments.
The second upgrade will have a grayish, stony-like material. It looks
  very similar to how it looks in the beginning. It will expand to have
  72 apartments.
The final upgrade will have a elegant golden color. It will have a
  gate with two trees in front of the office. It will expand to hold 100
  Miis. The top four apartments will be in the center of the top floor.
Answer: You have to add enough Miis for it to expand. I'm not sure how many times it can expand, though.
EDIT: See the above answer.


What are the disadvantages of having many registers?

Question: IA-64 is an architecture that has 128 general purpose registers, are there any disadvantages (beside being more expensive and larger instruction size) to having many registers?
Comment: For a 'worse' example, AMD29K had 256 registers. The 32bits wide intructions had up to 3  8bits fields for addressing registers.
Answer: The disadvantage is higher latency per instruction.  Either you need to run the processor clock slower or you need to pipeline the register file, so each instruction will take more cycles.  (Pipelining the register file is difficult, and rarely done.)  A register file is a physical thing, thus must obey the laws of physics.  (In particular, that our universe has only three spatial dimensions, and that the speed of light is a constant.)  Suppose your register file is 2 dimensional (as all are today).  Then the register bits are typically arranged in a rectangle with width $b$ (where $b$ is the number of bits stored in each register) and height $N$ (where $N$ is the number of registers.)  (This assumes that the circuit to implement the bit is approximately square.)
Here's a picture of a 3-ported 4x4 register file that I found at http://gyan.fragnel.edu.in/~surve/COA/ISA/Images/Figure4.37.jpg:

Each time you read a register you need to propagate a read-enable signal to each bit of that register across the width of the array.  If the read-enable wires are buffered then
the delay to propagate a signal down the wire is proportional to the length of the wire.  (Neither the horizontal nor vertical wires in this diagram are buffered.  Buffering the vertical wires is actually hard, because that's a many-to-1 bus, not a 1-to-many point-to-point signal, so you may not be able to do that at all.  In the case that you can't buffer a wire, the wire will have a delay proportional to something like the square of the length of the wire.)
So at best a register file access is going to take time proportional to $O(b+N)$.  (That doesn't count the time for the decoder, and assumes that you somehow figure out how to buffer all the wires.)
To sum up: the more bits you are storing, the slower the storage.
Comment: Would banking the register file (which might be desired for increasing access bandwidth) make pipelining access slightly easier? I also wonder if width pipelining would help (by allowing the 'b' dimension to shrink for a given physical array) both for simplifying the pipelining of register file access (if the aspect ratio of the memory cells was biased to make the 'b' dimension larger, a 32-bit wide 64-entry array might have comparable delay in both directions and lower than 64x64 array) and for reducing latency in the common case where half of the data is more time critical.
Answer: As noted in the question, increasing the number of registers tends to increase instruction size (clustering, functional specialization, windowing, and other features can reduce the encoding overhead of a larger number of registers) and the area used by the core.
As Wandering Logic's answer notes, a larger register file will have higher access latency. Increasing cycle time to avoid pipelining register file access has obvious performance implications. Pipelining register file access complicates the design of the register file and the forwarding network (results from more cycles will be sourced from the forwarding network rather than the register file). (The Alpha 21464 was designed with three cycle register file access latency and register caching to simplify forwarding. "Design of an 8-wide Superscalar RISC Microprocessor with Simultaneous Multithreading", Ronald P. Preston et al.: IEEE reference.) Pipelining introduces inefficiencies as well with latch overhead, clock skew, stage imbalance, etc. Process variation may also discourage longer pipelines because the timing for a given core is constrained by the pipeline stage with the longest delay.
(Width pipelining, where part of a value is available earlier, can also reduce the latency for some uses that do not require the full value at the start of execution. A width-pipelined (a.k.a. staggered) ALU (which can provide bitwise logical operations, addition/subtraction, and left shift) could tolerate extra latency for the more significant bits of a value. Similarly, address generation for a load could provide cache index and enough virtual address tag bits for a decent way prediction with only 24 bits available initially. Obviously this technique could be applied to a smaller register file, but the benefit of a faster clock has diminishing returns.)
Access energy is also increased. Power delivery and thermal dissipation are significant design issues in modern high performance processors.
If a register alias table is used to support register renaming under out-of-order execution, the access cost of such is also increased like the register file and the size of each entry will be larger because renaming increases the number of registers.
For in-order execution the cost of determining result availability and selecting a result is also increased because the number of bits in a name is increased. (This effect is present for out-of-order execution as well. With only 32 architected registers, supporting 32 uncommitted results only requires 64 names, so source readiness only involves 6-bit compares; with 128 architected registers, more than 7 bits would be needed to name a register. This can be avoided by only checking for pending result names, but such introduces some complexity.)
Checkpointing register state for speculation recovery also becomes more expensive. Checkpointing would apply to some (not yet implemented) out-of-order execution designs and some forms of supporting transactional memory.
If each context is required to be full-sized, a larger register set makes multithreading more expensive. (For highly ported register files, additional register sets can be provided at lower cost under the restriction that different sets cannot be accessed at the same time. This three dimensional register file technique was developed for SPARC's register windows and used for Itanium's switch-on-event multithreading.)
As robot_s's answer notes, the cost of context switches increases. The cost of function call save/restore depends on the call interface. Itanium provided stacked integer registers rather than a generic function call interface, so there were not fixed registers to be saved and, in theory, save and restore could be handled asynchronously and involve a separate storage area (avoiding data cache thrashing). Whole-program optimization could also avoid some register save and restore that would be required from a static function interface.
Multicycle register file access also increases the number of cycles between when a fetch address is used (speculatively) and when it is confirmed or corrected (i.e., the branch misprediction penalty increases).
With a "flat" register set, software would tend to assume all registers have equal access cost and are fully paid-for (i.e., "free"). This makes some hardware optimizations more difficult;. Clustering, windowing, hierarchical capacity, exposed banking and other architectural features can reduce the impact of larger context storage (but make software optimization more complex and constrain hardware implementations).
The benefit of having a large number of registers depends on the workload and the latency and parallelism of the hardware. Fujitsu's SPARC64 VIIIfx provided more registers than Itanium, but specifically targeted high performance computing.
Itanium was designed under the assumption of static scheduling and high instruction level parallelism with support for single-stepping (so a register name cannot be used under the shadow of execution latency). High ILP means many results per cycle, and results would "occupy" the register for the entire execution latency in addition to any use lifetime. Static scheduling (especially with predication to increase the size of extended basic blocks) tends to increase the number of architectural registers used in order to cover latency and provide parallelism. Itanium also supported "prefetch" of values into registers, where the value would be reloaded if there was a store to the address of the load before the value is used; this would naturally increase register pressure (the register name is taken from the moment the load instruction issues just as with other instructions, so a load advanced ten cycles before use effectively wastes that register name for ten cycles).
Answer: Expensive context switch, save and restore all these registers. Some works (more info on William Stallings book) points that with compiler optimization theres almost no improvement when processor has more than 64 registers.
Comment: The utility of a large number of architected registers is workload-dependent (targeting certain HPC workloads can justify large architected register sets as the SPARC64 VIIIfx) and dependent on architectural and microarchitectural aspects (Itanium used registers to support static speculation and required single-step execution to behave the same as parallel execution [so old register values die as soon as a writer to that register begins execution rather than when the operation completes; a swap, e.g., requires 3 operations and a temporary register where a traditional VLIW uses 2 move ops]).


Object detection : is deep learning the only way to go?

Question: It seems that deep learning based approaches are currently more superior to the more "traditional" methods in the domain of object detection. Methods like YOLO, for example, seem to be doing something magical that can't be replicated by the other methods. However, these deep neural networks are trained on hundreds of classes and require a huge amount of computational power. So I have been wondering if we limit the object detection algorithm to a single class of objects (cats or a bicycle for example) can methods based on feature detectors(SIFT, SURF...) and machine learning algorithms (SVM, ANN...) perform similarly to deep learning algorithms?
Comment: I'm sure it depends on your problem and how complex and large the images are, but in general, image recognition is dominated by convolutional neural network based approaches.
Comment: You only need large amounts of data to train a deep learning model *from scratch*. Transfer learning goes a long way to reduce the required number of observations.
Comment: What I am trying to understand, is in the case of specific objectives ( such as one particular object) can classical methods perform as well as deep learning algorithms?
Comment: A DNN excels at image recognition because of its ability to make abstractions from clusters of pixels by convolution. Reducing the number of classes doesn't make an image somehow easier to interpret, it just means the model has to learn less complicated details to discern between classes, but the abstractions still need to be made.
Comment: But can classical methods achieve the same or should I just give up and switch to CNN/FastRCNN?
Comment: Do you think then, that a combination of CNN and images descriptors can be worth pursuing,
Comment: I think you can argue that CNN is just a machine learning algorithm on top of adaptive feature detectors (convolutional layers). so not clear that combining cnn and image descriptors makes sense.  I think its worth understanding what sort of image descriptors a cnn can represent and which it cant... (but that's more of a research question...)
Answer: Object detection is completely dominated by deep learning. Essentially it is now down to one-stage detectors (e.g., YOLO) when you want speed and two-stage detectors (e.g., faster-RCNN) when you want accuracy.
Check out any recent survey on object detection, like this one or this one.

However, these deep neural networks are trained on hundreds of classes and require a huge amount of computational power.

This is often true, but not strictly so. Many networks focus exclusively on humans (detecting pedestrians, or estimating human pose) for example. And modern hardware is quite capable of running high speed detectors like YOLO9000 in at least near real-time, even on cell phones (especially network weight quantizations).

If we limit the object detection algorithm to a single class of objects (cats or a bicycle for example) can methods based on feature detectors(SIFT, SURF...) and machine learning algorithms (SVM, ANN...) perform similarly to deep learning algorithms?

It's possible, sure. One case where you might do well is when there is very little training data available. Another is for objects that you can describe very well at multiple scales with a hand-crafted feature. However, I suspect that even with a relatively small amount of labeled training data, a deep CNN can do better, especially if it is via transfer learning or using low-shot/few-shot learning techniques.
Anecdotally, however, I know of a recent commercial/industrial object detection task in a production setting that was only designed to target a very small number of categories for a single class of objects (i.e., "fine-grained recognition and detection"). Their starting point was RetinaNet, I believe.
As to your comment

Do you think then, that a combination of CNN and images descriptors can be worth pursuing

I am not sure that it is worth it to look into image descriptors (i.e., hand-crafted feature extraction), since CNNs already do this very well.
What you should look into are ways to combine classical techniques with deep learning methods. Much useful knowledge from traditional computer vision has been forgotten and is waiting for rediscovery, I suspect. For example, take the recent "attention" work from CVPR by Ramachandran et al, which obtains state-of-the-art performance with fewer FLOPs and no convolutions at all, by taking advantage of so-called self-attention. Yet, this approach is simply a form of learned non-local means and/or parameterized bilateral filtering - both old computer vision techniques. In other words, while feature extraction may be done very well by deep models, there is still plenty of room for the use of classical methods in other areas I think.
Answer: Deep learning outperforms classical machine learning methods in terms of quality of solutions, it's also less complicated to implement universal solutions. Since DL was born you don't need to focus on features, because you expect that model will recognize the most useful of them from the data by itself (this is the strongest point). You should only provide the exact capability of the model to catch all needed features and don't allow to catch noises or overfit. It's much simpler. You can try preparing models with features descriptors and then use SVM, however SVM computation complexity is high, memory consumption is extremely high and it's hard to processing data in parallel. On the other hand computation of DNN are matrix-based and is relatively simple, finally can be easily done in parallel. Because of that SVM can't handle a large amount of data, it's much faster to do it on GPU-based DNN. The amount of training data is key to the quality of a solution. Many papers confirm that the classical approach performs worse than DL.
Finally, you can prepare DNN for less class and much simpler tasks.


Problems with extra Contact names in Emails

Question: When I want to send an email to a specific group, I open Contacts, highlight the Group name, select everyone in that group, and then either drag or copy and paste those names into the To: or Bcc: field in Mail (If there is an easier way to do this, I'd LOVE to hear about it.)
Recently, when I do this, a random person from other contact groups gets added multiple times in the To: or Bcc: field. It's always someone different and I can't find why this is happening. I end up having to go through the To: of Bcc: list and manually delete each time the person's address shows up.
Any ideas on why this is happening and how to fix it?
Answer: You can get more info from this Apple Support page.  If you follow these steps, you shouldn't have the problem of someone different showing-up in one of the fields.
Create a new email message to the group directly from Contacts.

Do one of the following:

Control-click a group in the sidebar, then choose Send Email. A new email opens in the Mail app, addressed to the group.
Drag a group from the sidebar to an address field in an email you're writing.

In your email, either the group name or individual contact names are shown, depending on how Composing preferences are set in Mail.
If the group is shown in your email but you want to see the contacts instead, click the arrow next to the group name, then choose Expand Group.

Tip: When you're addressing an email, you can see all the available addresses for a contact by clicking the arrow next to their name. To email the contact using more than one of their addresses, copy and paste their name, click the arrow, then choose another address.


Implementation of DBSCAN using R Trees

Question: I am trying to implement DBSCAN using R tree.We can store data in the form of R trees.So my question is how can i store real time data in R trees and how should i implement region query to find neighborhood of a point with it?
Answer: Implement R-Trees first, then DBSCAN.
As for realtime, you probably want to look into specialized clustering algorithms for data streams.
Answer: I am not sure what you mean by real-time data. In case you refer to changing data or stream data, you can just as well delete stuff that is outdated from the R-tree. If you mean that your data also has a time-dimension than you can simply extend the number of coefficients that the R-tree manages to (x,y,t) -- I assume you use the simple bi-variate version.
If you want to implement DBSCAN you will need to perform range queries in order to compute densities of spherical areas around points. Therefore, your region queries should be able to handle spherical query regions (for that matter I would also suggest you check out the SR-Tree by Shinichi Satoh, might be helpful). Again, if by real time data you mean that your data has a time-feature, you might want to consider using query regions that are ellipsoidal (allow for a separate scaling of the spatial and the temporal features).
Hope that helps :]

Implementation of DBSCAN using R Trees


Difference between "Discrete Wavelet Transform" and "Discrete Wavelet Decomposition"

Question: I have a rough overview on Discrete Wavelet Transform (DWT). However, I am confused about Discrete Wavelet Decomposition and did not find a good reference yet which explains this well. What is it actually about? Is it somehow part of DWT or an inverse operation to it?
Comment: I never heard the term *"Discrete Wavelet Decomposition"* before.  I suspect the two terms are for the same thing, but I am curious who is using the term "Discrete Wavelet Decomposition".
Answer: The discrete wavelet transform should denote "the operations" that, applied to some data, yield a discrete wavelet decomposition. The first one can be seen as a matrix operator, while the second relates to the actual wavelet coefficients, or the structure of thereof, that you would obtain after the application of the first one.
In everyday language, they are often used interchangeably, by a form of metonymy:

a figure of speech in which a thing or concept is referred to by the
  name of something closely associated with that thing or concept
Comment: This gives some light thank you :)