what's the point of java constructor?

Question: So I'm learning java. I'm one month in and I just learned about constructors. But I don't see the whole purpose of creating one. Why and when would I ever want to use one? I get the whole idea that it does not have a main method and you can call a constructor from your main class. Anyone can enlighten me on this topic, it would help me a great deal.
Comment: Constructors let you do initialization and set values on members of an object, and they create an instance of a class. Have you read this part of the tutorial? http://download.oracle.com/javase/tutorial/java/javaOO/constructors.html
Answer: Constructors are what you use to initialize/set up the instances of your classes.
If you have an object that needs some processing before it is usable (initializing members for instance), you should do that in the constructor.
Ideally, you should never have "partially built" objects (i.e. objects that are "live", that you hold a reference to, but that are not yet usable). Without constructors, you'd be permanently creating partially built objects, and that is very error-prone. (Theory and practice don't always match, but keep that idea in mind.)
Answer: You use a constructor to create new objects. Yes, you can write Java just using static methods - but then you're really not writing object-oriented code, and you'll have a hard time using much of the standard library, either.
Most of your time you should be working with and thinking in terms of objects - and they need to be constructed before they can be used... and that's where constructors come in. They create an object, often with parameters specifying the initial state or other important information about the object.
To be honest, it's probably not worth worrying about them just yet, if you don't see the point yet. It's likely that as you learn more, you'll naturally start using objects more (maybe collections to start with, for example) and you'll get the hang of it. Rest assured, it is important to have constructors in Java, but I'm sure you'll understand why in the course of time. (Of course, if this answer has helped you to appreciate their value already, I'm glad - but if not, don't worry :)
Answer: It might seem as if you're having trouble understanding the basic concepts of objects and object-oriented programming. An explanation by example; This class represents a type of thing, namely a car:
public class Car{

    // Licence plate number. This is private, so it can
    // not be accessed directly from outside the class.
    private String hiddenRegNr = "";
    private static String description = "This is a car".

    // The constructor, which sets the value of hiddenRegNr
    public Car(String regNr){
        hiddenRegNr = regNr;
    }

    // Method for reading hiddenRegNr, the only
    // way to access it after instantiation.
    public String getRegNr(){
        return hiddenRegNr;
    }

    // A static method. Can be used withouth instantiation.
    public static String getDesc(){
        return description;
    }
}

From some other class, you could call this class, and make instances of it; actual representations of different cars. They represent different cars, but are based on the same "model", i.e., the class Car.
Car myFirstCar = new Car("SR12345");
Car myOtherCar = new Car("XZ54321");

Now you have two different cars, with two different registration numbers. These are independent instances of the type car. They exist in memory, and may contain different values (in this case, different registration numbers).
myFirstCar.getRegNr(); // Will return SR12345
mySecondCar.getRegNr(); // will return xz54321

The first thing to notice here, is that you can only specify the registration number once per car, namely upon creation. That is the point of the constructor: It sets values, and does other stuff that needs to be done when objects (instances) are created.
Now, note the difference between getRegNr() and getDesc(): The keyword "Static" means that the second method is related directly to the class, and not to each instance. This means that:

Calls to getDesc() is made on the class, not an instance:
Car.getDesc();
Calls to getDesc() will return the same value for all instances of the class car
The variable description (which is also static) will be the same for all instances of Car
The static method getDesc() CAN NOT access the variable hiddenRegNr, since that variable is related to a specific instance. Trying to refer to a variable in an instance from a static context (such as getDesc()) will cause an exception to be thrown. You might say that hiddenRegNr will not have been set when you call
Car.getDesc();

because the constructor was never called, so it was never given any value.
Answer: It is used to create objects. Objects are the main concept in OOP, so creating them is an important step. The main class method is just an entry point to your program. If you don't create objects your program will be procedural rather than object-oriented. This is why to use a constructor.
And why to create a constructor - sometimes you need to construct an object with some required parameters. There is also a default no-argument constructor, but if you want to initialize your object with additional arguments - you create a constructor taking those arguments.
Comment: @EJP you are not right. You don't need to write a constructor but there is always one by default, and you must use it
Comment: Doesn't answer the question. You don't need to write a constructor to get any of that.
Comment: Nitpick: *someone* must use it.  You could just call `getNewObject()` and get back an object without *personally* calling any constructors.  But `getNewObject` will probably have to new up an object at some point, at which point it will automagically call one of the constructors.
Comment: @Bozho You have just agreed with me that you don't need to write a constructor. So we are both correct, and that includes me, or else we are both wrong, and that includes you. The question here is why would you 'create' a constructor, and you haven't answered it.
Comment: @EJP I seeboth the word 'use', and 'eate' in the question. I'll update
Answer: Constructors are used to initialize a class and give parameters to a class.  What is important is that they let you set the class state on creation.  This allows you to use specific instances of a class with different data field values instead of relying on purely static information.  Take the following example:
class Obj {
  private int state = 0;

  public Obj(int state) {
     this.state = state;
  }

  public Obj() {
     state = 1;
  }
}

Now in main (or wherever) you can have:
Obj obj1 = new Obj();
Obj obj2 = new Obj(2);

The two objects have different states (one is at state 1, the other is at state 2).  If you were relying on static methods and members, the objects would share one state and would not be independent of each other.
It is also important to note that constructors (specifically the new keyword) allocate memory for a given object internally so you don't have to worry about using malloc and other memory management.  So they are important in that sense as well.
Answer: Actually constructor is needed IF you need to assign unique initial state to an instance of a class. In Java i only just realized (by a friend) that we can do this:
public class MyClass1 {
     private class MyClass2 {}
     private MyClass2 myobj2 = new MyClass2();
}

So no need for implicit constructor.
But if something like follows, you need constructor.
public class MyClass1 {
     private class MyClass2 {
         private int id_ = 0;
         public MyClass2(int id) { id_ = id; }    // how to reach this?
     }

     private MyClass2 myobj2 = new MyClass2(1);   // (this doesn't work. Not unique)

     public MyClass1(int id)     { myobj2 = new MyClass2(id); }   // by this!
}
MyClass1 obj1 = new MyClass1(100);
MyClass1 obj2 = new MyClass1(200);

Answer: I will give you an example, imagine you have a car class.. when you call the constructor of the car class you have an car object. on this car object is possible to use diffent methods. And you could create as many as car objects as you want.
Comment: Doesn't answer the question. You don't need to write a constructor to get any of that.

what's the point of java constructor?


Opening a subset of bookmarks in a Bookmark Folder

Question: I imported my bookmark folders from Chrome, which I now hate.  How can I open a subset of bookmarks in a folder, but NOT ALL bookmarks in the folder, each in a NEW tab.  I am using Safari 7.1.5 and OS X 10.9.5
Answer: Which ever way you look through the Bookmarks in Safari, it will offer you the option a sub menu to "open In Tabs"
Example: From the Bookmarks menu bar.
Answer: Break your tabs down into smaller sets using the Bookmarks sidebar.
You can add folders, move content etc.
Answer: I do not believe this is possible with Safari. Even opening the Bookmark Editor, where you can select multiple bookmarks at once, gets rid of your selection when you right-click and only chooses the bookmark under your cursor to interact with.
You would need to sort your bookmarks manually into the chunks of tabs that you want to open, each in its own folder.


GFCI Tripping after 15 years

Question: I have a 15 year old house, with a GFI in the basement, yesterday when I came home I found that it had tripped. I took everything off of the circuit and reset it. Within a couple of minutes it tripped again. Why is this happening?
Comment: GFCI's will fail eventually. If it was installed 15 years ago it probably needs to be replaced.
Answer: There are essentially two possible reasons:

There is a ground fault in the wiring/fixtures/appliances it's protecting
The GFCI itself is faulty

