When should the throttle be closed on a C172 while landing?

Question: during landing training in a cessna 172, would you rather cut the power to idle at beginning of runway threshold, or idle when you're close to ground? I keep having problems where I flare too high or the plane bounce when it touch the ground, flaring is quite difficult.
Comment: What does your instructor say about this? They can see exactly what you are doing and we can't.
Comment: Don't think about flaring, think about holding the airplane off the ground.  Try to keep it from landing for as long as you can.
Comment: @Jpe61 - Yep, I can still remember my instructor (nearly 40 years ago) saying,"Hold it off, hold it off, hold it off…"
Comment: Related: https://aviation.stackexchange.com/questions/27734/how-can-i-stop-being-too-high-or-low-when-on-base-and-final/27742#27742
Comment: @Jim has a good point there. One of the tricks to make a good landing ist to let the plane sink close to the ground, but then "tease" it by not letting it land.
Comment: When you **start** to round will depend alot on your angle of descent (obviously you don't want to wait too long) (that's why power on roundouts are a little easier).  Rounding a little higher, but more gently, helps avoid "ballooning" the roundout.  This will come with experience.
Comment: Re question posed in title of this question-- for me generally well before turning final.
Comment: @Jim Your instructor never stops talking to you, no matter how many years it's been.
Answer: Sounds like an improper flaring technique, height perception at the roundout and/or improper final approach speed.
You should always be flying a stabilized approach ie power set to maintain Vref, aircraft configured to land and trimmed correctly to neutralize control pressures on final.  Vref should be at the value recommended by the manufacturer, or not greater than 1.3 times the stalling speed in the landing configuration.  Configured to land, this value is approx. 61 KIAS in a Cessna 172 as indicated in the POH.  You should fly this stabilized condition, on glide path and on centerline all the way down final to the start of the roundout.
You will start the roundout at approx 10 ft above the runway, smoothly pulling power to idle while simultaneously applying back pressure to both arrest your descent and compensate for the loss of lift and elevator authority due to decreased propwash over the wings and tailplane.  Judgment of how high off the ground you are is based solely on perspective.  You need to use you perspective from your entire field of view, not just how the runway appears, to judge height above the surface.  We can practice this in a exercise I will describe below.
The key to our control inputs here is that we want to command the airplane in such a way that it 1) arrests your rate of descent so you arrive at 1-2 feet above the runway with 2) the airplane in the correct attitude to gently make contact with the runway surface on its landing gear.  This takes a bit of practice to develop the hand-eye coordination based on the kinesthetic feel of the airplane and control feedback to get this right.
The best exercise to practice this with is the low approach followed by a go-around.  NOTE WELL: this is a dual instruction only exercise and should never be performed by a student pilot on solo flights.  In this exercise, you will fly a final approach to roundout as you normally would for a landing but not pull the power during the roundout.  This will cause you to enter a low approach, flying in ground effect, down the runway centerline at approx 1-2 feet above the surface.  With power still set for that used on final, the airplane should 'float' in ground effect down the runway.  You will continue to fly in this low approach for about 70% the total length of the runway before executing a go-around.   Be sure to note the total length of the practice runway during your preflight and establish with your instructor where you will being the go-around to ensure safe obstacle clearance during the departure back into the traffic pattern.
It's a good idea to select an untowered airport with low traffic and a long runway available to give you plenty of uninterrupted practice and time in the low approach to get practice in this environment.  Your instructor can recommend some airports nearby that can offer a good training environment to do this at.
This exercise gives a student pilot a good opportunity to safely practice, when conducted on a dual flight with a CFI on board, the following skills

Judging height above the ground by perspective alone.  During this exercise you can call out the with you are at both the proper height for the start of the roundout as well as established 1-2 feet above the runway, and the instructor can offer feedback, whether he/she concurs with your judgment and make corrections, providing you with the correct sight picture in during roundout.(NOTE: prior to beginning a training session using these techniques, a student should carefully study the perspective from the cockpit while lined up on the runway prior to takeoff and mentally photograph this perspective as his/her reference of the correct roundout height.  This is also an excellent technique for tailwheel airplane pilots practicing three point landings because it not only gives the correct height perspective but what the correct 3-point pitch attitude should be at touchdown).
Maintaining height above runway during slow flight and judging whether the aircraft is maintains altitude or whether you are descending towards the runway or 'ballooning' back into the air due to incorrect, insufficient or excessive elevator input.
Controlling the aircraft in ground effect during slow flight.  While students are taught slow flight techniques at altitude, the standard exercise does not provide the feel of the airplane in ground effect.
Maintaining directional control, runway centerline alignment and proper attitude in a crosswind during the roundout.
Executing a proper go-around during the roundout and how to mitigate slow speed and/or high AoA hazards in this regime.

Once a student has mastered these techniques, they can attempt to do another low approach to go-around, but once established in the roundout, correctly controlling the airplane, the instructor can smoothly pull the throttle to idle while the student maintains the correct roundout attitude.  The student should be warned prior to this to be ready to add additional back pressure once he/she senses the throttle being reduced to idle power to compensate for a loss of lift from reduction of propwash and prevent the airplane from quickly sinking to a firm landing or wheelbarrowing.  If this is done correctly, and the student maintains the correct roundout attitude and altitude, the airplane should quickly be exhausted of airspeed and gently settle onto the runway on its main landing gear.  We then transition into a high speed ground roll.  With addition practice, the student can learn to coordinate throttle reduction and elevator inputs so they can reduce power to idle at the same time they start the roundout.
One final note, unless you have an emergency, never attempt to force an airplane to land if it does not want to do so.  If, for any reason the airplane won't settle down onto the runway, the flare balloons excessively or other excessive floating happens just execute an immediate go-around.  If you have fuel on board and all systems are functioning correctly, you have time for another attempt.  Sometimes landings, for whatever reason or other just don't work out and it's just best to go around and try again.
Hope that helps as it come from someone who struggled with landings and realized no instructors were teaching these skills worth a damn.
Answer: The amount of power during landing a 172 only has to do with your angle of approach to the runway.

on final approach/flare/landing airspeed control is critical

Pitch (trim) controls airspeed, power controls your aiming point
So, if you are doing a 3 degree power on approach at 65 knots try cutting power smoothly as soon as you round to level with the runway at around 10-15 feet.  Then allow speed to decay as you pull the nose up.  After that the plane should almost land itself.

When learning to land "walk before you run"

