Common Javascript alerts methods

So here are some common javascript message alerts methods (common texts, variable values and lengths) widely used for testing and debugging.

There are also some useful methods with displaying alerts on condition and with returning values.

// Common javascript alert methods
var C = {
    A: function (AlertMessage) {
    alert(AlertMessage);
},
Av: function (AlertMessage, AlertValue) {
    alert(AlertMessage + " = " + AlertValue);
},
Ar: function (ReturnValue, AlertMessage) {
    alert(AlertMessage);
    return ReturnValue;
},
Al: function (AlertMessage, AlertValueLength) {
    alert(AlertMessage + " = " + AlertValueLength.length);
},
Ai: function (AlertOnTrueCondition, AlertMessage, AlertValue) {
    if (!AlertOnTrueCondition)
        return;

    if (AlertValue !== undefined)
        alert(AlertMessage + " = " + AlertValue);
    else
        alert(AlertMessage);
}
};

Usage is very simple :

C.A("My test message");  // alert message
C.Al("My val length", MyVal);  // display MyVal length
C.Av("My val value", MyVal);  // display MyVal value
return C.Ar(MyVal, "My Test message");  //  display message and return MyVal

Rotation and common absolute coordinate system

Got an interesting observation a couple of days earlier, could you please comment it or point to some mistake.

As everyone knows, there are lots of stars in our universe.
Stars are in common just big amounts of self-gravitating collapsed spheres of hot gas and plasma.

If this kind of sphere is rotating, then its rotation can be measured by its poles collapse. It means we can easily make a photo of it, calculate difference between equatorial and polar radiuses and get its rotation speed.

So a rotation of any star can be easily detected.
This rotation is measured relative to some kind of absolute inertial non-rotating coordinate system, same for all stars.

Since a rotation can be detected, then a simple line movement can be detected also (just speed, correlated with rotation of a closest star).

That means that there is a common absolute inertial coordinate system (a kind of a base one), in which every star is rotating.

But getting this special base system is not common to physics and it is a little bit confusing to me.

Is there really that kind of special absolute coordinate system, or it is just some logical paradox type of stuff ?

For more discussions on this topic – take a look at stack physics

Variable spectrum common visors/cameras

I guess almost everyone knows about the really small area of electromagnetic spectrum that humans are able to see.

Well, it is just not fair :-).

Why there is still no multi spectral (means with variable spectrum) visors available on the market ?
The idea is to get an predefined by device settings spectrum area (can be changed at any time by user) and map it to common RGB palette in order to visualize all the spectrum.

Are there any unsolved technological problems or restrictions with that ?
What areas of spectrum are still difficult/unavailable to observe ?

As far as I understand this kind of device is quite simple and is just a simple modification of common cell phone camera (so it is cheap for mass production).

No doubt, this kind of device will reveal a lot of great hidden info on EM interactions from the world that will be easy to observe in dynamics and will be quite useful for lots of people in all areas from science to applications. I guess it will be a revolution in technics/biology related areas or natural sciences (and also a good device to common use).

For more discussions on this topic – take a look at stack physics

Piezoelectric electrogenerating footwear

There is an another fun useful application of the piezoelectrical phenomena.

Lets take a look at common shoes. They commonly use elastic soles for a dumping moving effect during walking/running.

Imagine the same shoes, but with piezoelectric elements on its sole (just same as in the piezoelectric lighter) with the ability to produce charge at any type of tension – compression or stretching.

Along with dumping effect they will produce a lot of electricity when moving, which can be gathered and collected lets say in attached accumulator and used for example for charging phones and devices, lighting, etc.

For more discussions on this topic – take a look at stack physics

Piezoelectric car tires

There is an another fun useful application of the piezoelectrical phenomena.

Lets take a look at modern car tires. They commonly use gas pressure to achieve elastic behavior for a car moving along the road.

Imagine the same wheels, but with piezoelectric elements (just same as in the piezoelectric lighter) with the ability to produce charge at any type of tension – compression or stretching.

Along with dumping effect they will produce a lot of electricity when riding (in any direction), which can be gathered and collected lets say in accumulator.

And if a car is using an electrical power source engine, these feature will let the generators to be charged continuously during the ride and make electrical powered vehicles even much more economical.

For more discussions on this topic – take a look at stack physics

Static piezoelectric truss farm structures with gravity support reaction

This post is about some fun cases of static piezoelectric structures.

Lets imagine some static large tall truss farm structure (like transmitter towers).

Also lets say it is axisymmetric and heavy enough to create high loads on lower levels.

Lets attach to deformable trusses a special piezoelectric elements (just same as in the piezolighters) with the ability to create electric charge at both compression and stretching. They are all wired to some electric grid.

Additionally lets install some wind stopping load on the top of this installation (let it be some large cube).

Since the structure is axisimmetrical and is loaded by wind randomly, so all the trusses with piezoelements will experience random cycles of
compression and stretching.

With each cycle they will produce some electric charge which can be gathered and collected in attached electric grid.

So in general we can get an infinitely scalable power generating structure, just increasing the weight of structure and number of piezoelements.

Does that means it is a kind of almost infinite energy source, based on gravity and the forces of support reaction from planet surface ? Is it a conversion of gravity to energy, or just something else ?

Also lets imagine a planet/satellite (like Moon or Mars for example) and built in very large structures on it like these ones, generating power and sending it to some remote location. What about the law of energy conservation ? Where the energy is taken and what will happen to that planet in time – will it slow on its orbital movement or something ?

I guess there is some kind of logic/physical paradox in these ideas, but just can’t find any obvious mistakes in it. Could you please comment it ?

For more discussions on this topic – take a look at stack physics

Common javascript for web pages

Here goes some basic Javascripts common web pages scripts to run methods on document ready and window loaded with try catch condition and optional on error message display (for debugging scripts).

These scripts use common methods from Jquery.min library for maximum cross browser functionality.

// Common javascript web pages
var C = {
    T: function (MethodToTryCatch, CustomErrorMessage) {
        if (MethodToTryCatch === undefined)
            return;

        try {
            return MethodToTryCatch();
        }
        catch (e) {
            if (CustomErrorMessage !== undefined)
                alert("Error (" + CustomErrorMessage + ") : " + e);
        }
    },
    R: function (MethodToStartOnDocumentReady, CustomErrorMessage) {
        if (MethodToStartOnDocumentReady === undefined)
            return;

        $(document).ready(function () {
            try {
                return MethodToStartOnDocumentReady();
            }
            catch (e) {
                if (CustomErrorMessage !== undefined)
                    alert("Error (" + CustomErrorMessage + ") : " + e);
            }
        });
    },
    L: function (MethodToStartOnWindowLoad, CustomErrorMessage) {
        if (MethodToStartOnWindowLoad === undefined)
            return;

        $(window).load(function () {
            try {
                return MethodToStartOnWindowLoad();
            }
            catch (e) {
                if (CustomErrorMessage !== undefined)
                    alert("Error (" + CustomErrorMessage + ") : " + e);
            }
        });
    }
};

Usage is very simple :

C.R(function () {
    // Run MyCustomFunction on document ready
    MyCustomFunction();
});

C.L(function () {
    // Run My Custom code on window loaded
    // My Custom code .... 
});