It really depends on what's on the circuit to determine if there is a fault somewhere. 15 year old wiring is likely to not be a huge issue. There could be water in a junction box. Simple receptacles and switches aren't too likely to have issues (though it wouldn't hurt to open them to take a look at the connections), but anything with active electronics in it (dimmers, USB chargers, etc) could definitely be the cause. Same goes for other fixtures -- lights, ceiling fans, etc.
You could replace the GFCI and see if it still happens -- if so, there's definitely a fault. If you don't have another GFCI already, this is a somewhat expensive way to test (though if it's fault, you'll have to buy one anyway).
If you happen to have another one you could swap in, that would be a cheap and easy way to test. Swap two, see if it still trips and if the same breaker trips, or the same circuit trips the new breaker.

GFCI Tripping after 15 years


What does 許しを乞い mean?

Question: What does 許しを乞い mean? And especially what's the role of 乞い here?
The full phrase is: まさか、また許しを乞いに参ったのではありますまいな!?
Comment: That is 鯉. This is a conjugation of 乞う (also 請う).
Comment: The problem is in meaning of koi - in dictionary that means 'fish', but it may also have another meaning.
Answer: 「[乞]{こ}い」 is the [連用形]{れんようけい} (continuative form) of the verb 「乞う」.  It has absolutely nothing to do with "carp" the fish.  「乞い」 is a verb and it needs to be in that conjugation form in order to connect with the following word (another verb) 「[参]{まい}った」.
「[許]{ゆる}しを乞う」 is a set phrase meaning "to beg forgiveness".
The 「に」 here means "in order to".
"Surely, you didn't come here to beg forgiveness again, did you?"

What does 許しを乞い mean?


Is the Canon 24-105mm f/4 lens weather sealed?

Question: I know most of the Canon L series lenses are weather sealed but is the Canon 24-105mm f/4 L IS USM lens a good lens for shooting in the rain?
Comment: I would recommend a reading of: [What makes a camera 'weather sealed'?](http://photo.stackexchange.com/questions/41432/what-makes-a-camera-weather-sealed) ; in which I also answer what makes a lens weather sealed. Spoiler - No lenses are _that_ sealed!
Answer: I've used the EF 24-105mm f/4 L IS for short periods in light to medium rain with no ill effects before. Mine has also survived collisions with football players, bumps from working in a dense crowd, and the occasional 'soft' drop from a foot or two. The thing is built like a tank.
But, as AJ Henderson points out in his answer, it is also a lens with variable internal volume as the lens is zoomed in or out. Some folks refer to such a lens as a "dust pump" because the lens must allow air, as well as the dust and moisture in the air, to vent in and out as the internal volume of the lens changes. Also, although there is a rubber O-ring where the inner barrel slides in and out of the main barrel, it is not an impenetrable barrier.
Having said that, I wouldn't use any of my "L" glass in a downpour or rain of any intensity for long periods of time without using a rain cover of some type. Weather sealed is not the same thing as waterproof!
Roger Cicala's comments re:weather sealing such as the one dpollitt cites in this answer are one reason I wouldn't trust any of my lenses in an environment where they are getting wet faster than the water can run off them. A plastic bag and some gaffer's tape are very cheap, very easy to stash in your camera bag, and very easy to use when needed.

Update since I wrote this answer almost 3 years ago:
I've now had the "opportunity" to use this lens unprotected in heavy rain for short periods as well as for extended periods in light to moderate rain. This lens doesn't let water inside as long as the water can run off of it as fast as it is falling onto it. Ideally when I am shooting in adverse weather I wrap my gear in plastic covers, but in those instances when bad weather broke out unexpectedly and my bag might have been stored halfway across a stadium or in the equipment truck I've had no damage from water to my EF 24-105mm f/4 IS.
Answer: According to the information provided by Canon, the 25-105mm F/4L is weather-sealed, that is why we use the umbrella icon in its specification page. Some Canon lenses require a screw-on filter to complete the seal but this is not one of them.
The exact wording from Canon is:

Tight seal structure ensures excellent dust-proof and drip-proof performance.

This should be enough for downpoors when used with an equally weatherproof camera.
Comment: Hey Michael, I wouldn't question Itai's travel experience or conditions he's shot in. He's done it before. Period.
Comment: @dpollitt And Roger Cicala's comments re:weather sealing such as the one you cite in this answer http://photo.stackexchange.com/a/41445/15871 are one reason I wouldn't trust any of my lenses in an environment where they are getting wet faster than the water can run off them. A plastic bag and some gaffer's tape are very cheap, very easy to stash in your camera bag, and very easy to use when needed.
Comment: Drip proof is one thing, but a downpour that allows water to pool in certain spots, such as the well for the *AF/M* switch, faster than it can drain is another thing entirely. By 'downpour' I'm referring to hurricane/typhoon type conditions that can dump several inches of rain in just a few minutes. If you've never been in such a tropical storm then what you consider a 'downpour' is likely not the same thing.
Comment: @dpollitt I'm not questioning his experience, just whether we share the same definition of 'downpour', especially since he is from a part of the world where English is not the primary language for most residents. Sometimes the meaning of words can be lost in translation.
Answer: As a non-fixed volume lens, the amount of weather sealing that is possible is limited.  As Itai mentioned, it uses the verbiage that it is dust and drip proof which is not quite as good as their fixed volume lenses which are generally weather proof.
Is it going to have much problem in all but the harshest conditions, probably not.  My 24-70f/2.8 II falls under similar level of weather sealing and I've never had any issues, however I'd avoid extended downpour usage with lenses that are not fixed volume as they will suck in outside air (and some of the moisture involved) when actuating the zoom or focus (thus changing the internal volume).
It's also worth noting that you need to have a weather sealed camera body as the back side of lenses are not generally sealed, but rather rely on the sealing of the camera body.  The level of weather sealing for a rig is based on the level of weather sealing of ALL components.  If you have a battery grip that isn't weather sealed, the entire rig can be compromised by that one component because it will allow moisture in to the camera body and from there into the lens.
Comment: The last paragraph seems misleading. Weather sealed lenses typically *do* have a rubber gasket at the mount. I suppose it's possible that a body that's not sealed might have a mount that doesn't mate properly against that gasket, but the main reason you need a weather-sealed body is that water could enter the body directly around the buttons, dials, etc.
Comment: @Caleb - it's not misleading.  The gasket is designed to form a seal against the body and will do that regardless of the body.  My point was that the back end of the lens (inside where the gasket is) is not designed to prevent moisture entering the lens.  If the body isn't weather sealed as well, moisture can enter the lens from the body itself.


How to crop drawing to path

Question: I've been using Inkscape for a while, but I'm trying to remove everything covered by the red circles retaining only the blue curves in this drawing [. The blue curves and the red circles are grouped objects. Nothing I have tried (eraser tool, cut path, ...) gives me what I want. All suggestions welcome!
Thanks
Answer:
Ungroup everything several times to make sure there are no groups left. Boolean operations require two paths to work on. They won't work properly with multiple paths or groups of multiple paths/objects.

Select the blue circles and do Path > Combine. This makes a single combined path. Make sure this path is at the bottom of the stack by hitting the Lower to Bottom button in the controls bar  or use the shortcut End. The path you want to cut needs to be at the bottom of the stack.

Select the red circles, and do Path > Combine, to create the second combined path

Select and copy Ctrl+C the red circles

Select everything and do Path > Cut Path. This will consume the red circles, and cut all the blue circles at the line intersections.

Do Edit > Paste > In Place to bring back the red circles temporarily to act as a guide for selecting in the next step

Using the Selector Tool S, hold down Alt and click and drag to draw the red selector line over all the pieces you want to delete, avoiding the blue lines you want to keep.

Hit Delete, select and delete any remaining pieces you missed.

Example showing steps 7 and 8
Comment: Thanks for your help. I had some issues with step 7, but managed to delete unwanted stuff manually. Ill explore a bit more and try the Julius Krumbiegel extension that Dabid Cau suggested below.
Answer: Two additional ideas, based on the same principle : after ungrouping :

select one blue circle and use right clic > select same > stroke color and do path > combine.
select one pink circle and right clic : select same > stroke color and do path> union.
lower blue path to bottom and select blue path and pink filled path and run this interesting extension from Julius Krumbiegel. This will avoid selecting and removing unwanted bits after path > cut path.
Comment: Unable to get the "Cut and remove by shape" extension to actually do anything. The second step produced a rather nice path however.
Comment: It worked fine for me. did you actually select both blue and pink path and ensure pink path was atop blue one before running the extension ?
Comment: The extension produced error messages: Traceback (most recent call last):
  File "/home/jsibert/.config/inkscape/extensions/cut_and_remove_by_shape.py", line 278, in
    CutAndRemoveByShapeExtension().run()
  File "/usr/share/inkscape/extensions/inkex/base.py", line 131, in run
    self.save_raw(self.effect())
  File "/home/jsibert/.config/inkscape/extensions/cut_and_remove_by_shape.py", line 106, in effect
    inkex.command.inkscape(self.options.input_file, actions=actions)
AttributeError: module 'inkex' has no attribute 'command'

How to crop drawing to path


is there any mention of gem stones in puranas?

Question: In puranas or vedas, is there any information about gem stones?
Do people of that time used to wear these kinds of stones for the betterment of their life?
Answer: Yes , Gemstones  very amply are discussed in Hinduism scriptures. Especially the Puranas  we find very detail description of the gemstones. For example Garuda Purana  Achar Kanda , chapter 68  ( Agastya Samhita ) Description of te origin of the gems in the treaties of Ratna Pariksha (test of gems ) by Holy Agastya  -
mentions some of the valuable gemstones , states How to Test genuineness of gems  , the rules to wear them etc.
These are some of the gemstones mentioned -  1) Padmaraga -2) Emerald -3) Indranila -4) Vaidurya – 5) Pusparaga -6) Diamond the Pearl -7) Karketana – 8) Pulaka -8) Rudhiraktya (blood stone)- 9) Crystal -10)  Coral.

वज्रं मुक्तमणय: सपद्मरागा: समरकता: प्रोक्ता : |  अपि
  चेन्द्रनीलमणिवरवैदुर्या: पुष्करागाश्च: || ९ ||  कर्केतनं सपुलकं
  रुधिराख्यसमन्वित तथा स्फटिकम् |  विद्रुममणिश्च यत्नादुद्दिष्टं
  संग्रहे तज्ज्ञनये ||१०||
Gems such as Padmaraga , the Emerald , the Indranila and Vaidurya the
  Pusparaga , the Diamond the pearl , the Karketana , the Pulaka
  Rudhiraktya (blood stone) the crystal and coral should be carefully
  collected. Subject to the advice to the experts on the subject.

In the same chapter we find following description -:

तेषु रक्षोविषव्यालव्याधिध्नान्यघहानि च |  प्रदुर्भवान्ति रत्नानि
  तथैव विगुणानि च ||८||
Of the gems and the precious stones , some are endured with the
  virtues of expiating all sins or of acting as a prophylactic against
  the effect of poison , snake bytes and diseases , while there are
  others which are possessed of contrary virtues.

प्रथमं गुणसंपदाभ्युपेतं प्रतिबद्भं |  समुपैति यच्चदोषम् ||
  अलमाभरणेन तस्य राज्ञ्नो गुणहीsपि मणिर्न भुषणाय ||४२||
Diamonds are prohibited as articles of female wear , as they are
  possessed of the Mystic Virtues and making them sterile and Unhappy.

So its clear that gems posses mystic powers and  people of that time used to wear these kinds of stones for the betterment of their life .
Answer: The Vedas itself mention using gemstones for increasing strength, vigour etc. The Atharva Veda has many suktas dedicated to gemstones and gem therapy. I am giving below few mantras from few of those suktas.
AV 19.46

O man , Prajapatih the master of house hold binds on you, this
  invincible stone at first for might and vigour. I the physician bind
  on you for long life, splendour, energy and strength. Let this
  invincible one protect you.

AV 8.5 :

This mani is the sign of killing enemies, this is a mark of good
  heroism, this is the sign of victory, this is the sign of strength,
  conquest and might. Let this succeed ruining the enemies.
The king decorated with this mani destroys the assailant, the
  enlightened statesman decorated with it inflicts defeats to anti
  social and anti national elements: decorated with this the king
  becomes victorious over earth and heaven both; he maintains with this
  his supremacy in four regions.

And, there are many other suktas in Atharva Veda Samhita that talk about manis or gemstones. Few among them are 19.31, 8.5, 4.20 , 19.28 etc.
So, yes people must be wearing gemstones from very ancient times.
Abbreviations:
AV 19.46 ---> Atharva Veda Samhita KAnda 19, Sukta 46.
Answer:
The History of Indian Gemology:
The cultures of the Indian subcontinent have studied gemstones for millennia, and many ancient texts detail the medicinal, spiritual, and supernatural powers of various gems. Evidence, dating as far back as 5,000 years ago.
The Vedas, the oldest Indian scriptures, contain several references for the use of gems in ceremonial rituals and everyday life. They describe the powers of precious stones to influence subtle energies and connect the Earth to the rest of the universe. Because precious stones were closely associated with the gods, they had the power to heal and influence destiny.
According to ancient Indian texts, sapphires were grouped onto four 'varnas' or classes. Hindus were only allowed to wear sapphires with the color designated for their caste. The Brahmins' stone was whitish blue, the Kshatriyas' was a reddish blue, the Vaishyas' was yellowish blue, and the Sudras' was a dark or blackish blue. Nine astrological gemstones are associated with these Nine planets in our Solar system.