If you get a good roundout, flaring should be not problem.
When coming in to land, arresting your descent at the proper height over the runway is the number one priority$^1$.  When learning, it makes no sense to overcomplicate this crucial step.  Only chop throttle when you reach 10-15 feet off the runway.  Then flare and land.
Be patient and keep flying it until the nose comes up.  Practicing on a longer runway is very helpful.  You have to know when your plane wants to land.  Forcing it at too high an airspeed can cause bouncing or skipping.
Be ready to go around.  Practicing rounding out and flaring at the proper height will make perfect.  This is why carrying 65 knots gives one a few more precious seconds to get "in the landing groove" before flaring and touchdown.  For now, leave that throttle alone until you are properly rounded and on the centerline.  Land (safely) a few hundred feet further down the runway.  When you get to short field landings, proper rounding becomes more critical.  Work on it with your instructor.
$^1$ at this point most of the altitude energy is gone and airspeed is decreasing.  Ground effect helps some here, but (if you don't go around) one way or the other the plane is going to land.
Comment: Power off landings are the same airspeed, the approach angle will be more like 6 degrees to get more "push" from gravity.
Answer: My instructor sent me a Rod Machado video on when to flare using visual cues from runway (The Runway Expansion Effect on YouTube). Rod also explains when to reduce throttle.

It first helps to understand perspective which, according to Oxford, is defined as "The art of drawing solid objects on a two dimensional surface so as to give the right impression of their height, width, depth, and position in relation to each other when viewed from a particular point." In our case, it is a matter of paying close attention to the relative size of the closest portion of the runway to the furthest point. Thinking of your windscreen as a canvas.
Here are the main visual cues:

Maintain the landing point in a fixed position in the windscreen.

Notice how the beginning of the runway flattens out and widens faster as you approach.

The expansion grows geometrically (increases at an increasing rate) even though your rate of descent is constant.

Once runway is assured, reduce throttle smoothly to idle.

Round out should occur followed by flare when runway perspective rate increase is 10x/sec.

Things to note:

Must have a stabilized approach no faster than 1.3x Vs (velocity of stall)

Review above mentioned video

Watch other landings to understand perspective rate of change

Use a simulator to experiment safely if available

Discuss with instructor and/or other pilots

Hope this helps
Comment: Thank you for summarizing the video! I put the link back in (it's not forbidden to link to external sites, we just don't like it if an answer becomes useless without it).
Comment: This has become a great answer now, very nicely done!
Answer: When I teach in the old taildraggers,(65,75,85 hp) I suggest cutting power on down wind just before turning base.  About every 30 seconds, I move the throttle forward to keep the engine clear and to ensure that I still have power if a go-round is necessary.  It is good practice to do this from time to time in newer aircraft.  If you are flying a Piper single and not using carb heat in the pattern, be prepared for carb ice.
With steady winds, chop the power when you know the runway is 'made'.  Then just "hold it off—hold it off" till the mains touch down.  The nose should be somewhat high.  Ease the yoke back so that it is full back before the nose touches down.(adjust for gusty winds)
Comment: I've been planning to do this on a Cessna for a while now (just haven't gotten the chance because the weather's been bad for weeks now). Will definitely keep in mind to "warm up" the engine every 30 secs…as taught in forced approach practice.
Answer: "Cutting power" sounds harsh, but then again you definitely should be at idle way before rounding out is done.
What I did, Step by step

Establish stable approach
At threshold & about 50ft, start retarding the throttle
Start gently pulling the nose up, keep eyes at the far end of the runway
Throttle closed, keep attitude such that the plane is sinking towards the rwy. Only smooth steering now
As you are a couple of feet from the ground gently add pull to let the plane ease into the ground.

So no sudden cut of engine power at any stage, but a steady pull on the throttle like 1...2...3
I mentioned stable approach, because you are setting yourself up for a mess if you need to constantly adjust power during the final stages of approach. In that case your speed (energy) and approach angle are in a constant state of change, and that state will continue all the way to the touchdown. Or bounce as it often turns out.
Answer: • Have a stabilized approach and keep the approach picture throughout a large portion of your final approach. This is where a good landing begins. If your plane's attitude is too different from what it should be over the aiming point, you're going to have more troubles managing all the energy and settling the plane down gently.
• Maintain the right airspeed. The POH recommends 55-65 kts. A lot of people aim to be at 60 KTs because it's halfway and seems ideal: I personally prefer to aim for 62.5 kts. Above 65 is too fast. But over 60, even being at 65 is just fine. The slower you are, the sooner the airspeed is gonna fall when you cut the power but you have to still go through the round out and flare stages- and that's when the plane hits the ground harder.
• Know your aiming point. I was taught to "cut" the power as I'm "crushing" the aiming point. Please be gentle while closing the throttle: the abruptness of pulling the throttle back is directly proportional to the abruptness of the right yaw you'll get after that.
• When you flare, be gentle and look at the end of the runway: you should be able to see the runway going down as you pull back. Spend time on dual flights to better your judgement of the right amount of asphalt you should see in your viewpoint as you flare. Or find any other reference that works for you. You can even talk about this on the ground with your instructor.
• It's paramount that you round out in to CRUISE attitude. Any lower and closer to the ground and you risk porpoising. Any higher of a pitch and you risk a tail strike as you keep pulling afterwards. I've had both of these. So speaking from experience.
Personal note: For a large portion of my PPL training I was too scared to wait before reaching a good height above the ground to flare at. So naturally my instructor was a bit frustrated with me not being able to let go of the habit of flaring too high (he hid it well though). And the onset occurred after I soloed and started using full flaps instead of 20 degrees. Try your best to get out of fears like this: that helps. And confront these fears. Acknowledge these and actively work on getting rid of these.
Good luck!


Program that can visit a webpage at a set duration

Question: Looking for a program that will simply visit a webpage every 6 minutes. Preferably without opening a new tab (I tried using Task Scheduler, but it would open a new tab every time)
Comment: Do you want this done in a browser window, or are you just confirming the site is alive?
Comment: Just confirming the site. Actually, I think any sort of command line program would probably be best, so I can just run it on my vps
Answer: To simply connect and check if a page returns, you can use either curl or wget on a command line or from a cron scheduled task.
You'll of course want to wrap it in a shell script to either send an alert or cause other behavior on fail/pass
Answer: WebChangeMonitor will do exactly what you want.
You can set the interval at which the page will be checked, and it can even display the differences in the HTML.  It is fast, efficient, and works very well.
You can configure it to check almost any number of pages (upper limit unknown).
Furthermore, you can set the User Agent being used for the HTTP/HTTPS requests.
It is gratis and open-source.  The source code and executables are available here:
https://sourceforge.net/projects/webchangemon/


likewise-open with WIN AD or ldap-auth-client with openldap server

Question: I will like to know which of the following combinations is popular;
likewise-open with WIN AD or ldap-auth-client with openldap server
Thanks
Answer: Both can be use as per your scenario.
likewise-open Can be use when you have centralised authentication with AD which server is on Windows.
And ldap-auth-client is usable with Ldap.
So you can use it as per your scenario.


How can I increase my survivability as a Barbarian on Normal?

Question: I have a game going with the Barbarian class, and I seem to be getting killed more often with him than any other class. Is there a secret/tip to using him that I am missing? My stat for armor (going off the top of my head since I don't have access to my game right now) is probably closer to 300, but I'm getting my butt kicked bad in Act 1, on normal difficulty! I know this is probably a stupid question, something easy that I am missing...
Comment: My experience with low-level barbarians has also been that they feel very squishy.  Their skills require you to constantly put yourself in the middle of large groups.  You just need to make sure your gear can support that, and that you are paying attention to your defensive skills.
Comment: I found that in Act I on normal, my health pool was so small that focusing on life restore (life on hit/kill, regen, etc) and AOE damage (cleave mostly) was the best thing I could do to stay alive. I quickly discovered in Act II that I needed to switch to strength/vitality to increase my life pool and armor. Eventually I had enough life that I could return to focusing on strength to improve my overall damage (now a mix of AOE and direct).
Answer: The number one thing I'd say to you is make sure you've got Revenge on your skill bar, and that you use it whenever it triggers. But for some more long winded advice, keep reading...

Well, as a melee-centered class, you certainly don't want to neglect armor, but on Normal you shouldn't need to be raiding the AH to get survivable gear levels. It's hard to say exactly how much armor you need to survive, since it changes by level, but if you're sitting at around 50-60% damage reduction, that should be plenty at this stage in the game.
Your problem probably isn't really damage mitigation, unless you're running around half-naked. You probably just need to focus on ways to regain health. You've got a few options to help out in both cases, though. I'm assuming you're level 19 or less, and probably more realistically around level 12-14 right now.

Cleave runed with Rupture is good for AOE damage, and it carried me all the way through Normal. If you're killing groups of enemies quickly, you're taking less hits, which increases survivability.
At level 10, choose Pound of Flesh as your passive. You'll get more frequent health orb drops, and they'll heal for more. You could always change this to Nerves of Steel for extra armor at level 13, but honestly this early in the game I think Pound of Flesh pays off more.
At level 14, you can add the Iron Impact rune to Leap, which increases armor by 300% for 4 seconds. This is a good way to start a fight with a pack of mobs. Jump in there, get greatly increased damage reduction for 4 seconds, and lay waste to them with your AOE attacks. Another option would be Ground Stomp to stun your enemies, but frankly, I think Iron Impact will have about the same effect on your survivability, but brings a lot more utility with it (like jumping over chasms in dungeons, or out of hot spots from elite packs of enemies)
At level 13, take Revenge. This is just about the best skill a Barbarian has, and you'll be using it from level 13 on. Not only does it do great damage when it triggers, but it heals you for 5% of your max health for every enemy hit. Great for keeping your health up when you're in packs! And at level 19 you can rune it with Vengeance is Mine to increase that heal up to 8% per hit!
More than anything else, in Normal you just want to stack gear with Strength and Vitality on it. Strength not only increases damage, but it adds directly to your armor on a 1 to 1 basis. Vitality is 10 hp per point, and if you took Nerves of Steel, it also adds armor on a 1 to 1 basis.
If you can find it, grab some Life on Hit or Life on Kill gear. It helps keep your hit points topped off.
Last but not least, you don't need to spend money on a top of the line mega-weapon, but do make sure that you're not running around with the same blue dagger that you found at level 4 when you're level 13. If it's taking you forever to chop down even the tiny white mobs like zombies, you need to hit the AH and look for a weapon with higher DPS. Monsters have a harder time hurting you if they're dead!
Comment: +1 for Cleave w/ rupture. It clears through hordes very quickly.
Comment: my barb focused solely on str/vit and cleave w/ rupture and a decent life on hit to go all the way to act 1 inferno.  It wasn't until late act 1 inferno when I had to do a gear swap for more resistance
Comment: You are right, sorry about that. I will delete it to avoid confusion.
Answer: At very low levels, high levels of armor will probably not help you, as your problems may be more related to a low health pool and low passive defense (dodge, resistances, etc).
I would recommend instead ofcusing on:

Skills that regain life
Life leech
Vitality
+HP per kill
+HP per health globe
Blackmailing monks to follow you around
And of course the ever popular health potion!
Answer: Strength increase your damage as Barbarian and for all classes it also increase your armor.
The best combo you may focus is

Strength
Vitality

With this, you get health enough to survive and armor/damage to kill
Answer: I hardly ever died when I was a low level barbarian. What you need to focus on would be your main stats (strength/vitality). There really shouldn't be any need at all to visit the AH. I never even opened it up until I was level 45ish. Also I've learned from playing multiple different classes that you may just need to try mixing up different combinations of powers. Find a combo that flows perfectly together and that works best for you!


"Drop Over" a higher channel in Video Sequence Editor

Question: Let's say I want to edit a video made of with 50 strips which replace each other with some fading between each strip. Because two consecutive strips will overlap, I put each next strip in a higher channel, use "Over Drop" and opacity (from 0. to 1., or the reverse) with keyframes, and it works fine. But Blender is limited to 32 channels and I do not know how to include the 33th strip. I guess it is possible to put it in channel 1 and not use "Over Drop", maybe "Alpha Under" or something? What should I do? What is the best practice?
Comment: This is true if you are fade-ing the next strip over the last. Don't forget that you can also fade 'out' the previous strip as well, allowing you to place the next strip 'under' the first. No stacking problem then.
Answer: Where is only 3 channels needed to make unlimited count of fades. Use Cross or Gamma Cross for creating fade effect:

And you don't need to use keyframes in this case, fade effect will be from start of one strip to end from other strip.

And channel position doesn't matter, first and second strip sets up not by top and bottom order, but by selection: first and second selected.


Do you need to inform employer of patent licensing that you obtained on your own?

Question: I have full time job and I am thinking about getting a patent on my own and licensing it. It has no connection to my full time job. Do I need to tell my employer that I am licensing a patent. Does patent license count as secondary employment.
Answer: This may deal with your employment contract. For most jobs I'm familiar with what you do on you own time is your own business. This assumes it is unrelated to your company's business and you aren't using any proprietary information or tools (like your work PC). That said, I've heard of examples where a company tries to claim ownership of an employee's intellectual property.
This also may depend on where you live. I hope you are working with a patent attorney in the prosecution of your patent application. That attorney may be able to guide you with respect to your current employer. If not, you may want to talk to an attorney. Otherwise, employment law and contracts are off topic on this site. You might get some useful feedback from the Law SE site. I am not an attorney and this is not legal advice.
Answer: This probably heavily depends on the country you are in. In Germany you have to tell your employer that you are patenting something and you have to give your employer the chance to license that patent. Only after your employer refuses to license your invention you can do whatever you want with it. Whenever the invention is based on proprietary information that you got hold of because you work for that employer the situation may be different.


Mount root filesystem as R/W

Question: I use NOTE4 N910C with Android 6.0.1 PDA N910CXXU2DPE6, CSC N910COXA2DPE1 + TWRP + root, dated Wed, 11 May 2016.
All works perfectly but in this version of firmware, root filesystem is mounted as read-only. Developer mode is turn on.
I try to remount /system from console, from ES Explorer, from Root Explorer and so on. Nothing helps. Can anybody advice me how to make root filesys as R/W. Just for a while, to make some changes.
Comment: Have you tried from a shell (e.g. `adb shell`) with root access (`su`) to run `mount -o remount,rw /system`? Does it work, or give an error? In the latter case, which error exactly? "Nothing helps" is not very specific, as we don't know what happens unless you [edit] your question and include the errors you're seeing :)
Comment: Yes,. Of course I used mount -o remount,rw /system as su. The command was executed without any error but root filesys was still read only.
Comment: "No error but no effect" sounds strange. Not sure if that's some SELinux enforcement (or something comparable), but I'd expect an error if something doesn't work.
Comment: It was possible to access as R/W root files in ver 5.1.1 and in first version of in 6.0.1. After upgrade to new verion of 6.0.1 - R/W access is not possible. Terrible...
Answer: Finally I remount /system as R/W. The proper syntax of command is:
mount -o rw,remount /system

NOT:
mount -o remount,rw /system

I really dont know why, but second syntax is executed without errors but /system is still read only. The first command works on NOTE 4 N910C correctly.
Thats all, topic closed.

Mount root filesystem as R/W


Whats the difference between tdd and automated tests?

Question: Whats the difference between tdd and automated tests? I'm confused.
Comment: Search for TDD and Kent Beck.
Answer: Automated Tests are tests that are automated, i.e. tests that don't have to be performed manually.
Test-Driven Development is a Software Development Methodology in which Tests drive the entire development process. In order to drive the process, writing tests needs to be the very first thing you do; when you have written a failing test, the test tells you what code to write, which code to write next, and when you are finished writing code. The tests are the driver for the entire development process.
The two don't really have anything to do with each other (apart from the fact that typically, the tests used in TDD are automated tests), so asking about their difference is about as meaningful as asking about the difference between a Toyota Corolla and the color blue.
Comment: Thanks!! Where should I get started learning about automated tests in Java?
Comment: @frank Maybe dive in with one of the frameworks - [Junit](http://junit.org/junit5/) is one of the better known ones.
Comment: Where should I start learning testing and going beyong? I use Java. Thanks!
Answer: Automated Tests
... are mini programs that execute some code against some input/environment and verifies that some output/outcome was achieved.

Unit Tests evaluate a function/class using mocks for every collaborator.
Integration Tests verify that two pieces of code co-operate together correctly. Such as integrating with a Database, accessing the File System, network connection handling, etc...
Module tests verify a larger unit of complex behaviour. They are large enough to have some long lasting environmental state, hide highly orchestrated complex calculations, or have a complex protocol for being interacted with.
E2E (end to end) tests are lifecycle tests where every piece of the system is deployed (in a test environment) and strung up with most (if not all) of its collaborating systems. These tests often describe actual business use cases, but also need to include verification of the automated business as usual and support scenarios.
Performance tests execute a piece of code several times to characterise its runtime behaviour. That could be for speed, for stability, for capacity, or even attack scenarios (like Denial of Service simulation). The test passes if the code performs within some expected limits.

There are other categories of automated test that focus less on the how it is being tested, and more on the purpose of the test (such as Dev tests, Acceptance Tests, defect tests).

Test Driven Development (TDD)
Is a design methodology where by:

while not yet done...

write a test that describes the expected behaviour of an interface.
write the actual code that satisfies the described behaviour.

This forces you to think through the interface, and how that interface will be used later.
This can be a very powerful technique, but you should use it in reason. I recommend researching Kent Beck (the father of TDD) along with his discussion on "the Three Xs" (Explore, Expand, Extract).
Just to note, there is a qualitative difference between the tests written using TDD and tests written post-implementation.

Those tests written using TDD will be very complete descriptions of expected system behaviour, even to the point of being better than documentation. And do serve to prove that the system is capable of performing in the expected manner.
Those tests written post-implementation will not be very good descriptions on how to use the system, but can actually be written in an adversarial manner. That is you can read the implementation and specifically search for edge cases, or poor implementation choices and hammer them punatively.
Comment: Good answer - although I never liked describing TDD as a way of thinking through interfaces. To me, it's more about defining natural test boundaries through semantically meaningful behavioural units. This is super helpful when you later need to refactor by breaking out components, because it leads to those interfaces being generally more stable than if you're just "writing tests for classes."
Answer:
...so asking about their difference is about as meaningful as asking about the difference between a Toyota Corolla and the color blue...

This is not true as there is a massive difference. TDD is counterproductive and places all the onus and testing responsibility on the developer. This goes against the "tester" specialization and the fact that a developer should never be the only one to test his own code. It also place a tremendous amount of undue pressure on the developer. I have written code so complex that if I followed TDD it would have taken more than twice the time to develop.
Test automation on the other hand is completely different. While TDD can be a form of test automation typically there are other tools that "testers" use to record user sessions and code in certain behaviors using tools like Visual Studio and C#.
The "tester" specialist can be far more efficient in test automation for 2 reasons. Firstly this takes the pressure off the developer. Secondly this shares the workload  where the onus is on the "tester" to do the test automation rather than burdening the developer whom already has too much work to do. He does that easily with a combination of recording end user data inputs and C# code for testing automation purposes. This is a far more efficient and superior solution to TDD.
I would go as far as to say that unless your software application is relatively simple (which is rare) stay away from TDD. Find a good tester whom can record and code test automation for the developers. Alternatively developers themselves could use tools like Visual Studio and C# to record and code the test automation which would still be more efficient than TDD.
Comment: There is nothing in TDD that would preclude having a dedicated tester designing, writing, and executing a suite of automated tests on a codebase which was written by a developer using TDD. TDD is a _software development_ methodology, not a quality assurance methodology.
Comment: So the back-and-forth between tester and developer is more efficient than a developer encountering most of those problems while writing code? There is nothing wrong with having a tester. There is also nothing wrong with testers writing automated tests, but those will be full integration tests that won't verify the behavior of individual units of code (e.g. methods).
Comment: Still do not agree. TDD is counter productive and a tremendous effort would be needed for complex code. I do my own unit testing using debug mode which is far easier and quicker. There was life before TDD and I never needed it then, and I certainly do not need it now either. In my opinion TDD is costly, time consuming and completely  unnecessary.


Does time move differently on Mars?

Question: When John Carter is returned to Jarsoom/Earth by the Thurns, he arrives in his body in the gold cave and is suffering from atrophy of his muscles. The sheriff is also just a pile of bones.
How much time passed on Earth since his few days on Mars?
Answer: We are not given a frame of reference beyond the decayed and skeletal remains of the Sheriff. Left with that we are forced to use science to determine how long it may have been. For that we turn to a paper from the University of Tennessee discussing "Decay rates of human remains in a arid environment" conducted by Galloway A, Birkby WH, Jones AM, Henry TE, Parks BO.
From their abstract of the paper:

The environment of southern Arizona with mild winters and hot, dry summers produces great variability in decay rates of human remains. Summer temperatures, which range well over 38 degrees C (100 degrees F), induce rapid bloating as a result of the accumulation of decompositional gases. However, in certain circumstances, the aridity can lead to extensive mummification, allowing preservation of remains for hundreds of years.
A retrospective study of 189 cases, concentrating on remains found on the desert floor or in the surrounding mountains and on remains found within closed structures, outlines the time frame and sequences of the decay process. Remains can retain a fresh appearance for a considerable time in the winter, but the onset of marked decomposition is rapid in the summer months. Bloating of the body usually is present two to seven days following death. Following this, within structures, there is frequently rapid decomposition and skeletonization. With outdoor exposure, remains are more likely to pass through a long period of dehydration of outer tissues, mummification, and reduction of desiccated tissue.
Exposure of large portions of the skeleton usually does not occur until four to six months after death. Bleaching and exfoliation of bone--the beginning stages of destruction of the skeletal elements--begins at about nine months' exposure. Insect activity, including that of maggot and beetle varieties, may accelerate decomposition, but this process is greatly affected by location of the body, seasonal weather, and accessibility of the soft tissues. Carnivores and other scavengers also are contributing factors, as are clothing or covering of the body, substrate, elevation, and latitude.

Given this information: We can assume that the skeleton, with active insects or other predation could have been there for as little as two months or as long as six months. There appeared to be profound weathering and the conditions were appropriately hostile as well, potentially speeding the process. Wherever or whenever John Carter is, time is moving at a compressed rate in comparison to his time on Earth.
Answer: I assumed 3 years, simply because he starts the story from 13 years ago. Then when he gets back, he spends ten years searching for the medallion.
Answer: Considering both of these answers I have two theories:

If he had left Earth for three years and only spent a week on Mars then he would have only been away from Mars for 30 weeks, give or take, after the therns sent him back.
If Po was dead for four months then John was away from Mars given still that only a week at most passed is still about 30 weeks

lol both work and both sit the same time frame.

Does time move differently on Mars?


Change vector fill colors in Corel?

Question: In Corel Draw X7 it is really easy to create vector fills. It is also easy to transform these vector fills (scale/shift). But I can't find a way how to change colors. Is there a way to edit vector fill the similar way as curves? I do not see any "edit vector fill" icon. Or is it possible somehow to convert vector fill to curves to change colors and save as new vector fill?
Comment: I am not sure what are the vector fills, becouse my version is not in english. Do you mean a) The gradients (linear, radial, conic) b) a vector ilustration inside a power clip or c) a pattern?
Comment: @Rafael When changing fill of object there are 5 main categories - solid, fountain, vector pattern, bitmap pattern, two color pattern. Only one is vector fill, the full name is "vector pattern fill".
Answer: This is a nice question!. Unfortunately you can't edit a vector fill inside CorelDRAW, while you can do that outside it. I will tell you how.
CorelDRAW is storing you custom fill as a .fill file in your CorelDRAW User document folder as a custom fill in the following directory
[User folder]\My Documents\Corel\Corel Content\Fills
This file is only can be read in CorelDRAW by opening it from the Vector fill  fill tool only in CorelDraw, this file could not be opened with any vector based software even corelDRAW itself .. I tried to rename it to any vector file format and I failed to open it with any vector based software ...
the main concept of my solution is:
although can not edit the vector fill in CorelDRAW but we still could replace it with another new pattern based on the original one.
Please follow my steps please.

Draw any shape in CorelDRAW and fill it with the vector fill you want to modify.
Export your artwork to .AI file from CorelDRAW.
Open the .AI file in Adobe Illustrator.
You will notice that the vector fill in illustrator is converted into a vector Pattern. you will notice too that the pattern is missing from the color swatch panel, but it is recognize in Illustrator as a fill ... so far so good.
Now drag the pattern from the color fill box (1) and drop it into the color swatch panel (2) as shown in the hereunder screen shoot.

You will notice that the pattern is now in the swatch panel which is a good news.

Double click over the pattern swatch we just reveal it in the Color Swatch, and that action will activate the patter editor mode in Illustrator. and in that mode you can change the colors and the design of the patter the way you like as the following screen shoot.

Now you have all the options ... export ; Copy and past ; save it a EPS ...etc. for me I did select all the pattern in the pattern editor mode. and past it into CorelDARW as a Past Special > Picture (Enchanced Metafile)
In CorelDRAW Make a new Vector fill pattern from the pasted artwork by going to Tools > Create > Pattern Fill in the Dialog box check the Vector fill.
Now you have just created a new modified vector fill file based on the original one. you can now fill it in any object in CorelDRAW.
Comment: Thanks for the tip and explanation. Worked perfectly. (In my case I had to export it in PDF format, but it worked perfectly).
Answer: Save your vector fill in Corel as "MyFill", go to "User folder\My Documents\Corel\Corel Content\Fills", copy MyFill.fill to any location, rename it to MyFill.zip, open with WinRar, go to Content\Data - you will find "Tile.cmx" there - open it with Corel. Thats all!