Study Of Stones and Usage in Puranas:

Gemology or the scientific and ethnic study of gemstones is an important and integral part of applied astrology. Use of precious gems and stones has been an ancient practice in India. Scriptural evidences however show that concept of gemology is as old as the creation itself.

A very famous hymn says:

SASHANKH CHAKRAM SAKIRIT KUNDALAM,
SAPEET VASTRAM SARASI RUNEKSHANAM ||
SAHAR VAKSH STHAL KAUSTUBHASHRIYAM,
NAMAMI VISHNUM SIRASA CHATURBHUJAM ||
Apart from many kinds of weapons, Lord Vishnu bears Kaustubha Mani (a gem named Kaustubh) on his chest. This gem is most dear to Him. This hymn shows that even before the whole universe came into being, Lord Vishnu did have an existence and the gem Kaustubh also existed along with Him. During medieval period also, various scholars shed light on the science of gemology. They authored many great scriptures as well. Acharya Varahmihir was the most prominent of those great scholars. A scripture Vrihat Samhita written by Varahmihir still has a wide recognition among the gemologists. It has a whole chapter, Ratnadhyay devoted to the comprehensive description of the gemstones. Among Puranas, Agnipurana contains exhaustive description about gemology.

GEM:

A gem is something that has been dug out from earth or deep sea and has many rare but miraculous qualities. A gem is unique and often rare because of its specific composition. It may differ in effects, colour, tinge and hues.

JEWEL:

In Puranas people use to wear Jewels, Jewel is an ornament or piece of jewelry containing precious Gem stones. They too have their distinct appearance, beauty, hues and effects and are important accordingly. Their uses are also wide and varied such as personal beautification, adornment, house building, idol construction, exhibition of wealth and luxury etc.

According to mythology, jewels found in heaven are- Kaustubh Mani, Chinta Mani,  Syamantak Mani, Rudra Mani.

1) Kaustubh Mani: It has a deep blue colour like a blue lotus and a radiance equal to the sun. According to Hindu mythology, Lord Vishnu wears Kaustubh Mani in a garland on his chest. It is a powerful jewel and bestows fortune, luxuries as well as invincibility on to its wearer besides extremely beautiful and imposing.
2) Chinta Mani: Name of this jewel is self-explicit. The wearer is freed from all the worries and fretting. It is white in colour and has a brilliant hue. It gives its wearer all kinds of wealth and comforts.
3) Syamantak Mani: It is a common belief that this jewel adorns the necklace of Lord Surya (the sun god). It is said to have a brilliant blue hue that instantaneously blinds the onlooker. If it is taken in darkness, it fills the ambience with day-like light. There is an interesting tale related to this jewel.
4) Rudra Mani: Nobody will be unaware of the bounty of Lord Shiva. His costumes as well as ornaments are strange. He wears only tiger's skin and formidable black snakes around his shoulder. The gods presented Lord Shiva with a jewel that came to be known as Rudra Mani. Lord Shiva threadened the jewel among the beads of His rosary. The jewel Rudra Mani is also benevolent in virtues.
Thus, according to Hindu mythology, only four jewels come in the category of heavenly jewels.