Change vector fill colors in Corel?


how to upload a all type of documents to google docs using android?

Question: I am new of android development, I have not any idea for upload document in google docs,mean while i searched in google but i have not any sample code for upload document into google docs using android. i dont know which google api is using, So please give some ideas and any tutorials(links) for this.
Thanks advance.
senthil.
Answer: Here's a place to start https://developers.google.com/google-apps/documents-list/


Okay to run relay with an -alpha-dev distribution?

Question: I am running a relay with the tor-0.4.3.0-alpha-dev distribution, which I installed as a noob mistake. Is it okay to continue with this version? If not, then do I just do a standard apt-get uninstall and install a more stable version? If so, which? I have already changed /etc/apt/sources.list to use ...torproject.org bionic main.
Comment: If you use Docker, your management will be a lot easier. I wrote an article about how to set it up.
Answer: Yes, it's absolutely fine to run a alpha version of Tor as a relay if and only if you're a relatively advanced user.
First of all, alpha's need testing. However, be prepared for bugs and please only do this if you're also going to report the ones you encounter too.
Secondly the Tor network also gains resilience from different Tor versions running on different OS and hardware platforms. It helps diffuse the possibility that any one bug affects the entire network.
You can see in the Tor consensus document, that some alpha versions are defined as recommended versions for servers (I.E. they are considered suitable for use as relays).
server-versions 0.2.9.15, 0.2.9.16, 0.2.9.17, 0.3.5.8, 0.4.0.5, 0.4.0.6, 0.4.1.2-alpha, 0.4.1.3-alpha, 0.4.1.4-rc, 0.4.1.5, 0.4.1.6, 0.4.1.7, 0.4.2.1-alpha, 0.4.2.2-alpha, 0.4.2.3-alpha

You can easily check the current list at: consensus-health.torproject.org
Comment: That's good to know about running alpha version and the list of recommended versions, but I'm not an advanced user, so I switched to the default package, currently 0.4.1.6.
Answer: I'd stick with an official release version of Tor, just because it'll get more attention and updates if there's anything amiss.  apt-get remove tor; apt-get install tor should do the trick to get you onto a release version, and should maintain your existing configuration.
Comment: Yes, those instructions did the trick without a hitch. I appreciate the help.
Comment: @womble: i'd rather advise to use `apt-get remove tor && apt-get install tor`. ;-)


Web server requirements for being crawled

Question: I'm trying to index a web site that is hosted on a separate server in the domain but every time the crawler runs it returns a ball of warnings and errors the first time, and then the server becomes unavailable for an hour or so. I've tried scaling back the request time to 10 seconds but this only marginally improves performance. I think it has to do with the number of concurrent connections being eaten up by the crawler and not closed properly when they're done, but I don't have any evidence to back this up and convince the server owner to increase the number available.
So my question is, is there a general guideline or requirement for a web server to be crawled? Does it need a specific amount of available connections or specific performance minimums to keep from being killed by a "normal" crawl? This wouldn't be the first time I've seen a crawl bring a server to its knees so I'd really like to know ahead of time if that's going to happen instead of risking an outage.
Answer: You can define crawler impact rules so you can reduce the load SharePoint will put on an external site.  What type of content?  Is this static HTML pages or something different?  You may want to be sure your crawler is also configured to crawl complex URL's.  You can also adjust the SharePoint crawler timeouts and retry events - but these are server settings and would affect all your crawls.
Reference on setting crawler impact rules:
http://technet.microsoft.com/en-us/library/cc261720%28v=office.12%29.aspx
Answer: In addition to Crawler Impact Rules you can configure the crawler to use Anonymous Access. This can help crawling Windows servers running IIS that host the target web site.


A three string tree diagram evaluated in CFT is different from string field theory evaluation

Question: Hi Guys generally when you evaluate the 3 open string tachyon tree level amplitude in CFT, you do a conformal transformation mapping the worldsheet to the upper half of the complex plane and the incoming and outgoing strings become points on the real axis. However in evaluating the string field theory tree level amplitude the problem involves a different procedure where the 3 string worldsheet are conformally transformed in to 3 different worldsheets which are then glued together to form a circle, with the incoming and outgoing strings being the points on the circumference of the circle. I don't understand why the same amplitude is seen in two different ways.
Comment: @VaibhavWasnik could you not write a nice answer explaining it based on the two figures in the paper ;-)?
Comment: "3 different worldsheets which are then glued together to form a circle" Could you please clarify this statement? How could 2d surfaces be glued to form a circle?
Comment: please see fig 4 and fig5 inthis reference http://arxiv.org/abs/hep-th/0311017
Answer: The disk and upper half plane are related by an SL(2,R) transformation. Therefore correlators evaluated on the respective surfaces are identical.
Answer: This disk is the interaction region on the S or T channel. One can have $2$ or more $e^{ikx}$ inputs on the boundary to compute vertices.


image not display in media library and thumbnail not display in post

Question: some problems with importing images.
(1) Upload folder images do not appear in the wordpress media area. The upload folder is already with 755 permission.
(2) Thumbnail do not appear on the site. However, I can access the image by url. The images inside the post usually appear on the site. The problem is only in the thumbnail.
(3) In the post admin, the thumbnail area keeps loading and never leaves it. And change the highlighted image the upload folder photos do not appear.
Images have been manually uploaded to the upload folder as the default wordpress import / export does not work 100%.
Is there anything that can be done in the database to fix? What to do?
Answer: If you are using custom theme, please add this in the functions.php:
add_theme_support( 'post-thumbnails' );


Unable to get same results when using manual replicating automatic setting

Question: Some times before I shoot in low light situation, I put my camera in auto to see the settings to use as a baseline and tweak the setting from there. However, oftentimes, I am forced to use the auto because I would have to use to slow of a shutter speed or a high noisy ISO. My question is why can't I replicate the results when I use the same exposure setting in manual that showed correct exposure in automatic. See sample. First shot in manual and second in auto. Both shots were exposed at F4, Shutter speed 60, ISO 400 with automatic flash. What am I doing wrong? Please help.

Comment: What camera, lens, and flash? What exposure mode? What selections for things such as Auto ISO or Safety Shift?
Comment: The first image looks as if flash wasnt used at all.  As per Michael Clark's answer , some of your EXIF should show the difference in some key parameter.
Answer: Look in your images EXIF data to make sure the ISO was 400 in both when they were exposed. It doesn't look like it was.  EXIF shows the settings actually used.
Auto mode uses Auto ISO, Auto White Balance, and it controls color profile too. Auto mode is Auto everything.  But you don't set ISO to anything in Auto, Auto does what it wants to do.  Your ISO setting might say 400, but Auto does what it wants.  EXIF will show that.
In contrast, A,S,P,M are just exposure modes.
These modes do not use Auto ISO or Auto WB unless you configure them individually to be on. Default is off.  You set color profile yourself too. And you turn the flash on if you want flash to be used.
Instead of using Auto mode for these comparisons, use Aperture mode A. A,S,P are auto Exposure, but then Auto ISO and Auto WB will be same as Manual, only on if you have selected them On. Auto ISO and Auto WB can have effect if they are on.  But only Exposure should vary in A and M mode, and Manual can duplicate what A mode does.
But Auto mode is a whole different game, fully automatic, no manual control.
Comment: Thanks for replying. I checked the EXIF. It was definitely ISO 400 for both. I had my WB set to flash. I will definitely take your advice and try it in all the other auto modes.
Answer: Depending upon what specific camera you are using, what settings you have selected, and in what particular "Auto" mode you are shooting the camera may change what you think is selected to make sure the image is properly exposed. Even though you think you have the camera set to ISO 400, if the camera decides it needs a higher ISO it can raise the ISO if you are in an "Auto" exposure mode that enables Auto ISO by default or if you have enable Auto ISO yourself.
The way the flash behaves can also vary between full "Auto" modes and Manual Exposure mode with the flash set to "Auto." If you are in Manual exposure mode and have some flash exposure compensation dialed in the flash will underexpose by the amount you have entered. If you set the camera to a full "Auto" exposure mode, the flash exposure compensation you have entered will likely be ignored.
If you would provide us with the specific camera model, specific lens model, specific flash model, specific "Auto" exposure mode, and specific flash settings used when in "auto" mode as well as when in Manual exposure mode it would allow us to give a more complete and specific answer.
Comment: @Ramone What are the Tv, Av, and ISO indicated in the EXIF for each image? WHat does the EXIF info say about FEC?
Comment: Thanks for replying. I am using a Canon 60D with a Canon 18-135MM. I used the in camera flash on E-TTL mode. I was using the full auto mode. I double checked and the ISO was definitely 400 for both photos.
Comment: @Ramone Do you have any flash exposure compensation (FEC) set when you are shooting in **Manual** exposure mode?


If photons are massless, how are they reflected and blocked by something that has mass? Shouldn't they pass right through any object?