According to Garuda Purana: Vedic View of Gems (http://www.agt-gems.com/mysticarticles/flawless.html)
Answer: Garuda Purana describes about important gemstones :
Vajra - Diamond
Mukta – Moti
PadmaRaag – Ruby
Markat Mani – Emerald
IndraneelMani (IndraNeelam) – Blue Sapphire
Vaidooryam Mani – Cat's Eye
PushpraagMani – Yellow Sapphire
According to Vishnu Purana and Shrimad Bhagwat Mahapurana, Bali, the grandson of Prahlad was a great king of the demons. With a resolution of dethroning Indra as the king of heaven, Bali organized a hundred Ashwamedha Yagyas. On the appeal of Indra, Lord Vishnu decided to stop the hundredth Ashwamedha Yagya of Bali and arrived there in the guise of Vamana (a dwarf Brahmin) and begged him to donate land measuring three steps. In two steps, Lord measures entire earth and heaven. Since there was not room than to put the third step, Bali offered his head for the Lord to put his third step. Thus, Lord Vishnu sent Bali direct to the Paatal & offered him to rule the Whole nether World. With the touch of the Lord's foot, Bali's earthly body converted into Gem stones.
Bali body parts converted into different kinds of minerals and felt all over at different landmasses, sea, and mountains.
Vajra or Heera or Diamond: It originated from the pieces of Bali's brain.
There are different kinds of diamonds on basis of colors like Green, white, yellow, black, purple, pink, brown. These colored diamonds contain impurities that cause their color. A pure diamond that contains very fewer impurities is often transparent.
According to Garuda Purana, diamonds with crack or a broken diamond, which contains spot in center and opaque, are not favorable to be used as a gemstone since they bring bad luck and misfortunes to the wearer. Diamond is a stone of planet Venus. There are many shreds of evidence in the history that shows the diamond have positive and adverse effects on humans. Manu diamonds like Kohinoor, Cullinan, King Oiroff are very famous in human history. As per Vedic astrology, people with Ascendant house Aries should wear coral, those with Ascendant house Taurus should wear diamond. It will be beneficial for the people with Taurus as their ascendant house to wear diamond. People with Ascendant house Aries should not wear diamond and emerald. Many experts forbid even blue sapphire for these people. But they believe that if the position of Saturn is strong in the horoscope, such people can safely wear blue sapphire.
Diamond, blue sapphire, and pearl are strictly forbidden for the people with Leo as the ascendant house.
Read complete article GEMSTONES: GARUDA PURANA AND GEMSTONES
Comment: You can quote verses from Puranas for reliable quality of the answer.


Will we have a list of tags to choose from or will we allow our members to tag as they please?

Question: I am of the opinion that we should create a designated list of tags that can be used.  And of course, at the same time, leave the possibility of further enhancing our tag inventory to discussion here at the meta.
Comment: Good idea. Any thoughts on how to proceed?
Comment: Or should all users be able to create tags throughout the private beta and that list be weeded and codified later?
Comment: http://genealogy.stackexchange.com/tags ::sigh:: I should read more carefully the headers on a given page...
Answer: When entering or editing tags, the system will help by auto-completing suggestions based on what you've typed and the selection of tags in the system.
Creating a new tag is a privilege that is given based on earning reputation:
https://genealogy.stackexchange.com/privileges/create-tags
During the private beta, this privilege (and several others) are set to 1 reputation so that all users can use them to help facilitate building the community and the initial content of the site.
During the public beta of a site (which generally happens after a week or two), the reputation needed for various privileges will be raised.  This also happens farther down the road when sites graduate.
Requiring rep to create new tags encourages the use of existing tags.  As the site continues to grow its content, the need for a new tag will not be as necessary.  And of course, when a new tag is necessary, users that have earned the privilege and moderators can edit questions to include the appropriate tag.


(How) can a smart contract mint a token that it does not own?

Question: I have the supply key of the token but it has no admin key so I cannot change its ownership and make it owned by the smart contract.
Answer: In most cases, a smart contract cannot mint tokens it does not own, unless it has explicit permissions. Token minting is typically restricted to the contract owner or authorized addresses. If a token contract lacks an admin key, standard minting functions won't be available. However, custom functionalities or permissions may allow external contracts to mint under specific conditions.
Answer: If the Token is an ERC-20 token, its mint function would be "internal" and can be called by the token contract itself, our any child contract that inherited from the token contract. See the following code:
<code>function _mint(address account, uint256 value) internal {
    if (account == address(0)) {
        revert ERC20InvalidReceiver(address(0));
    }
    _update(address(0), account, value);
}
</code>
So if you write a minter smart contract and inherit that from token contract, you must be able to call mint function of token.
see below link to see code samples:
HederaTokenService.sol


Why should we study all the three forms of representation of finite automata?

Question: DFA, NFA and epsilon NFA all the three allow us to represent a particular regular language. With any of those representations we can arrive to the same regular expression, then why do we need to study all the three form of representation of finite automata? There can some explanation on what NFA can do which DFA cannot , that is NFA might help us in designing uncertainties. For example in designing a game (chess), we have many options to move a particular piece from a particular location which can be easily represented using NFA. But what is the use of epsilon NFA when the same can done using NFA or DFA?
Comment: @wvxvw, the algorithm for translating a regular expression into a NFA uses $\epsilon$ transitions in a very natural way. They are not "only for proofs", they are quite natural in a non-deterministic setting.
Comment: There are more than three. These are just the ones typically found in textbooks. Epsilon transitions are useful for proving theorems, but I'm not sure I've seen them used in models for their own sake.
Answer: Add regular grammars for a fourth. There are others...
Part of the interest in DFA + NFA is that they are simple computation models, with NFA (and $\epsilon$-NFA) examples of nondeterminism (a crucial idea for more elaborate models). To prove DFA and NFA accept the same set of languages is also exploring a very important phenomenon in a simple, understandable setting.
Regular expressions (and also regular grammars) are completely different formalisms, that happen to describe the same set of languages. Again, the proof of this fact explores important cross-relations, and are an example that formalisms might look very diffent, be based on radically dissimilar concepts, but describe the same languages. Again, in a rather simple setting.
For "real world" use, you can start with a regular expression and get a minimal DFA for high-performance searching. Digital circuits are essentially DFAs, understanding them is central in computer engineering. Last but not least, often systems can be modelled as "being in a state" and "moving to another one" on external stimuli, even if the system is very far from a real DFA viewing it this way might help understanding it.
Added later: As noted by Raphael, it may be more efficient to interpret an NFA directly for searching, because creating a DFA can be expensive, and an NFA may be much smaller.
Comment: "There are others" -- dozens....
Comment: You may want to mention that NFA can be useful (if DFA are the only alternatice) because they can be a lot smaller, but using one to check if a word is accepted is not too much more expensive.
Answer: there are a wide variety of reasons to study the different forms/ correspondences of DFAs vs NFAs. here are a few selected highlights some from advanced complexity theory.

NFAs are a interesting model for "parallel computation". one can regard the advancement of states through the NFA as a parallel version of DFA computation. so DFA vs NFA computations reflect some of the distinction of sequential vs parallel computation. by comparing both contexts it also helps to study the inherent algorithmic complexity of problems.
NFAs are often used in regular expression matching systems (quite ubiquitous across languages esp modern ones spawned in the unix era), which typically allow descriptions of regular expressions that are converted to NFAs, and then possibly converted to DFAs to aid with more efficient searching.
there are quite a few open problems that remain in the areas and they are often studied based on the DFA/ NFA correspondence. see eg are there any open problems left on DFAs (cstheory stackexchange). somewhat amazingly, some of them are tied up with very deep areas of CS including the P vs NP problem ie intersection nonemptiness of DFAs. also another open area is eg computing the minimal NFA for a DFA.
also for some related insight see this semifamous/ highvoted question on cstheory.se: What is the enlightenment I'm supposed to attain after studying finite automata?
there are very diverse applications of DFAs vs NFAs and the correspondence between the two is often exploited in them. string pattern matching is mentioned above, but DFA/NFA constructions are used often in (automated) speech recognition. see eg this highly cited paper: Weighted Finite-State Transducers in
Speech Recognition / Mohri, Pereira, Riley
Answer: DFAs has a easier implementation than NFA since their next state is determined by a function and NFAs help a user to easily express what they want as an output, because the NFA can choose between multiple paths.
and epsilon-NFA is an extension of NFA where transitions can be done without taking any input symbols.
Comment: summarizing: NFAs convey the idea of non-determinism, which is a very profound idea (its "inventors", Michael O. Rabin and
Dana S. Scott, won the Turing award for these ideas)
Answer: There is a nasty thing about the number of states of DFAs. It explodes, sometimes.
In short, if the number of states is simply too high (still finite but we live in a physical world.), then you have to increase the level of abstraction to cope with the complexity in expense of some slowdown. The other models, like NFAs and AFAs, are to provide more succinct ways to represent regular languages.


Topology software

Question: I've been studying topology lately and my teacher showed us some animations which were very very pretty. I'm interested in a freeware (possibly open-source) software that can deal with surfaces, I'm especially interested in polygons with identifications. By which I mean that I'd love to have a software that would render the surface given by a certain identification of edges of a polygon, but I wasn't able to find one, I'd appreciate anything that could get me started.
Answer: This is only indirectly related to what you asked for, but Jeff Weeks has some interesting topology / geometry software over at GeometryGames.org. You haven't played billiards until you've tried playing it on a hyperbolic surface...
Comment: yes, I've actually been to that site and I enjoyed it a lot. :D
Answer: It's not downloadable software but this paper describes an algorithm:
Automatic visualization of two-dimensional cellular complexes
R. M. Rosi, C. F. X. de Mendonça, L. P. Lozada, and J. Stolfi.
Proceedings of Graph Drawing '96, 303--317, Lecture Notes in Computer Science 1190; September 1996.
http://dx.doi.org/10.1007/3-540-62495-3_56
http://www.ic.unicamp.br/~stolfi/EXPORT/papers/by-tag/ros-men-loz-sto-96-vis.ps.gz
Comment: thanks! That was a really interesting read, except that I don't have the programming ability to implement such things :)
Answer: On http://www.win.tue.nl/~vanwijk/seifertview/ you can download a program that draws Seifert Surfaces (oriented 2-manifold which are bounded by a link or a knot).

Topology software


Is it true that $76^n=76\pmod{100}$ for all $n>0$?

Question: Note
$76^2=5776,$
$76^3=438976,$
$76^4=33362176,$
$76^5=2535525376,$
$$\cdots$$
Hence I guess that
$$76^n = 76 \pmod{100} $$
for any natural number $n$.
Is it correct?
And are there other numbers that have this property?
Comment: Hint: $\;76^n - 76 =76\cdot(76^{n-1}-1) = 4 \cdot 19 \cdot (76-1)(\cdots) = 300 \,\cdot\, (\cdots)\,$.
Comment: Oh, @fleablood, I meant that $25^n\equiv25\pmod{100}$
Comment: How about $25$?
Comment: trivial: 0, 1, the smallest: 25
Comment: Are you aware that if $a \equiv k \mod n$ and $b \equiv m  \mod n$ then $ab \equiv km\mod n$?  So $76^k=  76^{k-2}*76^2 \equiv 76^{k-2}*76=76^{k-1} =76^{k-3}*76^2\equiv 76^{k-3}*76 = 76^{k-2}=...... \mod 100$.
Comment: @Lubin what *about* 25?  $76^{25} \equiv 76 \mod 100$.
Comment: Please read the Wikipedia article [Automorphic number](https://en.wikipedia.org/wiki/Automorphic_number) for many details.
Comment: https://math.stackexchange.com/questions/706773/the-square-of-a-numbers-last-few-digits-remain-the-same
Answer: This is true because $76^{2}\equiv 76 \left(\mathrm{mod}\,100\right)$. For other examples, you have to find $1\leq a\leq 99$ with $a^{2}\equiv a\left(\mathrm{mod}\,100\right)$, i.e. $a(a-1)$ is multiple of 4 and 25. This is true when
$$
\begin{cases}
a\equiv 0, 1 \,(\mathrm{mod}4) \\ a\equiv 0, 1\,(\mathrm{mod}25)
\end{cases}
$$
since $a$ and $a-1$ is coprime. Hence we have 4 cases $$a\equiv 0, 1, 25, 76.$$
Answer: Not so long ago, I was chewed up for giving an unsatisfactory treatment of this, but I'll try again:
The $10$-adic numbers, $\Bbb Z_{10}$, have a natural decomposition,
$$
\Bbb Z_{10}\>\cong\>\Bbb Z_2\oplus\Bbb Z_5\,,
$$
those are the $2$-adic numbers and the $5$-adic numbers. When you recognize that $\Bbb Z_{10}=\projlim_n(\Bbb Z/10^n\Bbb Z)$, just as $\Bbb Z_2=\projlim_n(\Bbb Z/2^n\Bbb Z)$ and $\Bbb Z_5=\projlim_n(\Bbb Z/5^n\Bbb Z)$, as well as the importance of Chinese Remainder Theorem, which says that $\Bbb Z/10^n\Bbb Z\cong(\Bbb Z/2^n\Bbb Z)\oplus(\Bbb Z/5^n\Bbb Z)$, it all falls out.
Skip the abstract stuff: there are $10$-adic numbers,
$$
E_2=\dots8212890625;\quad\text{and}\quad E_5=\dots1787109376;\,,
$$
which correspond to the quantities $1\oplus0$ and $0\oplus1$, respectively, in $\Bbb Z_2\oplus\Bbb Z_5$. Naturally $E_2^2=E_2$ and $E_5^2=E_5$: just try $90625^2$ and $9376^2$ to see that the results have last five digits $90625$ and $09376$, respectively.
Notice here that the last two digits of $E_2$ are $\equiv1\pmod{2^2}$ but $\equiv0\pmod{5^2}$. Same for the last six digits of $E_2$: congruent to $1$ modulo $2^6$ but divisible by $5^6$. Corresponding facts hold for $E_5$, as well as for any number of digits.
Finally, notice that as $10$-adic numbers, $E_2E_5=0$ while $E_2+E_5=1$, as is necessary if they really are the orthogonal idempotents in a direct sum of two rings.
Answer: It follows by induction:
If $a^2 \equiv a \mod n$ then $a^k \equiv a \mod n$ for all natural numbers $k$.
Pf:  Base case:  $a^1 \equiv a \mod n$.
Inductive step: If $a^n \equiv a \mod n$ then $a^{n+1} =a^n*a\equiv a*a=a^2 \equiv a \mod n$.
Even if $a^2 \not \equiv a \mod n$ but if you have instead $a^{m+1}\equiv a \mod n$ then $a^{km +1}\equiv a \mod n$ for all $k$.
example $51^2=2601 \equiv 1 \mod 100$ and $51^3 =132651\equiv 51 \mod 100$ so $51^{1 + 2k} \equiv 51 \mod 100$.
====
To find out if there are others we need $(10a + b)^2 = 100a + 20ab + b^2$ to end with $10a + b$.
Only $0, 1, 5,6$ when squared will end with itself.
$(10a + 0)^2 = 100a^2$ will end with $00$ so $0$ is one such number.
$(10a + 1)^2 = 100a^2 + 20a + 1$ so we need $20a$ to end with $a$ so $a = 0$ and $1$ is another such number.
$(10a + 5)^2 = 100a^2 + 100a + 25$ so we need $a=2$ and so $25$ is another such number.
Finally $(10a + 6)^2 = 100a^2 + 120a + 36$ so we need $2a + 3$ to end with $a$.
If $a = 0,1,2,3,4,5,6,7,8,9$ then $2a + 3 = 3,5,7,9,11,13,15,17,19,21$.  Only $2*7 + 3 = 17$ will end with $a$.  So $76$ is the last such number.
$0,1,25$ and $76$ are the only such numbers.
Answer: Note that:
$$100n+m\equiv m\ (\mathrm{mod}100)$$
You know:
$$76*76=76^2=5776\equiv76(\mathrm{mod}100)$$
So for any integer $n$, we have:
$$(100n+76)*76\equiv76(\mathrm{mod}100)$$
Then the answer comes.
Answer: Just note that for all $a$, $a \equiv a^2 \equiv \cdots (\mod 1000)$ iff $a^2 \equiv a(\mod 1000)$.
Since $1000 | 76^2-76$, the conculusion followes.


apache2,php and mysql - facing problem in editing the files and loading them in browser

Question: friends, I have installed apache2 , php and mysql but now the problem is I don't know where to write the programs and put them back into the server folder so that I can access them back.My file i.e html and php file should be place in /var/www folder but when I try to create new document I'm not able to create it it's showing access denied. Please help me....
Comment: possible duplicate of [Where to place my local website starting with the 2.4.7 version of apache2?](http://askubuntu.com/questions/448944/where-to-place-my-local-website-starting-with-the-2-4-7-version-of-apache2)
Answer: If you are not allowed access to a file, precede the command you are typing with sudo, this should prompt you for your password. The sudo command basically means "superuser do". So you have privileges of the root user when you use it. Example: sudo vi index.html.
Hope that sorts that part of the problem out for you.
Answer: The easiest way is to add your user to the group that owns /var/www/, usually www-data
Check the group of /var/www
ls -la /var/ | grep www

where the output will be something like
drwxrwxr-x  3 www-data www-data 4096 ago  1 16:10 www

on my output the second www-data position indicates the group is actually www-data
so now you have to add yourself to that group
sudo usermod -a -G www-data yourUserName

ensure that users belong to www-data can write to that dir
sudo chmod -R 0775 /var/www/

Logout and login again to refresh permissions. Now you should be able to write with your user on that under that dir.
Note : if the group is different from www-data, you should check which group is running apache and makes changes according to it
grep GROUP /etc/apache2/envvars

The output is something like this
export APACHE_RUN_GROUP=www-data
To change the ownership of /www/data use
sudo chown -R useOwner:groupOwner /var/www/


Are the times on questions deliberately or accidentally imprecise?

Question: I just noticed that the times on comments did not square off with the other info on the site.  I took a screen capture (for a different reason), but the times in the comments showed that "tchrist" made a comment "4 mins ago", while his profile stated that he was "last seen 6 mins ago".  Is this a bug or is there a general guideline stating that these times should not be relied on to construct any kind of precise timeline?
Comment: I've always found "Last seen" to be approximate at best. Coupled with that, I *suspect* that commenting is not recorded as "last seen" because comments are ephemeral and not treated as substantive. Let's test that...
Comment: Yup. My "last seen" hasn't changed (still shows 6 minutes ago, four or five minutes before the previous comment). I might write an answer on that basis, if someone else doesn't get in first.
Comment: This takes working *behind the scenes* to a new level. :P
Answer: According to Shog9, "last seen" is only updated every 15 minutes and thus is not as accurate as other timestamps (e.g. post and comment timestamps):

The "last seen" date is only updated every n minutes, where n was 15 the last time I bothered to check.
So when this time is recorded, it won't be updated again for at least another 15 minutes, no matter how many times the user accesses the site during this period.

Note that a precise value for "last seen" is no longer shown on other users' profiles (except as a moderator). Anyone who just visited the site will be shown as "last seen this week". (The network profile will show a little bit more detail — "last seen today".) It's also vague with other timeframes. For example, looking at OP's meta profile, I see a specific date in 2019 since I am a moderator. But when I am logged out, I see "Last seen more than 3 years ago".
The timestamps shown elsewhere (on questions, answers, comments, etc.) are accurate, though rounded. The timeline of a post (under the vote icons) will show you the exact timestamp, especially if you hit "toggle format". You can also hover over various rounded dates to get this information.
Answer: The last seen is inaccurate intentionally, as mentioned in Laurel's answer.
The timestamps on comments, questions, answers are precise. For recently posted ones, the time will be shown as x mins/secs/hours ago, as seen in your screenshot, and when you hold your mouse pointer over it, you'll see the UTC timestamp: 2017-10-20 21:44:42Z.
Comment: @EnglishStudent If you're signed in and browsing the site, you're online, and your _last seen_ will reflect that. Your last question or answer may have been posted a century ago and it wouldn't matter.
Comment: I always wondered what 'last seen' really means. Thanks for the clarification @NVZ.
Comment: I have seen 1 or 2 cases on different SE sites where the system says  a user was last seen yesterday but their *last post* was few years ago! Is that weird or what?
Comment: @EnglishStudent I don't see how that's weird. One can be online without posting anything.
Comment: For years? And these were active users with many posts 3 years ago but certainly rare and not typical on SE.


Is application virtualization only for standalone applications?

Question: Does application virtualization mean virtualizing only stand-alone desktop applications and executables? Or does it also cover virtualizing webapps and web servers? Can Citrix's XenApp and VMware's ThinApp virtualize web applications and web servers?
Answer: "
WebSphere XD provides application virtualization for a heterogeneous IT environment managing and optimizing a wide range of application servers including WebSphere, Apache, BEA WebLogic, JBoss, and Oracle application servers. WebSphere XD supports many operating systems, including AIX, HP-UX, Linux, Sun Solaris, Windows, and z/OS.
"
Thus, WebSphere seems to be able to virtualize Apache.
Here ( http://planetlotus.org/profiles/john-willemse_47627 ) the author states that it is possible to "Run any version of virtually any application".


Can i omit commas in sentence with multiple verbs connected by て-form (with "and" meaning)?

Question: For example, I have sentence: 朝ご飯を食べて、学校に行きました。
Can I omit the comma or it is required?
Answer: You can omit it, but reading and understanding will become much harder. Therefore, I am recommending using comma. Furthermore ~て has multiple meanings. In written Japanese 「朝ご飯を食べ、学校に行きました」would be used, because this Verb-form has only one meaning "and" and is easier to understand.
Comment: Thanks for explanation! :)


ORACLE TABLESPACE USERS GETS 100% USED

Question: I am facing a problem with oracles users tablespace. It automatically grows really fast. What kind of data is stored there? And what happens when it hits 100% of space used? Is there a solution to reduce the amount of data in this tablespace? At the moment we have 11 MB free of total 33 GB. Is it a good idea to delete it and how to do it? Thanks.
Comment: "*What kind of data is stored there*" - anything you insert into tables which are using that tablespace. "*Is there a solution to reduce the amount of data in this tablespace?*" - yes, don't insert that many rows
Comment: Scary question. Do you have an Oracle DBA at work you can talk to?
Comment: @Philᵀᴹ You are not really helpful. It is like commenting on some question on Stackoverflow with something like "sorry, kid, do you know any programmer you can talk to?"
Answer: I would say that some or all of your application data is likely stored in the USERS tablespace. Don't do anything rash.
IIRC databases created by the dbca utility have USERS set as the default tablespace. This means that any new users created will store their tables etc. in USERS by default.
select * from dba_segments where tablespace_name = 'USERS' will give you a starting-point for seeing what is in the tablespace. (It could be a long list.)
select * from dba_users where default_tablespace = 'USERS' will show you the schema owners which will store their data in USERS by default.
I suggest that you don't see it as a problem to be solved, but accept that USERS is where the data is stored, and plan for controlled future growth of the tablespace. I have seen a couple of applications which had been installed like this.
HTH
Answer: You should really drill into who has data there and what kind of data is there. Using an aggregate query will yield better results. Rather than selecting every segment in dba_segments this will tell you how much data each user has in the USERS tablespace and which objects are the largest. You might want to take some of the larger objects and put them in a separate tablespace. You should also query the dba_tables view and see if pctincrease is not null and larger than 0. If it is then the object with pctincrease set higher than 0 are going to grow at a faster rate. For example if you have a table or tablespace with pctincrease set to 100, the segment size will double every time a new segment is created. That could be a problem.
SELECT owner, TO_CHAR( SUM( bytes )/1024/1024, '999,999,999' ) mb FROM dba_segments WHERE tablespace_name = 'USERS' GROUP BY owner ORDER BY SUM( bytes );

SELECT owner, object_type, TO_CHAR( SUM( bytes )/1024/1024, '999,999,999' ) mb FROM dba_segments WHERE tablespace_name = 'USERS' GROUP BY owner, object_type ORDER BY SUM( bytes );

ORACLE TABLESPACE USERS GETS 100% USED


Does changing a .shp on ArcGIS desktop update the published ArcGIS Online map?

Question: I have a shapefile on ArcGIS for desktop that contains a few thousand points. I also recently published this shapefile to a new map on ArcGIS online. After working with the map for a while, I realized that some of the points are currently gone now, and there are some points that don't exist that I need to add. Can I somehow edit the shapefile on the desktop and then update the published map online? Or is the only way to change them both to individually edit each of them?
Answer: To change your ArcGIS Online (AGOL) service you will need to change your desktop .shp then upload again to AGOL.  Making changes to the .shp with ArcGIS for Desktop does not apply changes directly to a service unless you publish the service as a feature service to your ArcGIS for Server and add it as web service in AGOL.
Answer: You can set up a feature class in geodatabase in ArcSDE that keeps the two in sync. When you update the feature class in ArcMap, it updates on the published service once you refresh the map service.
Here's an ESRI tutorial on how to get a map service up and running:
http://server.arcgis.com/en/server/latest/get-started/windows/tutorial-publishing-a-map-service.htm
And see the "Publish from ArcMap" section of this tutorial:
https://doc.arcgis.com/en/arcgis-online/share-maps/publish-features.htm


Visual Studio Publish stuck at Adding ACL's for path

Question: I'm trying to publish an web application but it's stuck for the last 10 minutes at Adding ACL's for path. I have no clue why it's stuck there, I published multiple times without a problem.
Answer: I had the same problem and it turns out, that the web application that I deployed had accumulated lots of user-specific directories and files in a custom directory for uploads / report files / etc. Visual Studio checks and updates the ACLs for every file and directory and that is why it takes so long if there are many of them.
Check for directories with a huge amount of user-generated content or other content with lots of files and check if you can safely delete them (for example if those files are only created temporarily - like it had been the case here).
After cleaning up the directory on the web server the deployment is almost instant for incremental updates, which have been very slow before the cleanup process.
Comment: This is very similar to an issue I'm having. In my case, the files are important and I can't delete them. Do you know if there is any way to tell msdeploy certain directories to simply ignore?
Comment: @LelandRichardson I haven't checked but maybe you found an answer here http://stackoverflow.com/questions/12576662/msdeploy-skip-rules-when-using-msbuild-publishprofile-with-visual-studio-2012
Comment: I spend few hours trying to debug this stupid thing, trying to see if someone was messing around with build definitions, with build server, with permissions etc. And at the end, look at that...just few extra files that crashes everything... Thank you for your answer.
Answer: It seems you have too many files and it takes to much time. I resolved same issue by adding following line to .pubxml file.
<IncludeSetACLProviderOnDestination>False</IncludeSetACLProviderOnDestination>

Comment: You should elaborate on tradeoffs when ACLs are not set. How will the published site be different with this setting? Are additional compensation staps reuquired after publish?
Comment: Ref the above comment: https://blog.winhost.com/how-to-stop-web-deploymsbuild-from-skewing-server-permissions/
Answer: First of all unload your project (Right click on project and find unload project)
And then open your .pubxml file and add
<IncludeSetACLProviderOnDestination>False</IncludeSetACLProviderOnDestination>

under
 <PropertyGroup>

which should look like
<?xml version="1.0" encoding="utf-8"?>

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <IncludeSetACLProviderOnDestination>False</IncludeSetACLProviderOnDestination>


What is causing a ticking noise in my electrical outlets?

Question: Several electrical outlets in two rooms started making a ticking sound last fall. I checked the receptacles and tightened the wires on two of them and replaced two of the receptacles. The circuit breakers to the rooms don't trip and the outlets still work without affecting the devices plugged into them. Also, the ticking increases when the furnace turns off and it repeats only a few times after that until the furnace, again, turns off. I did have a master electrician check the outlets, but he found nothing. My neighbor, who is a journeyman, told me it could be a sign of a breaker going bad -  he also told me to get a different electrician. Any suggestions?
Comment: Does it make the ticking sound when the breaker is turned off? What about if the furnace is turned off? Sounds like it may just be expanding/contracting pipes/ducts from your heating system.
Comment: No electrical box should tick and if they do, then there's probably something else doing the ticking.  Assume for a second it is the receptacle, just replace them because they are very cheap.  Secondly pull everything out of the box and see if there's something else in there.  The only thing I recognize as having ability to tick is an electrical timer.  Most likely it's something else.
Comment: Since it's only happening when the furnace is on, it could be an airflow issue -- some air pressure differential may be sucking or blowing air through the outlet box, causing the noise, when the furnace is on, the fan alters the air pressure throughout the house, which affects the ticking outlets.
Answer: Here are some possible scenarios:
True story: I was called out to troubleshoot a chirping outlet.  My first thought was just a bad GFCI outlet.  To my surprise the outlet was indeed chirping and not a GFCI.  The source was 5 computers, monitors, and other electronic devices all daisy chained off one outlet that had become loose or was never tighten good.
Electronic devices will "chop" up the electricity, some worse than others.  And apparently can become audible with the right conditions.
Easy fix: just tighten the screws on the outlet or replace the outlet all together as it may be defective.
Also keep on mind some GFCI outlets will make a buzzing noise, and sometimes but rarely will chirp very loudly due to the internal parts failing.
Answer: Doesn't sound right and is possibly dangerous.
You said you tightened the screws on the receptacles.  Did you check the ground screw in the box and also check that the wire nuts are all tight?  Are the receptacles on the same circuit as the furnace (wouldn't be right, if they were)?  Or is the furnace connection just a coincidence?
A number of years ago, my parents lived in a condo that was built when aluminum wiring was permitted.  As aluminum wiring "flows", you have to make sure that any high-current switches are checked regularly.  (I was glad when my parents moved because I was concerned about the risk of electrical fire.)


Is there a way to search for adducts by exact mass?

Question: We found an unknown of exact mass 217.082. Is there a tool that one can search by an exact mass get a list of possible compounds. We have considered desmethylnaproxen as a possibility, but found its mass as 217.086 for the proton adduct.
Comment: What's the error bar on either measurement?
Answer: I guess that would be what you are looking for:
http://www.chemcalc.org/mf_finder/mfFinder_em_new
This one gives you theoretical combinations of atoms, that fit the mass.
You could also check the sdbs database for organic compounds.
https://sdbs.db.aist.go.jp
This one gives you existing compounds but it is rounding to 1 decimal so it gives you everything with 217.1 which is not perfect.
I just used the frist calc and then checking all close results (green) at SigmaAldrich to see, which formula matches a compound they sell. There are just two from the List:
$\ce{C10H16ClNO2}$ and $\ce{C11H11N3O2}$
So I would focus on these.
Comment: Thanks. I suppose though that without the proton adduct that 216.074 is the actual weight I'm looking for. I'll try that on the sites you provided. Our precision on a Thermo Q-Exactive is at least three decimal places.
Comment: @Michael Muehlbauer: Please see the Late addition in my answer.
Answer: By your question, I assume you may be taking Spectroscopic Analysis of Organic Compounds course. I'm not sure which book you are using but I recommend Silverstein's book (Ref.1), Spectrometric Identification of Organic Compounds, which is better (I have only 7th edition, but current edition is available as well). That's said, this book lists formula masses of possible compounds using Formula masses of different combinations of $\ce{C, H, N}$, and $\ce{O}$ to four decimal points (You have given exact mass of your compound with only three decimals). These formula masses in the book are based on the exact mass of the most abundant isotope of each element. Well, following are the closest given in Appendix A of Ref.1:
Formula mass: 217.0852 ($\ce{C11H11N3O2}$); Formula mass: 217.0865 ($\ce{C13H13O3}$); and Formula mass: 217.0892 ($\ce{C16H11N}$).
Late Addition:
Formula mass: 216.0774 ($\ce{C11H10N3O2}$) (Ref.1, pp. 62).
Reference:

R. M. Silverstein, F. X. Webster, D. J. Kiemble, Spectrometric Identification of Organic Compounds, 7th Edition; John Wiley & Sons, Inc.: Hoboken, NY, 2005.


Problem with formalism in first order logic

Question: This is a general question in first order logic.
Assume I have alphabet $\Sigma$ that contains one-argument function (among other symbols).
I want a new alphabet, $\Sigma'$, which is the same as the original, except that the function $f$ will be replaced by a new binary relation $R_f$.
I ran into difficulties when I tried to formulate it.
For example, for formulas as: $R(x,f(x))$, I need to replace $f(x)$ but I don't know how exactly.
In general, I couldn't find a way that accurately defines a new formula, such that: the new formula will be satisfied above $\Sigma'$ iff the original formula was satisfied $\Sigma$.
Answer: What you are looking for is replacing a function symbol $f$ with the corresponding graph, which is the relation $R_f$ characterized by $R_f(x,y) \iff f(x) = y$.
So we can replace $f(x) = y$ with $R(x,y)$ if $x$ and $y$ are variables. But what do we do about $f(t)$ where $t$ might contain futher occurrences of $f$? That's the tricky bit.
The idea is to use intermediate equations, for instance
$$f(f(x)) = f(f(f(y)))$$
can be replaced with
$$
\exists x_1, y_1, y_2, y_3. f(x) = x_1 \land f(y) = y_1 \land f(y_1) = y_2 \land f(y_2) = y_3 \land f(x_1) = y_3
$$
which in turn is replaced with
$$
\exists x_1, y_1, y_2, y_3 . R_f(x, x_1) \land R_f(y, y_1) \land R_f(y_1, y_2) \land R_f(y_2, y_3) \land R_f(x_1, y_3).
$$
We can use a similar trick even if some other symbols and relations are present. For example
$$f(x) + 3 \leq f(5)$$
translates to
$$\exists y_1, y_2 . R(x,y_1) \land R(5, y_2) \land y_1 + 3 \leq y_2.$$
It is a good exercise to spell out the precise procedure after you've learned the trick, but let me know if you'd like more details.
Comment: Thank you for you informative response! About the example: $f(x)+3<=f(5)$- $x$ is a free variable, does $y_1$ should be free as well? Or under $\exists$ quantifier. I can't decide whether this is even matter. And for the correctness, I should define inductively the translation, and then proof by structure induction the correction?
Comment: And one more question, can I do a similar thing with relations? Namely, replace relation with function from the domain to {0,1}? I've tried to do such thing, but ran into difficulties in the proof, so I taught maybe relations can't be represented as functions.
Comment: All newly introduced variables must be bound by quantifiers. Regarding functions, I take it you want to replace relations with functions *to the codomain* $\{0,1\}$ (and not "from the domain $\{0,1\}$" as you stated). You cannot do that in first-order logic, except in limited cases, because there is no way to encode the quantifiers in general.
Comment: What is the exact problem with the translation of $R(x,y)$ to $R_{=}(f(x,y)=1)$? I taught that the problem is with the element that should represent truth value ( I mean 0,1).
Comment: Suppose $Q(x,y) \iff g(x,y) = 1$ and $\forall x, y . g(x,y) = 0 \lor g(x,y) = 1$, i.e., the function $g$ represents the relation $Q$. What function represents the predicate $\forall x . Q(x,y)$?
Comment: Can't I write: $\forall x.g(x,y)=1$ ?
Comment: That's not a function. You need to define a function $h$ (using $g$ and first-order logic *only*) such that $\forall x \,.\, (h(y) = 1 \iff \forall x . g(x,y) = 1)$.
Comment: There is indeed a problem in finding such a function.
Do you have intuition, why does first-order logic not have the ability to express such a function? I'm trying to get a sense of when the expressiveness power of first-order logic isn't enough.
Comment: Well, if you could do that, you could essentially embed higher-order logic into first-order logic, so that's one reason why you can't do it.
Answer: You can always find a relation to replace any total or even partial function albeit it inevitably complicates the original wff with additional quantifiers and conjuncts, so usually you'd much better off with more generic and flexible function symbols defined in your alphabet $\Sigma$. However, a relation symbol cannot be replaced with only function symbol(s) in general in first order languages because function symbol is used to get terms corresponding to grounded objects in the domain of discourse and truth values are never grounded objects in the object language.
Now for your specific question to translate the formula $R(x, f(x))$ using only $R_f$. For simplicity the first case assumed here is that your function $f$ is total and per your function replacement $R_f$ assumption we can derive in a formal system:
$$\forall x \exists! y (f(x)=y \rightarrow R_f(x, y)) \vdash \forall x(R(x, f(x)) \rightarrow \exists! y (R(x, y) \land R_f(x, y)))$$
, where $\exists!$ is just a shorthand for the unique existence quantifier which can be replaced using a more complicated formula by adding a universally quantified conjunction.
Now for the second case where your original function $f$ is partial, then we can have a similar derivation in the same formal system:
$$\exists x \exists! y (f(x)=y \rightarrow R_f(x, y)) \vdash \exists x (R(x, f(x)) \rightarrow \exists! y (R(x, y) \land R_f(x, y)))$$
Or if you know $f$ is undefined at $p$, for example, then you can derive below:
$$\forall x \exists! y (x \neq p \land f(x)=y \rightarrow R_f(x, y)) \vdash \forall x(x \neq p \land R(x, f(x)) \rightarrow \exists! y (R(x, y) \land R_f(x, y)))$$


Phd in Statistics

Question: I do not have prior experience in research in academic institutions but I do work at research and development as statistician in a top multi national company. Do I need to do some research in academic institutions before applying for phd in a top school ?
Comment: Where do you intend to apply - what country? What degree(s) do you hold?
Comment: are there colleagues in your current position who worked in academia before joining your company who you could ask for advise? Prior to covid I would say: just have a cup of coffee with them, but... The problem is that some work done by companies is really interesting while others is (academically) boring and irrelevant. So based on the limited information you gave us, you could either be a really interesting candidate or one that ends up on the discard pile immediately.
Answer: The top schools in the US do require some research experience. Ph.D. is a research degree. The number of seats are few whereas many people who are applying, already have publications. Hence, even if they don't mention research as a requirement explicitly, people who have that, definitely have an advantage over others who don't.
However, if you have a degree from a top institution and a good GRE score (above 320), it will help. Your industry experience in a top multi-national company will be beneficial too.
I don't think that you need to have academic research experience per se, industry research experience will do as well. If you have done dissertations during your undergraduate or graduate studies, those are research experiences too. Add them to your resume. Just remember getting at least one or two academic recommendation letters, especially from your dissertation supervisor.
Last but not the least, do not put all your eggs in one basket. Besides applying to some top schools, also apply to tier 2 schools and have some safety options. For a Ph.D., the reputation of the school is not as important as the faculty fit. Perhaps a tier 2 school will be a better fit according to your research interests.
Try your best and you might have a shot.
Answer: Generally speaking, prior research experience is not necessary for applying to a Ph.D. program because a doctorate program is supposed to teach and train you the research skill. Often, a researcher gets the first (real) research project done in his Ph.D. thesis. However, prior research experience is (always) a plus to get into a doctorate program.
Comment: Is this applicable for top schools also? Like Stanford or harvard etc. Or may be the top 50 universities in the world ?
Comment: Yes, it applies to any school. Top schools may have tougher competition. So prior research experience may allow you to have more advantages in getting into their programs.

Phd in Statistics


How much special yeast do I need?

Question: I have seen this particular beverage and I want to brew this at home. How much fluid yeast do I need to collect to make 1 gallon of this particular high end brew? How do test for yeast content?
http://orderyoni.com/
Answer: The yeast is not what is special, it is naturally produced lactobacillus bacteria from the vagina. The beer is classified as a sour ale, and to culture this bacteria you would need to collect a sample and grow it in a aseptic environment to ensure your product will turn out as you want. This will be very difficult with out proper lab training or equipment. You could however inoculate some wort with this lactobacillus just from swabbing and placing the swab in a starter to give a rudimentary lactic acid source to sour the beer. I would not recommend doing this in your standard brewing equipment.
Good Luck
Cheers

How much special yeast do I need?


non-grain options in sourdough starter

Question: Is there any reason not to try adding dried fruit to a sourdough starter? The reason I'm imagining is that different sorts of yeast live on dried fruit vs on grains. This could turn out to be delicious or terrible. As well I've never seen sugar added to a starter so I'm curious what the dried fruit sugars would do. Is there any info on this?
Answer: It is not uncommon to use pineapple juice, grapes...berries...really all sorts of fruits,  as a source of yeast/bacteria for a sourdough starter.  Dried fruit, such as apricot is also used. So, there is no reason you can't give it a go.

non-grain options in sourdough starter


Reinstall Reporting Services 2005

Question: We are having problems with our reporting services portion of SQL server 2005. Can someone provide some guidance for reinstalling reporting services?
Answer: Have you tried just removing the virtual directories from IIS and running the report configuration wizard again?
This is what I have done when our installation went wonky and not only was it quick and painless, it resolved the problem too!
NOTE: We had a security issue where no client could view the reports even when in the correct AD groups
YMMV but you could try this first before going through the entire Add/Remove Programs->Change->Remove Reporting Services->Add/Remove Programs->Change->Install Reporting Services Cycle.....
Comment: You are a genius.
Answer: To uninstall:
From here:

Go to Add/Remove Programs and click
  Change.   Choose Reporting services
  and continue.   At some point you will
  have to make the choice to remove SQL
  server.   Verify that in the blue bar
  above it says "Reporting Services" and
  continue.   It's a little
  nerve-wracking, but that's the way to
  do it.

Be sure to backup your encryption key first!
(If you have encrypted content in your database.)
And as noted by @NYSystemsAnalyst in the comments: also backup your ReportServerDB and ReportServerTempDB databases!
Comment: Be sure to backup the ReportServerDB and ReportServerTempDB databases if you need reports, settings, etc. in there.
Answer: Most points are covered in KB 842425, aka "How to move a Reporting Services database from a computer that is running Reporting Services to another computer"
Answer: I did some SQL downgrading and ran into issues because of this, and created a blog post to help: http://www.sqlwebpedia.com/content/how-to-move-reporting-services-new-server

Reinstall Reporting Services 2005


Commerce Search API with Custom field search

Question: I have a Custom search form with multiple fields on my front page. After clicking on submit button, user would be routed to search result page. (Ideally, a Commerce search view). On search result page, all facets blocks are enabled.
Products are mapped with Commerce Stores (cmp_store). I have used field collection for Store so Seller can add multiple stores. Each store has Zip code associated with it.
I am getting zip code in my search facets.
But if User has not entered zip code then I want search result based on User's current location + 25 kms radius. Sorting should be location based.
I guess I have to alter the search query. Not sure how to alter query.
How can I do that ?
Answer: I have added related fields to the index configuration page under the "fields" tab. First have added the store then the zip code.


Async and document ready

Question: I try to optimize my pages by putting some async attributes on my scripts. It seems to break my javascript since $(document).ready is executed before the all scripts are loaded!
I saw that I can resolve my problem by putting $(window).load instead of $(document).ready but I was wondering if there is a better solution.
This solution trigger 2 problems in my case :

I have to change all $(document).ready and tell all the developpers to not use it anymore
The scripts will be executed after all images are loaded. My website has a lot of heavy images and I really need some scripts to be executed ASAP after dom is ready.

Do you have some magic tricks? Maybe putting all scripts at the end? use defer instead of async?
Comment: document ready calls are executed also for scripts using document.ready after jQuery detected the document ready state. On a site where jQuery is used, try to use the following after all resources are loaded:
```$(document).ready(function () {console.log('READY');});```
Answer: After some extensive research, I can definitely say that putting scripts at the end of the page is THE best practice.
Yahoo agrees with me : http://developer.yahoo.com/performance/rules.html#js_bottom
Google don't talk about this practice and seems to prefer async scripts : https://developers.google.com/speed/docs/best-practices/rtt#PreferAsyncResources
IMHO, putting script at the end of the page has several benefits over async/defer:

It will work for all browser (yes, even IE ;) )
You guarantee the execution order
You do not need to use $(document).ready or $(window).load
Your scripts can execute before your images are loaded
As async/defer, your page will be displayed quicker
When the DOM trigger the ready event, all scripts are loaded
Can be optimized by merging all js in one file without problem (by a tool like mod_pagespeed)

The only drawback that I can see is that the browser won't be able to parallelize the downloads.
One good reason to use async/defer instead is when you have a script that is completly independant ( do not need to rely on the execution order) and that don't need to be executed at a specific timing. Example : google analytics.
Comment: It does not fully guarantee the execution by putting them down in the DOM. If you got too much JavaScript and / or HTML for the browser, you need requirejs or any other system loader like that. I saw design that worked only with compressed JavaScript, because it was too much. It was an bootstrap 3.x respsonsive theme with effects while scrolling down the page.
Comment: the only valuable argment to not use defer in 2012 was, as said by Yahoo :  Firefox doesn't support the DEFER attribute. However now in 2020 you can use the defer mode every where : https://caniuse.com/#feat=script-defer
Comment: See my answer below. Jquery has a built in call to help out with this exact issue.
Answer: defer would definitely help here.
defer is generally better than async because it:

loads asynchronously (just like async)
guarantees the execution order (unlike async)
executes at the end (unlike async that executes in parallel when the page is still loading and it actually halts the dom-parsing!)
jquery ready fires after the "deferred" scripts have been loaded (this is what you're asking)

This SO answer has a very nice picture illustrating defer/async load order, super-understandable.
Answer: If you didn't want to use a script loader, you could use the following approach which would allow you to leave your $(document).ready scripts in place - modified as follows:
$(()=>{

    function checkAllDownloads() {
        // Ensure your namespace exists.
        window.mynamespace = window.mynamespace || {};

        // Have each of your scripts setup a variable in your namespace when the download has completed.
        // That way you can set async on all your scripts except jquery.
        // Use the document ready event - this code - to check if all your scripts have downloaded.
        if (window.mynamespace.script1 && window.mynamespace.script2){

          // Proceed with page initialisation now that all scripts have been downloaded.
          // [ Add your page initialisation code here ].
          return;
        }
        // Not all downloads have completed.
        // Schedule another check to give the async downloads time to complete.
        setTimeout(checkAllDownloads, 500);
    }

    // check if it is safe to initialise the page by checking if all downloads have completed.
    checkAllDownloads();

    })

Answer: I had this problem as well recently and resolved it using the built in "getScript" Call (jQuery)
Reference: https://api.jquery.com/jquery.getscript/
Example:
     $.getScript("[Your local file path or external URL]",
          function (data, textStatus, jqxhr) {

          //Code to run after the script has been loaded

      });

Async and document ready


R Lasso regression for numeric outcome

Question: I do not have experience of using LASSO regression glmnet. I wanted to use it to see which factors affect most my attribute. I have 99 factors (binomial) that affect one attribute (numeric). Is it reasonable to use lasso in my case?
thanks,
Answer: Yes, this kind of situation is more or less what the LASSO was designed for.
The fact that all of your predictors are binary shouldn't matter, and the basic LASSO is designed for continuous responses anyway.
One nice thing about the glmnet package in R is that you can use "elastic net" regression instead of LASSO (by setting the argument alpha = 0.5 instead of the default 1). This produces a "50-50 mixture" of LASSO and "ridge regression" that has been shown to produce superior results. The main difference is that if any of your predictors are correlated with each other, the elastic net will shrink them together, while LASSO tends to keep one and shrink the rest down to zero.

R Lasso regression for numeric outcome


how to install firefox 26 on ubuntu without internet connection

Question: Current version of Ubuntu that I have is 12.04 which do not have internet connection, what is the instruction or command to update the Firefox version from 21 to 26 ?
Answer: Version 26.0 is available for download from the Firefox website  - go to someone who has internet, download there then copy to a USB flash drive or CD-R. Then, put that media on your system copy the files from that archive file, by clicking on it with your file manager which should call the Archive Manager app to open the file.
Copy them into a folder you name firefox-new in your home directory.
Then delete the contents of your existing Firefox files in <code>/usr/lib/firefox</code> and move the new version in there.


On YouTube "Google+" how can I restrict notifications to just people replying to me?

Question: On YouTube when I look at notifications I see notifications showing me comments that have nothing to do with me. If they are replying to me fine, otherwise I don't want to know. I am not talking about emails here. These are notifications within youtube.com.  How do I stop getting notifications just because somebody commented on a post that I commented on?
Comment: @pnuts i'll move the last line above the image 'cos then people will see it and if it's below then they might not
Answer: UPDATE  I can't guarantee this works.. Google keeps changing things. e.g. March 2016  google changed my settings to spam me, and i've suddenly started receiving email about comments that have nothing to do with me. The emails can be turned off (there's an unsubscribe link at the end of each email), but will update about notifications.

There seem to be two places where notifications are,
this one seems to work, it's the google+ notifications
https://plus.google.com/u/0/settings

and there's also this one which may work too
https://www.youtube.com/account_notifications

But I fixed it by going to the google+ notifications link mentioned, i.e. https://plus.google.com/u/0/settings
To get to the Google+ notifications page you can also go to the bell in the top right
this is what the bell looks like on youtube.com

this is what the bell looks like on support.google.com

I am going from youtube.com
Now
Expand the bell and click "google+ notifications"

A bar like window then appears on the far left.
Now click Settings at the bottom of there

And you should hopefully be able to get this page

now looking at that page above, then scroll down expand "Posts" as in the pic below, and you see the pic below,  these checkboxes, and notice I have deselected two of the options, this cuts down on a lot of the junk. So, if somebody refers to me then fine, I get a notification. But I change two of the defaults, because  if somebody just replies to a comment I made, I don't want a notification 'cos lots of people might reply to a comment. And if I participate in a comment thread I don't want to be notified forever after every time somebody comments. These are stupid defaults that I have changed, deselecting them.


Is there an easy way to export a CSV file of all transactions from a specific address or wallet?

Question: Is there an easy way, without writing code, to export a CSV file of all transactions from a specific address or wallet? (not Daedalus)
Comment: If you're using Nami you can use this https://github.com/Et9797/tx-history-viewer
Answer: Address or wallet?
The distinction is important for UTXO chains following the BIP-44 standard, because a single extended public key (wallet key) can generate a virtually infinite number of addresses. Are you looking to query a single one of these addresses, or all of the addresses associated with a single wallet?
In the case of the former, I am unaware of any easy third party solution for TX export by individual addresses. If there are none, the only option would be to query from an API endpoint like Blockfrost, or to query from your own db-sync instance.
In the case of the latter however, light wallets (like Eternl) have easy export options for the entire wallet history. You do not have to fully restore your wallet to access these features. You can instead import your wallet as read-only (requiring only the extended public key of the wallet, no signing keys), and export TX history in CSV format.
Answer: There are two ways of doing this. One is with cardano-db-sync as mentioned in @zhekson's response.
The other way is by querying the cardano-wallet executable (bundled with Daedalus) as per the documentation at https://input-output-hk.github.io/cardano-wallet/api/edge/
I have a script like this:
#!/bin/bash -eu

# https://input-output-hk.github.io/cardano-wallet/api/edge/

progname=$(basename "$0")

curl --version > /dev/null 2>&1 || { echo "${progname}: 'curl' program is missing." >&2 ; exit 1 ; }
jq --version > /dev/null 2>&1 || { echo "${progname}: 'jq' program is missing." >&2 ; exit 1 ; }

wallet_pid=$(pidof cardano-wallet)
http_port=$(lsof -Pan -iTCP -sTCP:LISTEN -p "${wallet_pid}" | tail -1 | sed 's/.*://;s/ .*//')

function api () {
  curl --silent --cert ~/.local/share/Daedalus/mainnet/tls/client/client.crt \
    --cacert ~/.local/share/Daedalus/mainnet/tls/client/ca.crt \
    --key ~/.local/share/Daedalus/mainnet/tls/client/client.key \
    "https://localhost:${http_port}/v2/$1"
}

function wallets () {
  api wallets | jq '.[] | {name: .name, id: .id, state:.state.status, pool:.delegation.active.target, balance: (.balance.total.quantity / 1000000) }'
}

function transactions () {
  echo "TransactionId,Timestamp,Direction,AmountAda"
  api "wallets/$1/transactions" \
    | jq -r '.[] | [.id, .inserted_at.time, .direction, .amount.quantity / 1000000] | @csv' \
    | sort --field-separator=',' --key 2
}

function usage_exit {
  echo
  echo "Usage:"
  echo "  $progname wallets                   - List the known wallets."
  echo "  $progname transactions <wallet>     - List all transactions for a given wallet."
  echo
  exit 0
}

case "${1:-""}" in
  wallets)
    wallets
    ;;
  transactions)
    shift
    if test $# -eq 1 ; then
      transactions "$1"
    else
      echo
      echo "Error: A wallet needs to be specified."
      usage_exit
      fi
    ;;
  *)
    usage_exit
  esac


Is it safe to delete heapdump.hprof.old?

Question: I'm on a mac book air running OS X 10.9.2. I want to free up space. I see that a file called headdump.hprof.old is occupying a lot of space. Is it safe to delete it? What does it do?
Comment: check your spelling, the screen shot shows heaPdump, not heaDDumpa.
Comment: Heap Dump

A heap dump is a snapshot of the memory of a Java process at a certain point of time. There are different formats for persisting this data, and depending on the format it may contain different pieces of information, but in general the snapshot contains information about the java objects and classes in the heap at the moment the snapshot was triggered. Usually a full GC is triggered before the heap dump is written so it contains information about the remaining object....
Answer: Yes, it is perfectly safe to delete the file.
It is used by programmers in debugging errors in programs. If you're not a developer, not actively debugging that specific program, or not actively involved in a support request regarding a bug in that program - you won't need the file.
Comment: If akh2103 has doubts regarding this, I would just recommend him to move the file away at first and test if the application still works. If it surprisingly turns out that it doesn't work, he can always move the file back again.
Comment: Before recommending the Delete, could you provide reference to some reputable source (nothing personal)
Comment: Well, in this case I'm probably the reputable source. I have used heap dumpers (Java and non-Java) for decades, so I have a pretty good idea what I'm talking about.


Surjective and injective criteria via Hilbert polynomials

Question: Let $X$ be a projective complex manifold. Is it true that any coherent sheaf $\mathcal{E}$ on $X$ whose Hilbert polynomial is a constant has a surjective morphsim $\mathcal{O}_X\rightarrow \mathcal{M}$? Or dually is it true that any coherent sheaf $\mathcal{F}$ whose Hilbert polynomial is different from that of $\mathcal{O}_X$ merely by a constant has a injective morphism $\mathcal{F}\rightarrow \mathcal{O}_X$?
Answer: No. For the first question, let $X$ be a point and $\mathcal M=\mathbb C^2$ (vector space) or any $X$ and $\mathcal M$ be a vector space of dimension $\ge 2$ supported only at $x$.
For the second question, consider a Riemann surface $X$ and $\mathcal F$ a line bundle. Then the Hilbert polynomial of $\mathcal F$ is that of $\mathcal O_X$ plus the degree of $\mathcal F$, but $\mathcal F$ can inject into $\mathcal O_X$ only if its degree is not positive.
Comment: Thank you for the answer. I will think about what extra condition we need in the first case. Please let me know if you know any reasonable condition.
Comment: Under you assumption, $\mathcal M$ is supported in a closed finite subset of $X$. There is a surjective homomorphism $O_X\to M$ if and only if for all $x\in X$, $\dim_{\mathbb C}(M/\mathfrak m_x M)\le 1$.


Why does earth look blue from outer space?

Question: I know it's more than 70% water. But what has it got to do with earth's colour ?
Answer: Quite a simple answer: Scattering of light (Rayleigh scattering would be more precise here...)

An observer in ground sees the sky as blue due to scattering of light by air molecules present in the atmosphere. For an observer in space, The water bodies reflect the color of sky...

The water bodies (ocean, lakes, river) appear blue ('cause water is quite colorless) because of the way sunlight is selectively scattered as it goes through our atmosphere. Taking Raman effect into account, Water absorbs more of the red light in sunlight. By this way, water also enhances the scattering of blue light in the surroundings.
By Rayleigh scattering law: (It's more important here) The amount of scattering is inversely proportional to the fourth power of its wavelength. Due to the larger amount of $N_2$ and $O_2$ molecules (78% and 21%) in the atmosphere, blue light which is having shorter wavelength is scattered to a greater extent.
Thus, the earth wouldn't be blue if it doesn't have enough $O_2$ and $N_2$ molecules in its atmosphere. The scattering depends on the characteristics of gaseous molecules in atmosphere... This is applicable to other planets also. (like Mars appearing Red, Venus appears yellow, etc.)
Comment: it's fine now +1, erased comments.
Answer: That's because it is because of so much water. From NASA: http://www.nasa.gov/audience/forstudents/k-4/stories/ames-big-blue-marble-storybook-text.html
Atmosphere
The sky (which also has an effect) is blue which has to do with molecules/optics. You can check more of that here: Why does the sky change color? Why the sky is blue during the day, red during sunrise/set and black during the night?
Water Coverage
As mentioned above, the sheer percentage of water covering earth makes the earth blue. But what makes the Water blue? Most of the light is absorbed by the water and radiates the Blue in the visible light spectrum. (Same idea as air!)
See more on E-How
http://www.ehow.com/info_12111369_earth-appear-blue-outer-space.html
Comment: @RonMaimon I don't think the scattering is very wavelength dependent. But water absorbs red light much more strongly (see [Absorption spectrum 380–700 nm of pure water, fig. 10](http://polarphytoplankton.ucsd.edu/docs/protocols/literature/PopeFry_AppOpt_1997.pdf)) due to harmonics of the fundamental O-H stretching transition at ~$3 \mu$.
Comment: I thought the water was reflecting the blue scattered from the sky. Does it also scatter it's own blue?
Comment: It's both - reflecting and radiating its own blue.
Comment: Why is it both? I don't see why water Rayleigh scatters its own blue. The scattering there is by microorganisms and impurities which are comparable to wavelengths.


In App Subscriptions in Android

Question: I am still looking for third party "in-App billing and subscriptions mechanism" but It would be worth taking your point of view on this.
I looked into "Google Checkout Beta Features" (http://code.google.com/apis/checkout/developer/Google_Checkout_Beta_Features.html) but it is in beta stage, Do we have other reliable alternatives for android market which could serve the monthly subscription.
Thanks!!
Answer: You might want to take a look at PayPal's Mobile Payment Library. I'm not sure how well it supports subscriptions, though.
Answer: You can now support in app subscriptions:
If you have done in app purchasing of products before it's not much of a change, have to check for version 2 of the billing/vending though.
See the android developer blog:
http://android-developers.blogspot.se/2012/05/in-app-subscriptions-in-google-play.html

In App Subscriptions in Android