Question: If photons are massless, how do they get reflected, blocked when something comes in its way? Shouldn't the particle just pass right through any object?
Comment: Regarding why electrons re-radiate photons, the answer is very non-trivial. There are many good answers on StackExchange, so look them up. Why is that the photon gets re-radiated back at an angle equal to the angle of incidence is due to the conservation of energy and momentum.  Answers to this can range from Fermat's Principle to properties of electromagnetic waves that one can use to study reflection.
Comment: They're massless, but they still have momentum and energy. There is an energy transfer (to the object's electrons), and then the energy gets re-radiated back as photons. The 'reflection' here is actually scattering.
Comment: E=mc^2 and m act as gravytational mass
Comment: @PrathamHullamballi.  Why does the object re-radiate it, and that to so quickly and in such a specific direction/angle? If a photon hits an object, why doesn't it get get re-radiated in an angle unequal to the angle of incidence?
Answer: Special relativity says that an object that moves at the speed of light - like photons - cannot be slowed down or stopped. However, there is nothing that forbids a photon from being reflected (moving at the different direction at the speed of light) or absorbed (completely disappearing).
Photons are the gauge boson associated with electric charge, and as such interact with any electrically-charged particles. In particular they interact with electrons, which are plentiful in dense materials. A photon hitting a material is usually absorbed by one of its many electrons (raising its energy level), and then either quickly thrown back out (reflection) or turns into movement of the atoms and heat (black body absorption). In certain materials, the energy levels allowed (by quantum mechanics) to electrons do not allow absorbing photons of particular energy (i.e., wavelength), so this material is transparent to these wavelengths.
It is not true that photons are absorbed by anything that has mass. A neutron, for example, has mass, but does not have a charge and as such cannot absorb or reflect or otherwise interact with photons (I'm limiting the discussion to low-energy photons to avoid more elaborate second-order effects). In theory a big ball of neutrons will be transparent. In practice, neutron stars are not 100% neutrons and not transparent (see Are Neutron stars transparent?).
Something unrelated that mass can do is do deflect or attract photons - i.e., gravity also curves light rays. This is general relativity. But it doesn't "reflect" or "block" photons - just slightly modifies their trajectory.
Comment: The neutron might be neutral but it has a nonzero magnetic moment so it can interact with photons. It's just that it's much weaker than those of particles like protons and electrons. No need for high energy photons here either.
Answer: It's all due to something that we can never observe directly ... it is the EM field (Electro Magnetic field).  We know it is present because magnets and electric charges attract/repel and electric currents make magnetic fields as well.  The term photon refers to the real energy that can pass thru a vacuum like space .... we see it as visible light.  (There are also something called virtual photons which we use to describe EM forces).
All atoms/molecules are surrounded my moving electrons and they are always working with the EM field .... atoms/molecules creat many EM energy transfers called photons .... and they also absorb photons.


Are there any solutions to the diophantine equation $x^n-2y^n=1$ with $x>1$ and $n>2$?

Question: This problem arose when considering storage of cannonballs in n-dimensional pirate ships, as explained in this MSE post. This MO question can also be reduced to the $n=3$ case. If $x,y$ is a solution then $$0<\frac{x}{y}-2^\frac1n<\frac{2^\frac1n}{2ny^n}$$ then by Roth's theorem this has finitely many solutions for fixed $n$. Let $$2^{1/n}=a_0+\frac{1}{a_1+\dots}$$
be the canonical continued fraction of $2^{1/n}$, then $a_0=1$ and $a_1\in\{\lfloor\frac{n}{\ln(2)}\rfloor,\lfloor\frac{n}{\ln(2)}\rfloor-1\}$, and since $\frac{x}{y}$ is a convergent of this continued fraction, $y>\frac{n}{\ln(2)}-1$. There are no solutions with $x^{n}<2^{64}$. It is also sufficient to only consider $n=4$ and odd primes, in FLT fashion.
Comment: For $n = 3$ this should follow from the fact that the Mordell-Weil group of the curve $x^3 - 2y^3 = 1$ over $\mathbb{Q}$ is of rank $0$.
Comment: For $n = 4$ it is also easy to see that there is no non-trivial solution, by writing the equation as $(x^2 + 1)(x^2-1)=2y^4$.
Answer: Delone (1930) and Nagell (1928) showed for any nonzero integer $d$ that the equation $x^3 - dy^3 = 1$ has at most one solution in integers $(x,y)$ besides $(1,0)$, with no constraint on the signs of $x$ and $y$.  In particular, since $x^3 - 2y^3 = 1$ has the integral solution $(-1,-1)$, there is no integral solution $(x,y)$ in positive integers.
This theorem was extended to exponent 4 by Ljunggren (1942) and
to exponent 5 and higher by Bennett (2001): for $n \geq 3$ and $d \not= 0$, the equation $|x^n - dy^n| = 1$ has at most one solution in positive integers. See Theorem 1.1 of https://www.math.ubc.ca/~bennett/B-Crelle2.pdf (which actually treats a slightly more general equation). In particular, $|x^n - 2y^n| = 1$ has at most one solution $(x,y)$ in positive integers.  Since $(x,y) = (1,1)$ fits, it is the only one. Of course $x^n - 2y^n = -1$ when $(x,y) = (1,1)$, so for $n \geq 3$ there is no solution to $x^n - 2y^n = 1$ when $x$ and $y$ are positive integers.
Answer: The case $n = 4$ and so $n$ even can be done by hand. Darmon and Merel proved (in 1997) the stronger statement that there aren't even any rational solutions to this equation for $n$ odd besides $(x^n,y^n) = (1,1)$, See their paper "Winding quotients and some variants of Fermat's last theorem," which can be found here:
http://www.math.mcgill.ca/darmon/pub/Articles/Research/18.Merel/paper.pdf


How to add Autocomplete to a Views Custom Textfield Filter

Question: I have created my own custom views filter handler which works perfectly with a simple textfield for the value form. However, I am unable to add autocomplete to that textfield (ie: the blue circle denoting autocomplete doesn't show up in the textfield and in the page source, autocomplete is not mentioned for that element).
What am I missing? Does Views re-write my value form somewhere as implied in Making text fields autocomplete in views exposed filters and if so, how do I plug into the after build within a custom filter handler class? (The question linked to involved altering an existing exposed form as opposed to creating a custom filter which I am.)
NOTE: I am using Drupal 7 and Views 3.
My Code
Here is my custom filter class:

/**
 * The Germplasm Genotyped views filter handler class (autocomplete textfield).
 */
class views_handler_filter_germplasm_genotyped_name extends views_handler_filter_string {

  /**
   * So that the value form is not inherited.
   */
  function value_form (&$form, &$form_state) {

        $form['value'] = array(
            '#type' => 'textfield',
            '#default_value' => $this->value,
            '#autocomplete' => 'tripal_ajax/nd_genotypes/genotyped_germplasm/name_to_id/Phaseolus/only'
        );

  }
}

I've defined my autocomplete in hook_menu():

  // Name autocomplete (display only the preferred organism -in path).
  $items['tripal_ajax/nd_genotypes/genotyped_germplasm/name_to_id/%/only'] = array(
    'page callback' => 'nd_genotypes_germplasm_name_to_id_callback',
    'page arguments' => array(4, FALSE),
    'access arguments' => array('access content'),
    'type' => MENU_CALLBACK
  );

And created my callback:

function nd_genotypes_germplasm_name_to_id_callback($organism_genus, $all_organisms, $string) {
  $matches = array();

  // custom table select
  $query = db_select('nd_genotype_germplasm', 'g')
    ->fields('g', array('name', 'genus'))
    ->condition('g.name', '%' . db_like($string) . '%', 'LIKE')
    ->condition('g.genus', $organism_genus, '=')
    ->orderBy('char_length(g.name)','ASC')
    ->orderBy('g.genus','ASC');
  $result = $query->execute();
  foreach ($result as $row) {
      $key = $row->name;
      if (!$all_organisms) {
        $matches[$key] = $row->name;
      }
      else {
        $matches[$key] = format_string(
          '@genus: @name',
          array(
            '@genus' => check_plain($row->genus),
            '@name' => check_plain($row->name),
          )
        );
      }
  }
  drupal_json_output($matches);
}

Testing I've done
I have tested the autocomplete callback directly by entering the path in my browser (ie: tripal_ajax/nd_genotypes/genotyped_germplasm/name_to_id/Cicer/only/CDC where "CDC" is the $string) and it works perfectly. By that I means it returns a json array outside my drupal theme with the elements I expect:

{
"CDC Xena 454 DNA Extraction": "CDC Xena 454 DNA Extraction",
"CDC Frontier 454 DNA Extraction": "CDC Frontier 454 DNA Extraction"
}

But as I said, my exposed fitler textfield in my view doesn't have autocomplete functionality. I know my value form is being executed because I can dpm() from within the handler and see it in my view, #autocomplete and all. However, when I look at the page source I see a plain textfield input with no autocomplete mentioned.
Note: Working autocomplete fields seem to have the class "form-autocomplete" on the input tag and an addition hidden input with the callback path and class "autocomplete autocomplete-processed".
Answer: So it turns out that I just had a small typo :( Anyway, I'm keeping this question up in case others are having troubles since it outlines completely how to do this and I was personally unable to find any tutorials.
In the above code it needs to be #autocomplete_path instead of #autocomplete.
Furthermore, if you are trying to create your own custom autocomplete filter, remember that you have to indicate the file containing your handler class in your .info file (ie: files[] = views/handlers/name_of_my_handler.inc) and that you need to assign your handler to a field using hook_views_data() or hook_views_data_alter().


Simulating a point pattern under Complete Spatial Randomness in R

Question: As per title, I am trying to figure out how to simulate such point pattern without the use of the 'spatstat' package (which I cannot install due to the old version of R which I am using, which in turn I cannot update due to the old OS I am currently using).
So, I am wondering if there is a viable workaround? I have performed a web search, but I have only found reference to 'spatstat'.
Answer: Since the resulting Poisson CSR is directly a function of the spatial domain being simulated the simulation envelope is critical, in this case the bounding polygon. The spatstat library not only has functionality for simulating CSR under various conditions but also provides object classes that facilitate this type of modeling. This would be very difficult for you to code from scratch and yield correct results. I am a spatial statistician and, often when coding spatial simulations, rely on the spatstat classes.
There should be backwards compatible versions of spatstat. Check the CRAN package archive, all of the previous versions of R libraries retained. The spatstat library has been around for some time and it is very doubtful that you will not be able to find a compatible version in the CRAN archive. Go to the CRAN website and on the left click on "packages", scroll down and click on "archive" then select your library and it will take you to all the previous versions of the package.
Answer: If you can install splancs you can do this, there's a function for random point patterns within a polygon defined by a simple loop of x,y coordinates.
Also, if you can install anything that can do point-in-polygon tests (which is how Splancs works) such as sp and rgeos, (or maybe gpclib) you can just generate points over the bounding box using runif and then clip them.


How can I use 24V DC input for Arduino digital pins?

Question: In this circuit, switches should be connected to 24V DC and arduino pins should check whether switches are on or off to control led behaviour. I don't know how to use 24VDC for this situation. I would be glad if someone can help. Thanks.
Comment: You have failed to actually state an answerable question... Typically to monitor higher voltages you use either resistive dividers or series resistors and diode (possibly zener)  clamps.   In extreme cases, optoisolators may be warranted.
Comment: Something simple like this should do https://electronics.stackexchange.com/a/320165/16051. There are plenty of question with respect to interfacing a microcontroller with higher input voltages.
Comment: Please post an actual schematic.
Comment: The photo you added doesn't help much, since we can't see where some of the wires go.
Comment: @Lundin I have added schematic. Right now vcc is connected to 5V but it should be 24V. I thought I can use optocoupler but couldn't figure out how to conenct them. I should find the optimum and safest solution. Thanks for attention.
Comment: @HandyHowie I have added schematic
Answer:
Where you currently have pull-down resistors, place a voltage divider with 2 resistors instead. For example something like 3k9 + 1k, to get close to 5V.
In case you are worried about the quality/level of the 24V (raw battery voltage etc), then first place a 33V TVS on it, then after the voltage divider, use one diode from ground to signal and one from signal to 5V, as shown here: How would I design a protection clipper circuit for ADC input?. Keep the forward voltage of the diodes in mind - if you pick a standard one with 0.7V then it won't be effective until you go > 5.7V which might be more than the MCU can handle. When in doubt, add a 10k current limiting resistor to the MCU pin.
All diodes in your schematic are drawn backwards. The triangle of a diode points to the cathode (-).


Is it ok to drive with the tire scraped like this?

Question: Hit a curb swerving to avoid getting hit. I'm paranoid about tires so feel free to tell my I'm being an idiot. I just got a new job with a huge pay cut and no paycheck for a few weeks so it's food or the tires but I'm definitely willing to eat the cost on a couple of tires if I need to. If I need new ones, does anyone know a rough estimate on how soon? Immediately?
Comment: Hi Ashley and welcome to the site.  Please don't worry about looking like an "idiot": we are here to support people who feel like they're out of their depth because cars aren't their hobby / profession.
Answer: At first glance, I'd say you're fine.  It looks like you hit the curb at a fairly shallow angle and abraded some of the rubber off the sidewall.  If there was real damage, I would expect to see more scraping on the edge of the wheel rim at the top of the picture.  Considering that you barely took the corner off one of the "f"s, I don't think this is a terminal issue.
My suggestion is that you watch that area for any bulging and keep an eye out for slow leaks.  If neither of those occur, you have a slightly less attractive tire (but didn't get hit!).
Comment: Thank you! I will definitely sleep better tonight :) I'll keep an eye on it for sure.
Comment: @Bob Cross, good answer, but you could consider moving that tyre to the rear as well.


Looking for a short story from old literature book about girl excited to meet "aliens" who are us

Question: This story was in one of my old middle school literature textbooks. I starts with a girl who along with the rest of her society is all excited to meet the aliens who have just made contact. The aliens finally land and the girl remarks right at the end that the aliens are similar to her but they only have hair on their heads instead of all over (the aliens are us).
Comment: i did read it, sorry can't remember the title. pretty sure it was a short story. in the same vain there is one where a worn out soldier recalls the war against the monstrous aliens (us) and one where the last pure human village kills off all mutant to preserve the geneticaly clean long tailed humain race.
Comment: This isn't it, but Isaac Asimov story "Youth" is very similar in some ways.
Answer: I believe this is "Zoo" by Edward D. Hoch.
The story first appeared in the June 1958 issue of Fantastic Universe. It can be read here.
The story begins with children and adults, boys and girls, men and women, excited for the aliens to arrive.

The children were always good during the month of August, especially
when it began to get near the twenty-third. It was on this day that
the great silver spaceship carrying Professor Hugo's Interplanetary
Zoo settled down for its annual six-hour visit to the Chicago area.
Before daybreak the crowds would form, long lines of children and
adults both, each one clutching his or her dollar, and waiting with
wonderment to see what race of strange creatures the Professor had
brought this year.

After everyone has seen the strange horse-spider aliens which look like horses, but run up walls like spiders, Professor Hugo and the aliens leave.

He waved farewell to them, and as the ship rose from the ground the
Earth peoples agreed that this had been the very best Zoo yet....

Later, having completed visits to various worlds, the aliens return to their home planet. A she-creature greets her returning mate and offspring. They tell her they enjoyed all the worlds they visited, one in particular.

The little one ran up the wall of the cave. "On the place called Earth
it was the best. The creatures there wear garments over their skins,
and they walk on two legs."
"But isn't it dangerous?" asked the she-creature.
"No," her mate answered. "There are bars to protect us from them. We
remain right in the ship. Next time you must come with us. It is well
worth the nineteen commocs it costs."
And the little one nodded. "It was the very best Zoo ever...."

Other than one easily misremembered specific detail, the alien child at the end mentions clothes instead of hair, this story matches the description.
This is one of Hoch's most reprinted stories. I recognized it right away, but the definitive clue for me is the fact that OP read it in a school textbook. That's how I first discovered the story back in the 1980s.
Here are two pages from the Edward D. Hoch Bibliography which shows the publication history for this particular story. It has been reprinted dozens of times, about half of which are in various school textbooks and educational material.
Comment: This story illustrates how, depending on perspective and point of view, we are just as bizarre to aliens as they are to us.

However, another thing struck me about this story which never seems to get mentioned or discussed.

The inhabitants of every world pay to see the aliens when they arrive, but the aliens also pay to make the trip.

My conclusion is Professor Hugo is quite the con man getting paid twice.

I wonder if this subtle detail was intentional on Hoch's part when he first wrote the story or if it's just my own twisted interpretation.


Torque and moment of inertia with bikes

Question: Can someboby please explain to me why it is better for a bicycle/ motor cycle to have lower center of mass when it rounds a turn.
What I could gather from the rule  I = mr2
Was that the arm is shorter so less moment of inertia but what does that have you do with doing a better turn
Answer: It is not helpful to consider the moment of inertia of the bike about its centre of rotation. All you need to consider are the forces on the cyclist/biker. The centripetal force from the friction of the tyre on the road $mv^2/r$, together with the inertia of the cyclist and bicycle form an overturning couple. (These can alternatively be considered as frictional reaction and centrifugal force respectively). This couple is balanced by the one from the weight and the vertical reaction (presuming the cyclist is leaning into the turn).
If the centre of gravity is lower, the overturning moment will be correspondingly less and that is preferable. However, it should be pointed out that, if the angle of lean is the same (and the velocity and radius of turn), the bicycle will be equally well balanced with a high C of G because both couples will increase by the same amount. However, the same cannot be said of a car, where resistance to overturning is maintained by the fixed horizontal distance between its centre of mass and the outer wheels, so there is no question that a low centre of mass is desirable for a car driving on a bend.

Torque and moment of inertia with bikes


Why do Hindu Gods carry weapons?

Question: I always wonder why Hindu Gods carry weapons. I mean they are "Gods", why do they need weapons?
Comment: Journalist and economist S.Gurumurthy once jokingly said that Hindus gave all their weapons to their gods and remained in peace while the Abrahamic God gave weapons into his poeple and they fight with each other.
Comment: They don't need weapons. However they carry them just to assure the worshiper that they are in control and will take care of everything. After all, in the initial stages of bhakti, the devotees worship God out of fear and need for protection, thus the form of the deity gives a sort of assurance and keeps the mind from fears.
Comment: See http://hinduism.stackexchange.com/questions/2609/what-is-the-significance-of-weapons
Comment: Related: http://hinduism.stackexchange.com/questions/2609/what-is-the-significance-of-weapons
Comment: Because they like fighting every time .... ;) Actually they hold powers and they can control the weapons and also reposnibilities are performed by them.
Comment: Gods with weapons are human concepts
Answer: First I feel the terminology of "God" is unsuitable. Unfortunately in English there is no proper translation of Devtā. Deity is closer.
In Hinduism devās are seen as friends and guides and hence human qualities were projected on them. This can be seen throughout the Rig Veda. Hinduism evolved from tribal roots and also assimilated tribal cultures into it. The deities are thus portrayed as how a human helper or a protector would be - with weapons.
The Rig Vedic people didn't worship in temples but did in fire altars. Given that temples were a later development, lots of metaphorical and philosophical ideas had developed behind the iconography.
In the book "Hindu Iconology - The study of the symbolism and meaning of Icons", Pandit Sri Rama Ramanuja Achari outlines the symbolic meanings behind many aspects of Hindu iconography.
Here are some of them:

For further information on Hindu iconography refer to this e-book.
Sometimes even the weapons themselves are given human form. For example Sudarshana Chakra is given anthropomorphic form and known as Chakkrath Azhwar in Tamil.
Comment: Yeah, it's definitely okay to cite the words of an Acharya on this site.  By the way, you should be wary of Rama Ramanujachari; he's a Sri Vaishnava Acharya, but his views are quite heterodox.  He calls his views "Metkalai", because he has disagreements with both Thenkalais and Vadakalais.  He doesn't even believe in the existence of Vaikuntha!  I wouldn't be surprised if he believed that Vishnu doesn't even have a physical form, and that it's all just symbolism.
Comment: It is up to you to take Ramanuja Achari's words or not. I would trust Aacharyas & Gurus. Hinduism is not a book based religion, so one needn't be too particular about finding a quote from the 'books' when an Aacharya has said it. Again this is just my opinion.

Why do Hindu Gods carry weapons?


Sony CDs and "Rootkit scandal"

Question: I recently bought a secondhand copy of a CD that was part of the Sony "Rootkit Scandal" in 2005. I assume it to be infected until proven otherwise. Am I safe to try to rip this on my PC with modern AV software to protect me?
Comment: Sweet, a vintage rootkit!
Answer: This software is installed automatically only when AutoRun is enabled. This was a security issue anyway and thus disabled on Windows XP, IIRC. In recent versions of Windows, you have to explicitly confirm that you want to run the AutoRun program, in the AutoPlay dialog. Please note that double-clicking on the drive in Explorer might also launch the program.
According to this guide, you also have to accept an EULA before the DRM rootkit is installed.
So it's rather unlikely this would still work today—unless you actively ignore all safety measures, of course.
Comment: Thank you for that @Daniel B. I thought the Autoplay pop-up would stop it from installing - but the Wiki page seems to suggest otherwise. According to that page, it also installs the rootkit even if you DON'T accept the EULA,
Comment: No, the AutoPlay popup *has* to stop it. While it may be a rootkit, it doesn't rely on any vulnerabilities to get started. Someone (AutoRun or the user) has to start the program.

Sony CDs and "Rootkit scandal"


How to make screenshot gallery from command line?

Question: I'm wondering if there is any command line tool to take clean and fast screenshot gallery of a video?
Comment: Check this http://askubuntu.com/questions/194427/what-is-the-terminal-command-to-take-a-screenshot
Comment: @devav2 I mean screenshot gallery of a video, so I guess `scrot` would not be useful for me.
Answer: Once you edited your question I can see what you wish is to extract some frames from a video in order to be used like a gallery of the contents of such video file. So we're going to use the ffmpeg command in order to do this job.
First of all we need to install ffmpeg which can be done by dropping this in a terminal:
sudo apt-get install ffmpeg
Once installed, make sure you are in the right directory in the terminal and once you have found your video file in the results of the ls command, write this in the terminal:
ffmpeg -i video.avi -r 0.5 -f image2 output_%05d.jpg
This will extract a frame from every 2 seconds, which you can adjust if first we explain/understand the parameters of this command as follows:

ffmpeg = Is the program which will do the conversion/extraction.
-i video.avi = Indicates the "input" file, can be an absolute or relative path
-r 0.5 = this indicates the framerate, which can be used to calculate how many frames are we going to use/skip in order to get the right
number of frames we need from the video.
-f image2 = a) -f "force format" b) image2 "Image file
demuxer" (let's read it as: force convert to image)
output_%05d.jpg = it the filename's pattern which be used in order
to drop images with sequential filenames with five trailing zeroes
so they will be perfectly arranged in a list.

Give this a try and you may wish to read more about the ffmpeg command options by using the ffmpeg --help command in a terminal or in the proper documentation webpage at https://ffmpeg.org/documentation.html
Good luck!
Comment: Well your command  takes very many photoshots and does not assemble them as I wished to make a `gallery`. A  much better command that I just found is this: `ffmpeg -ss 00:00:10 -i in.mp4 -frames 1 -vf "select=not(mod(n\,1000)),scale=320:240,tile=2x3" out.png`. What I miss in that is just to add title, filetype, resolution and size.
Answer: vcsi can do this. It is a command-line tool written in Python.
vcsi video.mkv -o output.jpg

Answer: This can be easily accomplished by using the command line mplayer, install this as follows:
sudo apt-get install mplayer

To generate screenshots manually while watching your video use the following syntax:
mplayer -vf screenshot file.mp4

While this running simply press the lower case 's' key to generate a screenshot. To generate multiple screen shots automatically simply press the upper case 'S' key and this will generate screenshots until you press 'S' again.
If you want a little more control of the output try something like the following:
mplayer -nosound -frames 5 -vo png:z=9 file.mp4

This will output the first 5 frames of the media file in high quality png format into the working directory. Similar screenshots can be taken by using jpeg, gif89a, targa and pnm as '-vo'.
References:

Top 10 Tricks and Tips for the svn MPlayer
Comment: Well, I want a screenshot GALLERY, that is, the shots should be taken at even timing from the WHOLE video. How to do that using mplayer command?
Comment: @wbad Lose the 'frames 5` option I gave: `mplayer -nosound -vo png:z=9 file.mp4`
Comment: This one takes ages, as it passes through all frames.
Comment: @wbad My suspicion is that your answer will come from either FFmpeg or MPlayer with FFmpeg being the better choice...


How to retain instance when orientation change while communicating with server

Question: in a fragment my app commuicating with webserver now iwant that when orientation changed the fragment retain its instance but its not happening i want every thing remain persistance during orientation changed how is it possible my code is
    @Override
public void onCreate(Bundle savedInstanceState)
{
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setRetainInstance(true);

}
 @Override
protected void onPreExecute()
{
    // TODO Auto-generated method stub
    super.onPreExecute();
    pDialog = new ProgressDialog(context,R.style.CustomDialogTheme);
    pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
       pDialog.setMessage("Processing...");
       pDialog.setCancelable(false);
        pDialog.show();
}
@Override
protected String  doInBackground(Object... params)
{
    // TODO Auto-generated method stub

    if(type.equals("register"))
    {

        /*String url="http://waqasbrosltd.co.uk/index.php/register";
        Network network=new Network();
        Gson gson = new Gson();
        String registerData=gson.toJson(user);
        try
        {
            answer=network.registerUser(url,registerData);
        }
        catch (ClientProtocolException e)
        {

        }
        catch (IOException e)
        {

        }
        finally
        {
            closeProgressDialog();
            closeDialogbox();

        }
    }*/

        return null;
}
public void closeProgressDialog()
{

    if (pDialog.isShowing())
    {
        pDialog.dismiss();
    }
}

 iwant my progress dialog also retain its instance but it notr retain

Comment: http://www.androiddesignpatterns.com/2013/04/retaining-objects-across-config-changes.html
Comment: This is not a configuration change issue, but rather using the worng pattern for handliung trancations.
Answer: In your project manifest.xml inside activity tag put this line
android:configChanges="keyboardHidden|orientation|screenSize"

for example:
     <activity
            android:name="com.example.MainActivity"
            android:label="@string/app_name" android:windowSoftInputMode="stateHidden" android:configChanges="keyboardHidden|orientation|screenSize">
    </activity>

and override this method in your activity

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        // TODO Auto-generated method stub
        super.onConfigurationChanged(newConfig);
    }

Hope this will help you.

Answer: When the orientation changes android will destroy all activities and fragments and recreates them again. This is helpful because it also handles resource changes for you. For example if you have different layout file for portrait and landscape mode it automatically switch them for you.
But you can easily stop this process by handling orientation change yourself. If you do so android will not destroy anything on orientation changes and everything will be persistence. If any resource changes is required you should do it yourself!
Watch this youtube video to see how to do it
https://www.youtube.com/watch?v=Y5J6BURMrHQ&list=PLonJJ3BVjZW6hYgvtkaWvwAVvOFB7fkLa
Answer: You need a Service. A Service is your way of telling Android that you wanna do something that is not UI-dependant.
The problem is not that your Activities are being destroyed, but rather that you rely on your Activities to handle your communication tasks. This approach is problematic in many other aspects other than orientation change, like when the OS decides to destroy your background Activity stacks when in need of resources.
Transactions need to be handled by a Service. It is a Context object that is not being destroyed by orientation changes, and also refrains Android from shutting down your process when in need of resources.
There is a great Google IO lecture about implementing REST architecture using an Activity, a database and a Server object.
Even if you don't implement the whole solution, you can learn a lot from how the lecture addresses this issue.


What is the derivative of $x\sin x$?

Question: Ok so I know the answer of $\frac{d}{dx}x\sin(x) = \sin(x)+ x\cos(x)$...but how exactly do you get there? I know $\frac{d}{dx} \sin{x} = \cos{x}$. But where does the additional $\sin(x)$ (in the answer) come in?
Comment: What's the product rule for the derivative?
Comment: Wolframalpha.com with "show steps" option will write out a derivation for this and many other routine problems.
Comment: http://en.wikipedia.org/wiki/Product_rule
Answer: A bit of intuition about the product rule:
Suppose that you have a rectangle whose height at time $t$ is $h(t)$ and whose width at time $t$ is $w(t)$. Then the area at time $t$ is $A(t)=h(t)w(t)$.  Now, as the time changes, how does the area change?

(Please, forgive my use of paint here.)
Say the white rectangle was from time $t$, and the larger rectangle at time $t+\Delta t$. We gain three new regions of area: the green one, the blue one, and the gray one.
The green area is $\Delta h\cdot w(t)$, where $\Delta h$ is the change in height from time $t$ to time $t+\Delta t$; the blue area is, similarly, $\Delta w\cdot h(t)$, and the gray area is $\Delta h\cdot\Delta w$. So, we have
$$
\Delta A=\Delta h\cdot w(t)+\Delta w\cdot h(t)+\Delta h\cdot\Delta w.
$$
Now, when $\Delta t$ is really small, we expect $\Delta h$ and $\Delta w$ to be really small as well; so, their product is tiny. Hence
$$
\Delta A\approx \Delta h\cdot w(t)+\Delta w\cdot h(t),
$$
or
$$
\frac{\Delta A}{\Delta t}\approx\frac{\Delta h}{\Delta t}\cdot w(t)+\frac{\Delta w}{\Delta t}\cdot h(t).
$$
Does this look at all like the product rule?  Letting $\Delta t\rightarrow0$, this approximation (properly formalized, of course) leads us to the formula
$$
\frac{d}{dt}\left[w(t)\cdot h(t)\right]=\frac{dA}{dt}=\frac{dh}{dt}\cdot w(t)+\frac{dw}{dt}\cdot h(t)
$$
Answer: Hint: Use the product rule for derivatives.
Alternately, proceed by definition, using trig properties (continuity, angle sum):
$$\begin{align}\frac{d}{dx}[x\sin x] &= \lim_{h\to 0}\frac{(x+h)\sin(x+h)-x\sin x}h\\ &= \lim_{h\to 0}\frac{h\sin(x+h)}h+x\lim_{h\to 0}\frac{\sin(x+h)-\sin x}h\\ &= \lim_{h\to 0}\sin(x+h)+x\lim_{h\to 0}\frac{\sin x\cos h+\sin h\cos x-\sin x}h\\ &= \sin x+x\cos x\lim_{h\to 0}\frac{\sin h}h+x\sin x\lim_{h\to 0}\frac{\cos h-1}h.\end{align}$$ It then remains to show that $\lim\limits_{h\to 0}\frac{\sin h}h=1$ and $\lim\limits_{h\to 0}\frac{\cos h-1}h=0,$ either as "special limits" or by some other means.
Comment: By the way $\frac{\cos h-1}{h}=\frac{(\cos h-1)(\cos h+1)}{h(\cos h+1)}=\frac{-\sin^2 h}{h(\cos h+1)}=\frac{-\sin h}{h}\frac{\sin h}{\cos h+1}\to 0$ as $h\to 0$. So  this limit folows from $\lim_{h\to 0}\frac{\sin h}{h}$.
Comment: explanation please?
Comment: Check out the link. Have you seen that rule before?
Comment: oh ok...i think i see. i use f'(x) = f(x)*d/dx g(x) + g(x)*d/dx f(x)?
Comment: Exactly. There are other ways to go, too. (Updating my answer now with one alternative.)
Answer: Depending on how familiar you are with the chain rule and derivative of logarithmic functions, you could differentiate $x \sin{x}$ using this alternate method that doesn't directly use the product rule,
$$\begin{align} y &= x \sin{x} \\
\ln(y) &= \ln( x \sin{x}) \\
\ln(y) &= \ln(x) + \ln(\sin{x}) \\
\frac{1}{y} \frac{dy}{dx} &= \frac{1}{x} + \frac{\cos{x}}{\sin{x}} \\
\frac{dy}{dx} &=  \left( \frac{1}{x} + \frac{\cos{x}}{\sin{x}} \right) \cdot y \\
\frac{dy}{dx} &=  \left( \frac{1}{x} + \frac{\cos{x}}{\sin{x}} \right) \cdot x \sin{x}\\
\frac{dy}{dx} &= \sin{x} + x \cos{x}. \\ \end{align}$$
Answer: You are probably expected to do this by the product rule, which says:
$(v \cdot w)'=vw'+v'w$
Setting $v=x$ and $w=\sin x$ (it doesn't matter which is which)
$v'=1$ and $w'=\cos x$ . Substituting into the formula:
$(v \cdot w)'=x \cos x+(1) \cdot \sin x$
$x \cos x+ \sin x$
which is your answer.
Answer: $x\sin(x)$ is the product of two functions. It's easier to see that there are two functions here if you rewrite components of the problem as $f(x)=x$ and $g(x)=\sin(x)$. If the two functions $f(x)$ and $g(x)$ are differentiable (the derivative exists), then their product is also differentiable.
Now apply the product rule: ${(fg)}' = {f}'g+f{g}'$ to get $x\cos(x)+\sin(x)$.

What is the derivative of $x\sin x$?


A question on non commutative ring or algebra

Question: Assume that $R$ is  a ring such that $R=I+J$ where $I$ and $J$ are 2 -sided ideal.(This  is  not a direct sum) If $I$ and $J$ are  commutative does it implies that $R$ is  a  commutative ring?  Please consider the same  question for $C^{*}$  algebra $A$. (In this question $R$ or $A$ can be unital or non unital) If the answer is  no, what is the counter example in the area of $C^{*}$  algebras?
Comment: See [here](http://arxiv.org/abs/1401.4675) for a modern reference of Ito's theorem for Lie algebras. $L=A+B$ is metabelian, but need not be abelian in general, if the subalgebras $A$ and $B$ are abelian. But you require that both are even ideals.
Comment: @DietrichBurde thank you very much for your comment. I googled Ito theorem but there is no a wikipedia link. What is the Ito theorem? Any way do you mean the answer to my question is "Yes" or "No", since  a  C* algebra is automatically a lie algebra?
Answer: A closed commutative ideal in a C$^*$-algebra is necessarily contained in the centre of the algebra (proof below). So if $A=I+J$ with $I,J$ commutative ideals, then $A$ is commutative as $A\subset Z(A)\subset A$, so $A=Z(A)$.
To show that a commutative ideal is central: let $x\in A$ and $y\in J^+$, where $J$ is a commutative ideal. Then $y=z^*z$, with $z\in J$ (as $J$ is a C$^*$-algebra). Then
$$
xy=xz^*z=(xz^*)z=z(xz^*)=(zx)z^*=z^*zx=yx.
$$
As the positive elements in $J$ span $J$, we get $xy=yx$ for all $x\in A$, $y\in J$.
Comment: thank you very much for your interesting answer.What about banch algebras/Is there a counter example?


reverting from Catalina to earlier OS

Question: I have a late 27" imac with a 3TB internal drive.
It currently is divided into three partitions.. one is running catalina, the second is a carbon copy of the first - the third is my music library.
I would like to revert back to the system before catalina - I just don't like it.
I understand that the partition holding the main startup system has been changed from HFS+ to something else , kinda dividing it into two.
I have plenty of external space, including the previous last-saved setup.
My questions are as follows...
Can I simply reformat the main partition into the previous setup and carbon copy my old saved setup.. and then use the Carbon Copy backup of the catalina system to boot from, ikn order to update prefs etc??
Do I need to reformat both partitions - or do I need to copy my music partition and just reformat the entire interior hard drive?
I AM franticly backing everything up as I go... but just need a little guidance on the "AFS to HFS+ thing...
Comment: You don't need to go back to HFS, Mojave wants to run on APFS too. Cloning from Catalina back to Mojave though is another thing entirely. Generally going 'downhill' is a whole whole lot tougher than cloning like to like. You'll probably get only 'documents'. Such as mail, apps & iTunes won't translate properly. You can try it, as you've a safety copy, but I don't hold much hope tbh.
Comment: You have to erase your Mac to go back, so I'll set aside all the format / etc. When you erase the Mac, follow Apple's steps and erase the entire drive - don't mess with partitions / volumes unless you have lots of time to learn. Do the sure thing is my advice. Also, don't be frantic backing up - you have time to plan this right - getting the backup correct now - complete now is your primary goal. Once that's done, you can experiment and learn.
Comment: Which OS was installed in the iMac initially? You can't go back to an earlier version, might be better to use a VM then
Answer: Going backwards from one OS to a previous will break most databases like Music, Photos, Contacts, Mail since the documents are stored in a database and the structure of those databased are changed in a migration. That migration is one way and unless someone (Apple or otherwise) writes a reverse migration script and tests it and releases / sells it, you have to do all that engineering work for every single type of data you care about.
What's easy is the following:

Erase your Mac and restore a backup from a time when the backup was on the older OS.
Erase your Mac and migrate only the apps from the new backup to the old backup. Uninstall / clean any that don't work - then migrate by hand the documents you care about.
Erase intall your Mac and hand migrate back your data, then install the apps you care about - referring to your backups as a guide if you can't just wait till you need an app, and install it. (seriously - you don't really need things you don't use daily - so don't migrate back a raft of cruft - just start using the new old OS is my best advice - human to human)
Use iCloud or another service to sync the data - data sync generally works across versions (say you have one Mac on Mojave and another on Catalina - Apple will happily sync photos / music / mail / contacts / reminders across both). Here, instead of having two computers - you have one sync complete - leave the data in the cloud, erase and then sync down the content to the same computer, older OS.

I'm going to stop here since the specifics of what you choose isn't a one-size-fits-all case. If you don't care about anything except files - you could move back pretty easily. If you care about database backed apps - then the list of the apps you care about dictates which operation is best for you.
I would make a good backup you trust now on Catalina - you will need it to try these above steps - and they may fail - you need to at least be able to get back to now to be free to experiment.
I use Time Machine - but the people that wrote and support Carbon Copy Cloner and Super Duper are beyond great. Read their support forums, pay them a tip if you can, many people will have asked about going back and their main answer will likely mirror mine - they are not designed to reverse a one way upgrade, but let's have them answer for their product capabilities.
Comment: I do realise that much will need to be transferred from the current catalina to a previous OS but luckily, I don't use the databases in music/iTunes, or photos... and i don't use apple mail.
My question is simply whether or not I have to erase the second partition on my internal drive, where i keep the carbon copy clone of the "main drive/partition... or can i keep it, and restart from it, in order to get prefs and such after I have erased the first catalina partition and installed mojave.. or some other earlier system.?
Comment: Wow, I missed you did the clone to the same drive. @mufngruf There's probably no reason you couldn't erase just the OS and Data partitions and leave the backup alone, the installer runs fine (heck I often run two os side by side, so if there's room you could make a Mojave container and install there before you erase Catalina. The only downside is 1) all your eggs are in one basket. 2) confusion or mistake on naming or selection.
Comment: thanks - f
Here's my plan...
I shall do an uptodate CCC to partition 2, from partition 1 (my current catalina startup system.)
I then propose to restart my computer, using this clone partition 2 and Carbon Copy a previous saved drive onto the partition.
Will doing so automatically then convert that partition back to HFS+ and allow for the copy to be installed - just like it once was and, having done that, will my computer boot into either drive partition .. using either system.. thus theoretically enabling me to simply copy over prefs and stuff?
I really do appreciate all your help.
tony

reverting from Catalina to earlier OS


Low light illumination on ceiling fan

Question: I have a 15 yr old Hampton Bay ceiling fan with light fixture and remote.  Worked well when we bought home for a few years but suddenly the bulbs in the 3 bulb fixture are extremely dim. The bulbs have the small screw in base and are only 60w bulbs.. I removed the light fixture and tested the 2 wires (white and black) protruding down from the ceiling fan and it showed 48v.
I know very little about electricity and voltage.  The fan works fine.  Needing some professional advice please!
Comment: What type of lightbulbs are you using in the fixture? (incandescent, LED, CFL)
Comment: Hello, and welcome to Home Improvement. We'll need more info before we can help (e.g. a picture of the inside of the wiring box). And, props for [taking our tour] before posting; few newbies do.
Answer: There are voltage limiters in ceiling fans these are to prevent people from installing lamps that are a higher wattage than the fixture is listed for and overheating the fixture.
They were first mandated around 05 so this may be your issue.
It looks like a black square and has 2-3 wires as these fail they do get dimmer or go completely out.
I looked some up last week on amazon around 8$ for a replacement a 3 wire can replace a 2 wire but you have to connect the white to the neutral the 2wire is a direct replacement if you have a 2 wire but both are available the 3 wire last longer.

Low light illumination on ceiling fan


Vimeo force CC language

Question: Trying to embed a Vimeo video into my website and I have put about 5 different languages into the CC of the video on Vimeo. However I don't want the user to have to change their language in the CC drop down in the Vimeo embed, I would like to assign it in HTML/JavaScript (using geolocation to select their base language) then they can change their CC language accordingly once the video has started playing.
Comment: see this issue: https://github.com/vimeo/player.js/issues/692
Answer: You can use the enableTextTrack function on a player initialized by the JS API provided by Vimeo:
// Select with the DOM API
var iframe = document.querySelector('iframe');
var iframePlayer = new Vimeo.Player(iframe);

player.enableTextTrack('en').then(function(track) {
    // track.language = the iso code for the language
    // track.kind = 'captions' or 'subtitles'
    // track.label = the human-readable label
}).catch(function(error) {
    switch (error.name) {
        case 'InvalidTrackLanguageError':
            // no track was available with the specified language
            break;

        case 'InvalidTrackError':
            // no track was available with the specified language and kind
            break;

        default:
            // some other error occurred
            break;
    }
});

More information on the github of Vimeo player JS API: https://github.com/vimeo/player.js#enabletexttracklanguage-string-kind-string-promiseobject-invalidtracklanguageerrorinvalidtrackerrorerror
Answer: We don't have this yet, but we do plan on offering some way to do it with an embed parameter and through the JavaScript API in the future.

Vimeo force CC language