SQL Server Change Tracking

Question: I work for a company of about 80 employees and they all seem to need access to our database on a regular basis. I don't have time to write applications to meet all of their needs so I'm just going to install SQL Server Management Studio on each employee's computer so they can help themselves to the data. Does anyone know if there's a way to write a wrapper for SQL Server that would save all database transactions to a text file so I can monitor what changes everyone is making?
Comment: This is a terrible idea for a lot of reasons.  "I don't have time" is not a great reason to give everyone the keys to the store.
Comment: You are in for a world of trouble giving everyone access to the data.  _Oops I truncated a table_
Comment: Most of the people I work with have college degrees so I can just teach them how to write SQL code. That should eliminate the risk of truncation issues.
Comment: @TropicThunder are you talking about read only access?
Comment: @Zane: No, full access. I need them to be able to insert, update, and delete.
Answer: I may get dinged for this, I may not, but if you don't have time I've got a fantastic solution for you. Download Visual Studio LightSwith - you can build a database application in less than five minutes and have it deployed in less than ten - I've done it.
Make time, find the right tools, but do not give them the keys to the database.
In fact, LightSwitch is so dead simple, you could teach some other folks there how to use it at some level.
Answer: While I don't agree with your motives 'I don't have time'  I do understand the need.
Ensure you have appropriate security setup for that portion, and for your data changes you want to Checkout Change Data Capture if you are on SQL2008R2 which of course is available in 2012  as well, below that you will have to roll your own solution using triggers, but i doubt you'll have time for that.

SQL Server Change Tracking


Where is the war against the Edo Tensei people being fought?

Question: I'm at around chapter 588 at the moment, and they're currently fighting against the shinobi who have been reincarnated by Kabuto. They seem to be fighting over a wide stretch of land that looks like it could be most places that isn't the desert. I can't remember if they said where they were fighting, but does anyone know approximately where (in relation to the various villages) they are fighting?
Answer: If we are to follow the images and information we are given. It should be somewhere in between the Lands of iron and an island in the Land of Lightning
This is the current ninja world map.

source of image
Below a piece of the tactic explanation showing a piece of map

Looking at the 3 borders in the tactics. Taking the angle shape, and the information that it is between the lands of iron and the floating turtle.

This would be the most logically location for it to be occurring


FastCGI or HTTP for backend C++ processes

Question: I am planning to build a bunch of C++ based process to provide data as HTTP rest api on the front-end. I have been trying to decide if it is better to build in the HTTP server or to use FastCGI in the C++ processes. In either case the processes will be behind some webserver like nginx. To me it seems like FastCGI is simpler and would be easier to work with then having a fully HTTP server. FastCGI would also seem fast, not that it would matter much. I see testing would be easier if the C++ processes had HTTP built in just connect directly to it for internal use, but I have not found a simple C++ HTTP server library that I like yet.  I am looking any other pro or cons.
Answer: Don't even think of writing your own HTTP server unless you have a very clear and legitimate need to do so (which doesn't seem to be the case here). Go for FastCGI or even SCGI, which is a much simpler protocol to implement than FastCGI if you don't want to use a library or if you have specific needs for such an implementation.
Comment: I agree I don't want to write my own HTTP server. I did find http://code.google.com/p/mongoose/ and might look at it. Will have to look a SCGI.
Answer: I found libevent has a simple http server built in. I have been using it and am very happy. I am using Qt and had to do a little work to put a wrapper around libevent in a thread, but it works great and is very simple.
Answer: G-wan webserver, a 200 KB executable file, lets you write ANSI C scripts that are edited and executed on-the-fly (more convenient than fastCGI: all the HTTP work is done transparently).
You can also link any C/C++ library to G-WAN C scripts with "#pragma link".
Good luck with your project!


QOS Layer 2 Link

Question: I have two NET APP Controllers in two different Data Centers. The Data Centers are connected with a 1 Gig Layer 2 connection. Both NET App controllers are IPed within the same broadcast domain. The communication traffic over this 1 Gig connection is mostly sync traffic between the two NET App's. During busy periods the sync traffic can take up 95+% of the link. Is it possible to rate limit or shape this communication traffic to 80% of the 1 gig link?
Comment: Could you please add a diagram explaining your topology?
Comment: GREATLY depends on the switching infrastructure between the two filers. I happen to know both topics and would be glad to answer if you can fill in the blanks on what's used.
Comment: what kind of sync protocol do you run?
Comment: snapmirror/snapvault traffic is the sync traffic between the two Netapp's. One Netapp is plugged into a Cisco 6500 and the other is plugged into a Cisco Nexus 5k. Both devices are interconnected over the 1 gig link (layer 2) .
Answer: Simplest solution is to attach a policer to the access ports:

!
policy-map ingress-limit
 class class-default
  police 800M 1000000 exceed-action drop
 !
!
interface gigabitEthernet0/1
 description port connected to NetApp
 service-policy input ingress-limit
!

Or, else, you should deploy something more sophisticated and QoS mark your packet at the ingress on access ports and shape them with WRR at the egress on uplink ones.
In that way you would throttle NetApp's up to 80% only when congestion occurs.

!
mls qos
!
class-map match-any bulk-data
 match input-interface gigabitEthernet0/1
!
!
policy-map classifier
 class bulk-data
  set dscp AF11
 class class-default
  set dscp AF31
!
interface range gigabitEthernet 0/1 - 22
 service-policy input classifier
 srr-queue bandwidth shape  0  0  0  0
!
interface range gigabitEthernet 0/23 - 24
 description uplink ports
 srr-queue bandwidth shape  0  0  0  0
 srr-queue bandwidth share  1 80 20 1
!
Answer: If I remember correctly, you can throttle the Netapp's snapmirror/snapvault traffic from Netapp's System Manager.

QOS Layer 2 Link


Detailed explanation for PIC boot sequence

Question: I have doubts about the boot sequence of about every microcontroller but since I own a PIC I figure I should start with those first. I would like someone to explain how the PIC's boot sequence progresses. While explaining that I would also like to know how the PIC sets its clock setting such as internal or external clock without first knowing which one to use does it use its internal clock and then sets the clock to external once the register has been set?
Comment: This depends on a PIC family. Some can switch to the internal  oscillator when user-defined fails, some other don't. Boot sequence is given in the datasheet. It is, again, specific to the family.
Comment: How is this not directly and clearly answered in the datasheet?
Comment: @OlinLathrop Datasheet? TL;DR ... ;)
Answer: PIC don't really have "boot sequences", since that's a software abstraction and there is no standard software that runs on a PIC, like a bios on a PC.  PIC are generally programmed with code that performs a dedicated task, usually without a operating system.  The code is stored in the same non-volatile memory it is executed from (except some PIC 32s can be set up to execute from RAM), so there is nothing to "boot".
The diferrent PIC architectures vary a bit in what happens on powerup or after a reset, but mostly execution just starts at a single known address.  The start of your code has to be at that address.
As for configuration settings that have to be made before any code can execute, like the oscillator selection, these are stored in the configuration bits.  These are special non-volatile bits that are used directly by the hardware.
This is, of course, all described in detail in the datasheet or family reference manual.
Comment: Could you explain how the config bits are used? As in when the system powers up, what circuitry is responsible for reading and setting those values.
Comment: The oscillator circuitry directly reads those bits. On most PICs, they are written only in programming mode.
Answer: The boot sequence of a PIC is:

Start executing the code at the reset vector.

That's it.
Answer: For every architecture is basically the same. It starts whichever oscillator you configured with fuses, counts say a 1000 stable cycles and vectors to start location (this is usually location 0 in flash).
From then on it vectors to the startup, which more or less just initialises the ram variables and after that is done it vectors to your main() function.
From then on your SW starts running.
Which PIC family?


Personal use by parent of a minor's bank account

Question: My granddaughter receives survivor's benefits by direct deposit. Her father's name is on the account as C/F (custodian for?) Her father cashed a personal bogus check for a friend and when it bounced the bank took the funds from my granddaughter's account as he has no personal account there. Is it legal for the bank to do this?
Comment: It is legal for the bank to take the money from the granddaughter's account. The granddaughter is entitled to sue her father for breach of trust since he used the custodial account to pay for his personal expenses, but she may have to wait till she comes of age before she can do that.
Comment: Did he cash it against her account? If so, then he chose to use her account to secure the bank in case the check bounced. As her custodian, he's entitled to make that decision.
Answer: Yes. An account holder cashed or deposited a check against an account. Wether that holder is single, joint, or custodial does not matter. They have full access and rights to that account.


Is it dangerous to be within range of a compromised WiFi network, even if you don't connect to it?

Question: If a network has been compromised (e.g. someone is listening on the traffic or there has been malware implemented on it), is it safe to leave a device (PC, cell phone, gaming device, etc.) in range of the network, as long as you don't connect to it? Should I disable WiFi when I don't need it to avoid this risk?
Comment: People can listen to devices searching for networks and determine what networks a device would automatically connect to, then create that network.
Comment: Could the devices remain untouched if they did not connect to any network?
Comment: Check out WiFi pineapple and an attack using it. If the device is allowed to connect to a network, which basically means WiFi isn't turned off, the device could be vulnerable.
Comment: Alright, thanks very much. I've looked at the Pineapple and what I've seen is that it basically creates an identical network to a nearby one. Could you stay clear of a Pineapple attack if your device did not have any stored networks? What if the only nearby networks are secure networks (though still compromised)?
Comment: If your device is set to not automatically connect to known networks, you should be good, but this could be difficult. Nearly every device attempts to automatically connect to known networks and turning it off may be difficult on some devices. Plus, not connecting to known networks is a real hassle. I'm not 100% sure if the WiFi pineapple can create secured networks, but I'm if you only have secure networks that would automatically connect, you might be ok.
Comment: your baseband would be another story
Answer: If your device isn't connected to the network, either because WiFi is turned off or because your device isn't configured to automatically connect to the network, nothing on that network can affect your device.
However, an attacker may create a network with the same SSID and PSK as one that your device recognizes, such as the WiFi network used at your workplace. Your device will likely connect automatically in that situation.
To mitigate this risk, assume all networks have something listening, even if it is just the router itself. Make sure all your network traffic is encrypted using a VPN.
Answer: In short, there is no risk when your device is not connected to the network unless the hacker changes the SSID and password of the WiFi to one of the saved (and enabled auto-connect) ones in your device; which is rare, especially when the hacker has not targeted you.
But to be on the safe side:

forget (remove) all saved WiFi on your device,
use VPN for any sensitive activity, e.g. banking stuff,
be sure about certificates; using Chrome or Firefox will assure you fairly if it is forged or not,
Having some tools like antivirus and firewall may help.
Answer: Generally, scanning for WiFi networks is done passively by your device. This means that a router broadcasts information (such as the name of the network, authentication method etc.) and your device listens. These networks show up in a list which you can chose to connect to, but the router does not know your device is there until it tries to connect. So being in the area of a compromised network will not affect your device.
Someone could spoof a network you are trying to connect to, but they cannot read a list of networks your device likes to connect to and spoof them. They would have to spoof a nearby network, guessing that you will want connect to it. The authentication protocol should then stop you connecting to the spoofed network. Unless the network doesn't have one, in which case you should not set it to connect automatically and use a VPN.
Comment: `scanning for WiFi networks is done passively by your device`: no, it's done actively. The device sends out a request for networks they know. Keep `airodump-ng` running around your phone and disconnect from your home wifi, you will see the phone asking SSIDs around...
Comment: @ThoriumBR My understanding is that there are two types of scanning, passive and active (polling). I beleive that most devices scan passively becuase it is more energy efficient and there is no need to poll networks when they are broadcasting their information. I have found it hard to find good sources detailing the exact procedure though, so if you have a source I'd be interested to read it.
Comment: https://medium.com/@brannondorsey/wi-fi-is-broken-3f6054210fa5
Comment: On https://www.crc.id.au/tracking-people-via-wifi-even-when-not-connected/ it's explained why active scanning is better for battery: you ask only for known SSIDs, not scan all the channels for all possible SSIDs.


Should vapor barrier be installed under an insulated garage attic floor?

Question: I recently hired pros to spray foam my attic, essentially sealing the soffits, roofdeck, ridge vent, and the removed all cellulose insulation to allow air exchange and balance the conditioned space below with as of now unconditioned attic.
Question: adding fiberglass insulation over the garage (no HVAC) - should there be a vapor barrier face down ? (SC southern warm climate).  Basically the vapor barrier between attic joists resting against the drywall ceiling below.
Comment: Why did the pros seal the soffit and ridge vents?
Comment: I am with SteveSh,  it sounds like you blocked all attic ventilation, which is usually not good.
Comment: SteveSh, it's my understanding that it's common practice particularly in the south, to completely seal the envelope in the attic when professional spray foaming the roof deck and sealing the soffits and ridge vent.  My attic has full stairs going up to it, it's a modular home, it already has a plumbing feed, so with the spray foam done, I hope to have air conditioning added in the next year.  I will put my music studio in the attic, I may still have some problem areas like behind the new walls if I drywall my music room up there so I'm thinking maybe I'll put a couple low amperage air movers.
Comment: You've converted unconditioned space to conditioned space.  This would be similar to a cathedral ceiling.  You are really supposed to have some ventilation below the roof sheathing to prevent the shingles from heating up too much.  I wouldn't have sealed it like that - hope you have a metal roof.
Comment: Consider this space more of an unfinished 2nd floor rather than an attic - at least now that's what it is. When I add my home theater walls, which will be insulated for sound, then I will create spaces behind the knee wall and between collar ties/ridge that will lack air exchange. I will place a supply/return of 4" flex duct in these three spaces in order to hook up to a dehumidifier after construction.  My new HVAC ductwork will of course cool my theater space. Sounds like a preventative remediation?
Answer: A vapor barrier is wonderful because it is an excellent air flow stop. The key to where to put and not to put a vapor barrier lies in the fact that there can be only one vapor barrier between two spaces that breathe. The existence or lack of an air temperature changing unit is of no consequence.

Temperature changes cannot be avoided. Day/Night happens.
Water cannot be totally removed. Water, usually in the form of vapor, is in the air everywhere.
The temperature of the air determines how much water it can hold. When life gets cold, the water cannot remain as a vapor in the air, but comes out of the air as water deposited on everything (the cause of morning dew).
Air trapped between two vapor barriers will wet every morning and dry every night. Everything between two vapor barriers will mold, rot, etc.
A vapor barrier stops water. Water resting on a horizontal vapor barrier will not flow away. Therefore, a vapor barrier is usually never installed horizontally. Unfaced insulation is for your attic because it should not have a vapor barrier at all.

If your attic has a vapor barrier, then leave it there, but don't add another one. If your attic does not have a vapor barrier, then don't add one.
Foam insulation is a vapor barrier. But unlike anything assembled, foam is not subject to internal molding and leaves no air gaps at all.
Comment: "A vapor barrier stops water" - more precisely, a vapor barrier stops water _vapor_.  "Water resting on a horizontal vapor barrier will not flow away" - true, but there should never be any such water.  "Therefor a vapor barrier is usually never installed horizontally" - nonsense!  Almost all plasterboard (sheetrock) boards in the UK have a metal foil vapor barrier on one side.  These are often horizontal installed on ceilings.
Comment: The difference between "what should be" and "what is" is the difference between an ideal world which does not exist and the real world which does exist. Unfaced insulation exists and is labeled "attic" so that horizontal vapor barriers can be avoided. A slow leak which sits upon a horizontal surface might not be discovered until the ceiling trusses are rotted. The commonality of a practice may prove physical location, but commonality does not prove correctness. An overly insulated house grows mold. One horizontal vapor barrier on the roof and no more is very sensible. Do what you want.


Slow response from SharePoint Online

Question: In our organisation (located in Melbourne, Australia) we have multiple tenants of SharePoint Online. Since last few weeks we have noticed that one tenant is responding very slow. All other tenants are working fine. Other office 365 services are also working fine. We are trying to identify cause of this problem if it is on our side. It is defiantly not related to our network because other tenants are working fine. Also, because when we try to access our SP site from outside network, it is still slow. We are facing this issue only during 9 am-5 pm. We have already raised it to Microsoft. I need to know:
1.  Is there anything else we can do except raising this issue to Microsoft?
2.  Is there anyone else in the same region who is currently facing same issue?
Answer: No, there's nothing you can do outside of Microsoft involvement. The issue is probably not regional, it's more likely related to the farm on which your tenant resides, and if you can convince MS that there is a valid service degradation they can do something about it.
Answer: Not much we can do for this issue. Maybe May need to view the background code to inentify the cause.
So submit a service request in the Microsoft365 admin center > Support > New service request. Ask if they have any useful solution.

Slow response from SharePoint Online


What is the difference between the idea of the "social contract" in Hobbes and Locke?

Question: I have just read about them both in an introductory book to philosophy, but I am confused between the interpretations of these two people, of the "social contract" in political philosophy.
Comment: See [Hobbes's Moral and Political Philosophy](https://plato.stanford.edu/entries/hobbes-moral/#LawNat): "Hobbes argues that the state of nature is a miserable state of war in which none of our important human ends are reliably realizable. [...] When people mutually covenant each to the others to obey a common authority, they have established what Hobbes calls "sovereignty by institution"."
Comment: And see [Locke's Political Philosophy](https://plato.stanford.edu/entries/locke-political/): "In the century before Locke, the language of natural rights also gained prominence through the writings of such thinkers as Grotius, Hobbes, and Pufendorf. There is considerable disagreement as to how these factors are to be understood in relation to each other in Locke's theory. Leo Strauss, and many of his followers, take rights to be paramount, going so far as to portray Locke's position as essentially similar to that of Hobbes. "
Comment: See also [Modern Social Contract Theory](http://www.iep.utm.edu/soc-cont/#H2).
Comment: The basic difference is perhaps in the different ways they describe the "state of nature".
Comment: i read this as "state of nature". not "social contract"
Answer: The source of differences between Hobbes' and Locke' social contracts is their differing conceptions of the state of nature. For Hobbes absolute freedom is all that individuals have in the state of nature. Each can take whatever she wants from others. In the state of nature, there are "No arts; no letters; no society... worst of all, [there are] continual fear, and danger of violent death: and the life of man, solitary, poor, nasty, brutish and short." (in Leviathan)   According to Hobbes, this grim picture of the state of nature motivates individuals to come together to draft a  social contract. Individuals would relinquish their rights to absolute liberty in exchange for the protection and security offered by the sovereign. Hobbes maintains that the fact that life in the nation state is far better than that of natural state  leads to the absolute sovereignty. For this reason, people will collectively relinquish their right to revolt. The only occasion an individual is entitled to resist the sovereign force is to preserve her own life. In other words, the contract is null for an individual if the sovereign tries to take away her life. Some scholars maintain that this right to self-preservation can be viewed as the right to revolt, but the majority opinion is that Hobbes denies the right to revolt.
Opposing Hobbes, Locke argues that the people do have the right to revolt. The reason, for him, is that the state of nature is not as dire as Hobbes imagines. In the state of nature, according to Locke, people have the God-given natural rights: the right to life, liberty, and property. The problem of the natural state, to Locke, is that individuals disagree on the interpretations of the rights and on the proper  punishment of the right violators. This ambiguity and potential disputes are  the motivations for individuals to  come together to draft a  social contract. The power of the sovereign is justified (or legitimate) if and only if  the power is used to protect the natural rights of individuals (i.e., for the benefits of the people). The contract is null if the sovereign neglects this duty. To Locke, the null condition is expressed by the right to revolt.
Answer: The nature of the social contract is the question here, not the state of nature - though this has background relevance.
An old text - Pollock's - is highly illuminating.
Hobbes's Original Contract

The peculiar and fundamental point of
   Hobbes's construction is the form of his original contract.
There is only one contract: it is a contract of allegiance made not
   between ruler and subjects, but between those only who agree to transfer
   all their natural right to the ruler or rulers whom they will henceforth
   obey. The sovereign thus instituted (not necessarily one person, but in
   any case bearing the person of the commonwealth) is not a party to the
   covenant. He promises nothing to the subjects, and is bound only by
   the law of nature to exercise his power reasonably. His right is derived
   not from any promise made to him, but from the power conferred upon him. Hence there can be no legal limitation of sovereignty, and to talk
   of a limited or mixed government comes only of confused thinking.
This single original contract must be classed as pactum subiectionis [a pact of subjection: GT] rather
   than pactum unionis [a pact to form a society of political equals: GT]. (Frederick Pollock, 'Hobbes and Locke: The Social Contract in English Political Philosophy', Journal of the Society of Comparative Legislation, Vol. 9, No. 1 (1908), pp. 107-112: 109-110.)

Hobbes' political thought in Leviathan (1651) is animated by the French Wars of Religion and the English Civil Wars. He depicts a dire 'state of nature' - of life without the state. This is an abstract model of what happens or of how life will inevitably tend in the absence of supreme coercive power. The wars of his time and the recent past give a glimpse of how bad life can be without such a power but the state of nature as Hobbes describes it in its full horror as 'a state of war, where every man is enemy to every man' (Leviathan, ch. 13) is not to be taken as a literal historical description. Things could get as bad as this and have approximated to it. The social contract is the only firm barrier against either eventuality.
Locke's Social Contract
There are two contracts on Locke's view.

Hobbes argued strenuously for absolute power. Locke was abundantly
   cautious to avoid making any statement or admission which might lead
   to the inference of absolute power anywhere.
For Locke the state of nature is not a state of war ... but only a state in which peace is not secure. The natural law
   of self-preservation includes a moral duty to preserve the rest of mankind
   so far as possible (Second Treatise of Civil Government 'ST'), 1690, ii. §6). The natural power of every man has
   already a moral and even judicial character. Locke is therefore not an
   unqualified individualist like Hobbes.

The state of nature is generally peaceable, and Locke believes that it has historical and in parts of the world contemporaneous reality (ST, ii, §14). It is attended, however, with certain 'inconveniences' (ST, vii, §91) mainly connected with each person's having 'the Executive Power of the Law of Nature (ST, ii, §13) - that is, being a judge in his own cause in the absence of any overarching authority.
Locke's first contract

Civil society is formed by every man giving up his natural power; not
   to a sovereign but " into the hands of the Community" or " to the publick."
   The authority so conferred upon the society is granted only to be used
   for the public good (vii. §87). [This is the first contract - for the security of natural rights. : GT]

The first contract can be revoked by the citizenry if necessary by recourse to revolution if power is not used effectively for, or contrary to, the public good.

The next step is that the society, being formed, establishes a government
   with legislative and executive organs by the decision of the majority. The
   right of the majority is founded simply on the necessity of the case, because
   otherwise no collective action would be possible (viii. §96).

Locke's second contract

Locke does not say in terms whether he regards this as involving a
   secondary contract or covenant of allegiance ..., and it
   is difficult to make out exactly what his formal conception was. It would
   rather seem that he purposely avoids committing himself. On the whole
   I submit that he does postulate an auxiliary compact of all the citizens
   to be bound by the government and laws which the society shall establish
   (viii. §122). This compact is not made once for all, but is constantly
   renewed in the person of every man who becomes a subject and member
   of the commonwealth by promising allegiance. [This is the second contract - for convenience of collective decision-making.] (Pollock: 110-111.)

Conclusion
(1) Hobbes' sovereign is not a party to any contract and has no obligation to protect his citizens' natural rights.
(2) Locke has two contracts (between citizens and citizens, and between citizens and the government) in place of Hobbes' single contract (between citizens to obey the sovereign).
(3) The second contract is not made once for all, because Locke recognises the legitimacy of revolution, though under complex conditions (ST, xix passim), if the government and laws fail to provide adequate security of natural rights. Hobbes's sovereign is free from the legitimacy of revolution, though if his power fails and he is unable to preserve civil peace there is no obligation for citizens to obey.
References
Hobbes, Leviathan : https://www.gutenberg.org/files/3207/3207-h/3207-h.htm
Locke, Second Treatise : https://www.gutenberg.org/files/7370/7370-h/7370-h.htm
Frederick Pollock, 'Hobbes and Locke: The Social Contract in English Political Philosophy', Journal of the Society of Comparative Legislation, Vol. 9, No. 1 (1908), pp. 107-112.


My old passport with US Visa in it was declared lost or stolen

Question: My old passport  under my nickname with US Visa in it was declared lost or stolen So I wasn't able to leave. US authorities asked me to get a new passport.
Now i have my new passport with my name in my birth certificate. Can I still travel to the USA?
Comment: @MichaelHampton I don't think that's a duplicate. There are two issues here: the name change and the fact that the passport containing the original visa was reported lost. The other question only covers one of these things.
Comment: Something strange is going on, here. Passports are usually only issued under a person's official legal name, not under any nicknames. And are you saying that _somebody else_ reported your passport as lost/stolen, even though that passport was till in your possession?
Comment: (It looks like I said "This isn't a duplicate" and then voted to close as a duplicate anyway. Actually, I voted to close as "unclear what you're asking", for the reasons I explained, but the Stack Exchange system can't cope with multiple close reasons, so it just picks the most common reason and incorrectly claims that all close voters chose that one.)
Answer: You will need a new visa and need proof that you lost your old passport and visa.
From the gov website:

Lost or stolen U.S. visas cannot be replaced in the United States. For replacement of a visa, you must apply in person at a U.S. Embassy or Consulate abroad. When applying for the replacement of a visa, you will need to provide a written account documenting the loss of your passport and visa.
Comment: @MaribelleLimsonPineda To be safest, you should get a new visa. Even if you are allowed to travel to the US on your existing documents, you will be asked at immigration why your name is different, and you should expect a long delay or possibly to be refused entry if you haven't got documentation of a name change. Applying for a new visa with your correct name eliminates this problem.
Comment: Ok. Actually I was already in the departure area and was asked by the PAL counter that it was reported that the passport i was holding was reported lost or stopen, and that my name was okay, its the passport number that has a problem so i was asked to get a new passport.
Comment: I have my old passport with US Visa under my Nicko and new passport with my name in my birth certificate


Tomatoes and pepper plants dropping flowers

Question: I am new to gardening and I have planted tomato and pepper plants. They make flowers but they drop them and they are not making any vegetable.  Any idea what could be reason? I am in the city so I shake plants a bit for pollination like I watched on Internet as we do not have bees.
Comment: What are your day and night temperatures? Is the soil very often that wet? I don't see many if any dropped blossoms in the pictures. Do you just mean they're not setting fruit?
Comment: ya they not make fruits , they make flowers and after few days drop it , i will calculate temperature of day and night and will update you .. thanks , just one tomato plant made one tomato and one pepper plant made 3 peppers
Answer: From the way water stays at the surface it seems that the soil is very compacted. Irregular watering makes your flowers drop, as tomatoes and peppers don't like drought or too much water. I recommend that you water them every day with enough water for 24 hours, trying not to overwater because compacted soil aggravates the problem.
It would be best if you could loosen the soil a bit using a fork, but be careful not to touch the roots. Also, there are too many flowers on each plant and you need to keep only a few of them. There is not enough soil for every flower to become a fruit.
Comment: hmmm ya i water them once a day it morning time , soil is not that hard just that i watered and took photos ,


Entropy as Sum of Kinetic Energy?

Question: Is it possible to view entropy as the sum of the kinetic energy of all molecules in the system? Since a system with 0 entropy would have 0 motion, and as you increase the motion of the molecules, entropy increases as well. If not, could you provide a simple counterexample in which entropy does not make sense as the sum of kinetic energy?
Comment: You might want to review the concept of entropy, including but not limited to the third law of thermodynamics and the statistical mechanical view of entropy.
Comment: I see the classical explanations of entropy as the 'randomness' of a system, but this seems to be a direct contradiction with the units of entropy (Joules/K).
Comment: @AndiGu You have randomness in Boltzmann's description of entropy. S=Boltzmann constant* lnW where W is macrostate multiplicity. But  Clausius first described entropy with dS= dq/T which makes it unit J/Kwhich doesn't incorporate randomness. And Boltzmann introduced randomness to the concept of entropy(and it's a classical concept). But I think he could just do with lnW but to get it consistent with a pre-established theory Boltzmann introduced kB to the equation.
Comment: As an example, there is entropy increase upon mixing two substances together or even of mixing up sets of different objects even if both sets are already 'random'. No kinetic energy need be involved.  *Randomness* is an unfortunate term often used to describe entropy. Its the *degree* of randomness that is described and what this is  is not clear in everyday usage so its best totally avoided . Entropy is $S=k\ln(\Omega)$ where $\Omega$ is the number of ways of arranging objects, in molecules this means calculating the number of ways of placing then in all their possible energy levels.
Comment: @AndiGu Your view is **also** a direct contradiction with the units of entropy (Joules/K). These do not match the units of energy (Joules).
Answer: In a crystal lattice, there are two contributions to the entropy: the vibrational entropy and the configurational entropy. The first is related to the kinetic energy; atoms with higher kinetic energies have tend to have larger displacements from equilibrium, and have a larger "footprint" in phase space, resulting in a higher entropy. The second contribution, configurational entropy, arises from disorder in the crystal lattice, namely the number of ways of arranging the atoms. In a perfect crystal, there is only one way, so the configurational entropy ($k\ln W$) will be 1.
An counterexample to the suggestion you make is any disordered solid, whether it's amorphous, a random alloy or some kind of crystal with geometric frustration. The most obvious example of this is water ice. Each water molecule occupies a lattice position and is tetrahedrally coordinated with its neighbours. In a defect-free ice crystal, the ice rules state that each molecule must accept exactly two hydrogen bonds and donate exactly two hydrogen bonds. This is quite a strong constraint, but allows orientational disorder --- the molecules can be oriented in one of six possible ways at each lattice position, resulting in an orientationally disordered structure. This will have a finite entropy even at absolute zero.
Comment: Thanks for the clear explanation - just one question: if 'configuration' is an aspect of entropy, how does that contribute to the J/k notion of entropy? I understand the kinetic energy part - but where does this configurational part come in in terms of energy?

Entropy as Sum of Kinetic Energy?


Is outlet box required to be mounted?

Question: I would like to know if I hard-wire an outlet from another with wire running across floor to non-mounted outlet is this considered an extension cord.
Comment: Related: https://diy.stackexchange.com/questions/29715/is-it-safe-to-wire-regular-receptacles-to-the-end-of-an-extension-cord
Comment: Since the wiring needs to be secured in a protected location it's a safe bet that the box does, too. Basically, you can't run wire across a floor.
Answer: "Wire", eh?  Romex NM/UF/SE/MH/whatever multiconductor building cable is out of the question. It's not flexible, and is made for immobile use in protected locations, like behind walls, rafters, underground or in conduit. You can't use building cable for flexible cord at all.
Even if you have proper cordage, you're not allowed to homebrew extension cords with a handi-box and some cord.  Specifically, 400.8 disallows any flexible cords

Used as substitutes for the fixed wiring of a structure.
Run through holes in walls, structural ceilings, suspended or dropped ceilings, or floors.
Run through doorways, windows, or similar openings.
Attached to building surfaces.
Concealed by walls, floors, or ceilings — or located above suspended or dropped ceilings.
Installed in raceways, except as permitted elsewhere in the NEC.
Used or installed in a manner that unduly exposes them to physical damage.

400.7 carves out exceptions where you are allowed to use flexible cords:

Pendants [210.50(A) and 314.23(H)] if the cords are identified for pendant use in Table 400.4.
Wiring of luminaires as allowed by 410.24(A) and 410.62(B).
Connection of portable luminaires, portable and mobile signs, or appliances as allowed in 422.16 [400.7(A)(3), but when used with attachment plugs [400.7(B)].
Elevator cables.
Wiring of cranes and hoists.
Connection of utilization equipment to facilitate frequent interchange [422.16], but only when used with attachment plugs [400.7(B)].
Prevention of the transmission of noise or vibration [422.16].
Appliances where the fastening means and mechanical connections are specifically designed to permit ready removal for maintenance and repair, and the appliance is intended or identified for flexible cord connections [422.16], but only when used with attachment plugs [400.7(B)].
Connection of moving parts.
Where specifically permitted elsewhere in the NEC.
Answer: I think for it to be considered an extension cord, it would need a male plug at one end (it has to be portable). Hardwiring to another outlet box or a junction box sounds more like a permanent fixture, so you would have to follow the appropriate building code for where you are installing this.
That said, the 2017 NEC does allow for outlets attached to "flexible cord":

314.23 (H) Pendant Boxes. An enclosure supported by a pendant shall comply with 314.23(H)(1) or (H)(2)
(1) Flexible Cord. A box shall be supported from a multiconducter
  cord or cable in an approved manner that protects the conductors
  against strain, such as a strain-relief connecter threaded into the
  box with a hub.

However, this is within the context of hanging fixtures. The bigger problem with your proposed installation is running the cord along the floor - it's going to be subject to foot traffic there, which would create a trip hazard and cause wear. I wasn't able to find any approved examples of this scenario in the NEC.
Answer: This is in addition to @CactusCake. First, if you hardwire into an outlet, by definition it cannot be an extension cord. Second, Since it is attached to the internal circuitry of a building it has to meet and be approved as part of the wiring system.
Since you didn't specify any particular type material I cannot give you a direct answer to whether or not it would be allowed, But the material you are using can be found in Chapter 3 of the NEC "Wiring Methods and Materials". For example let's say you wanted to use type NM cable for the conductors. Then you would be referred to Article 334.15 (B) "Protection from physical damage" and see you couldn't use that material.
Third I am against any method of having live circuitry just lying around on a floor exposed to damage and other hazards. In my opinion it simply isn't a safe installation.
Hope this helps.

Is outlet box required to be mounted?


What happens if the same field name is used in two separate inherited data templates?

Question: Given that a data template can inherit from other data templates, what happens if the same field name is used in two separate inherited data templates?
Answer: Sitecore stores fields for templates as individual Items. As they are Items, they have a unique ID that can identify them. When Sitecore stores the values of fields for an item (most commonly in the SQL database), it references them via this unique ID rather than the field name.
Because of this, this means that a Sitecore item can inherit from multiple templates that share the same name for fields of theirs, and it can read / write to each of these fields without conflict. You can even have multiple fields with the same name in the same template, though this is not advised.
So, though there is no conflict there, it is very common for developers to access fields for an item via the name, not by the ID, e.g.:
 myItem.Editing.BeginEdit();
 myItem["CommonFieldName"] = "Set this value";
 myItem.Editing.EndEdit();

So what happens in this case? How does Sitecore know what field to update?
In cases such as this, Sitecore will pick the field based on this order of preference:

If there is a field on the direct template of the item with that name, it is used. The first matching field-name that is sorted highest (e.g. in the highest section and highest within that section) is selected.
If not, then it will iterate over the base templates in the order they are set in the BaseTemplates field and pick the first field with a matching name belonging to one of these templates, using the same sorting logic as above.

This logic is performed by the DoGetField method of the Template class.
If you want to access a specific field, you can use the ID instead:
 myItem.Editing.BeginEdit();
 myItem["{51F6F1D3-D8C6-427B-ADB8-AA3467B3E8DB}"] = "Set this value";
 myItem.Editing.EndEdit();

Answer: It's gonna be two different fields on the resulting item/template because fields are actually Items and technically their Unique ID is Guid, not the Name.
P.S. you could have installed a Sitecore to check that.
P.S.S. I have read through the comments of other people and I would agree that there might be unexpected causes if you access your item fields by name in the code.
I would like to highlight that this is not recommended practice.
You may want to use some mapping frameworks like GlassMapper to avoid those kind of issues (it maps by fieldId as well)
Answer: The actual behavior is undefined.  More concretely, two fields with identical names will be rolled up into the field collection of the item, and each can be referenced independently via their unique IDs.
However, many Sitecore systems and APIs use only the field name for referencing fields, so you have no guarantees as to which field will actually be used in any given situation.
For example, while I have not tested the following scenario, I imagine that any changes to your templates' field section ordering could affect which duplicate field is used when displaying content on the front-end, so you could easily find yourself in strange situations where a simple field re-ordering could change behavior.
Answer: I have created "template one" & "template two" which contains a field with same name (i.e. "filedname")
Then, "combined template" template is created and "template one" & "template two" are used as base templates for that.

Then, "combined item" is created under the /home item by using the "combined template"

As you can see, both the fields from both base templates exists in the "combined item"


Is there a way to lock certain apps?

Question: I share my PC with my brother. So, I was wondering if there was any way to lock certain apps. Making another account or a guest account is out of the question. Is there any app to do so?
Answer: In the system settings you can go to "Screen Time & Limits" (on the bottom, yellow box with parent with kid symbol) and then add the applications the current user shall not be able to open. It might not be comfortable to use if you regularly switch using the PC with your brother.
Honestly I still would recommend giving your brother his own profile and restrict the apps there. You could clone your profile if you want to save the hassle to manually copy stuff the other profile also needs.

Is there a way to lock certain apps?


What are the plural forms of the words "octopus" and "platypus"?

Question: I've seen "octopuses" and "platypuses", respectively, but I've also seen "octopi" and"platypi". Which is correct, and why?
Answer: Octopuses and platypuses would be correct. Octopi and platypi masquerade as Latin plurals on the false premise that the names are masculine Latin nouns of the second declension, and they are no such thing. The -us at the end is not analogous to the -us in fungus; rather it is part of the suffix -pus which is a Latinization of Greek ποῦς, foot. If you want to pluralize it in the true manner of its classical root, you would have to go with -podes. And that would be, frankly, a ridiculous extreme of pedantry.
Comment: Ridiculous extreme of pedantry? Ouch! _Octopodes_ and _platypodes_ are hardly etymologically defendable (as comments in the question this one is marked as a duplicate of show), but it's what I personally grew up saying, and it's the normal plural for me. I realise I'm in the minority here (and _octopuses/platypuses_ sound perfectly fine to me as well—they're just not what I'd normally say myself), but I don't think I'm _that_ pedantic …
Comment: _Octopi_ is listed in various English dictionaries as a valid alternative. I wouldn't choose it myself, but this is perilously close to the etymological fallacy. (_Platypi_ is also given by RHK Webster's.)
Comment: On the other hand, the [Latin word](http://en.wiktionary.org/wiki/polypus) for *octopus* is *polypus*, and the plural is *polypi*. It's not that wrong.
Comment: And then you will then have _octopodidae_ as the family which includes the octopuses. In French I see you can also form plurals from the singular [-pode](http://www.cnrtl.fr/definition/-pode) to -podidés as in _octopodidés(fr)_ i.e. a familiy included in the _octopodes(fr)_ order which includes the octopus.
Answer: Platypuses and octopuses are technically correct because both are not latin words although either is fine.  On the other hand, there are some English words that do have correct plurals that end with -i such as hippopotami (hippopotimus) and radii (radius).
Comment: What does 'technically correct' mean? It sounds like 'are formed according to traditionally more acceptable morphological rules'. But usage is what ultimately governs acceptability; recognition of false appeals to etymology for acceptability has actually encouraged the coining of the compound noun 'etymological fallacy'.


In Skyrim Lydia's starting gear is gone

Question: When I reached level 41 (don't know if that had anything to do with it or not), I was thinking of giving Lydia some different armor, and when I went into her inventory list all her steel armor was gone: gauntlets, boots, chest armor, everything!  She had all the ebony stuff I had given her, but not the steel.  Anyone else have this happen?
Comment: pretty sure the default character gear is usually hidden (and unremovable).
Comment: related, possible duplicate: http://gaming.stackexchange.com/questions/45933/problem-with-followers-maxed-on-carrying-capacity-but-not-carrying-that-much
Answer: Default NPC gear is not viewable without mods.
You can transfer gear and equipment to followers and they will automatically upgrade if it is better for them to use.
A related topic is here companions and armour

In Skyrim Lydia's starting gear is gone


Are Singapore Permanent Resident couples eligible to buy HDB flats other than resale ones?

Question: I am aware that a couple who are both Singapore Permanent Residents are eligible to buy a resale HDB flat in Singapore. Is this the only available option for an SPR couple, or are they eligible to buy other types of flats?
Answer: No.
According to HDB, the eligibility criteria for a new flat in respect to citizenship is:

Citizenship
You must be a Singapore Citizen

This holds true for all the categories, you can check this by clicking through the categories on the left hand menu on the website.
Note that even for resale flats there is a restriction:

From 27 August 2013, SPR household (i.e. a household with no SC owner) will have to wait 3 years from the date of obtaining SPR status before they can buy a resale flat

This might be a concern for you if you only plan to acquire PR status.
Comment: Yes, renting is the only option left then.
Comment: I did not know about the restriction before; thank you for pointing that out! Seems like buying is out of question now.
Comment: You can always rent one, but then there are different rules as to when a HDB flat can be rented out etc.


AES oracle with bad S-box

Question: Say you run in to a messed up AES (128) implementation which has the s-box configured as [0x0, 0x1, ..., 0xFE, 0xFF] and where you can query a few plaintexts to get the corresponding ciphertexts.
How many queries would one need to be able to deduce the key, and how would one go about it?
This would be a chosen plaintext attack, but I fail to see how it would be done.
Thanks a lot.
Comment: Getting the key is my goal. By the other answer I can see how I can decrypt any ciphertext, but retrieving the key is still unclear to me.
Comment: You mean that, in effect, the S-box just returns its input unchanged, as if it had not been applied at all? If so, note that the S-box is the only non-linear part of AES; all the other steps are linear over GF(2). Does that help?
Comment: (Also, do you actually need to recover the key, or would it be enough to find some way to decrypt arbitrary ciphertexts? The latter would be somewhat easier to do, since you wouldn't need to deal with all the messy details of the AES key schedule.)
Answer: Linear ciphers
If the s-box is the identity mapping, then the remaining cipher is linear.
If the cipher is linear (over $GF(2)$), then the expression for any given bit will be equal to: $$c_i = m_i \oplus m_j \oplus m_k \oplus \dots \oplus k_a \oplus k_b \oplus k_c \oplus \dots$$
For some varying quantity of and values of $a, b, c, j, k, \dots$ per ciphertext bit.
Basically, each ciphertext bit is equal to a xor of plaintext bits and key bits (and any round constants, as applicable).
Chosen plaintext attack
A linear cipher can be broken with 1 chosen plaintext attack.
Submit a block of all 0 bits as the plaintext to the encryption oracle.
Since the plaintext has no influence on the key schedule, the key bits that influence each ciphertext bit do not vary between invocations on different plaintexts. When the message is all 0 bits, then the equation for any given ciphertext bit is simply $$k_a \oplus k_b \oplus k_c \oplus \dots$$
Where the quantity and values of $a, b, c, \dots$ vary for any given ciphertext bit (round constants omitted for simplicity).
The resultant ciphertext will be equivalent to an encryption/decryption key.
It may/will not be the key that was used to evaluate the cipher, but it will work to recover the plaintext from a ciphertext, or vice versa.
To do so, simply XOR the equivalent key with a ciphertext, then run the "AES"* decryption routine without the addRoundKey step.
Proof of concept located here
*"AES" is in quotes, because AES is a standard. Once it is modified (e.g. by changing the s-box), it is not AES anymore.
Comment: If AES is used with 128-bit key, it might be possible with Gaussian elimination to reach the key bits.  If AES (or any block cipher) has a key size larger then the block-size then one needs at least two known plaintext-ciphertext pair.
Comment: @kelalaka "needs at least two known plaintext-ciphertext pair" to do what? Maybe that applies to Gaussian elimination, but the attack above works equally well for AES*-256 as it does for AES*-128.
Comment: Yes, the answer is a very nice attack. Maybe I should use a conjunction between my two sentences. I would like to add ( or you ) that one can also go for the key bits whether 128 or 256 bit AES is used.
Comment: @kelalaka: If I'm not mistaken, for AES-256 this method _cannot_ uniquely recover the key, no matter how many plaintext/ciphertext pairs you have. Basically, with a linear S-box, AES\* reduces to $E_K(p) = Ap \oplus BK$, where $A$ is a 128 by 128 bit matrix and $B$ is a 128 by $n$ bit matrix, where $n$ is the key length. And as $K$ only affects the encryption via the 128 bit value $BK$, we can only uniquely recover the key if $n \le 128$.
Comment: @IlmariKaronen you may right. I'll look at deeper when I've time, or you can post as an answer.? The OP is asking only for AES-128.

AES oracle with bad S-box


Can I always use butter instead of margarine when baking?

Question: Some recipes says use butter or margarine, some say use butter and some say use margarine. My question is, can I always use butter or does margarine have some property that butter doesn't when baking?
Comment: I have a rule: Never trust a recipe that requires the use of margarine (barring some sort of dietary restriction or allergy).
Answer: Margarine has less fat than butter, but it doesn't give quite the same flavor as butter does. You also have to be careful what KIND of margarine you are using.  Tub margarine has a higher water content and can ruin your baked goods and the stick margarine can have a lot of trans fats in it.  If you really want to get detailed into the differences, check out this site:
http://www.baking911.com/pantry/fats.htm
I agree with everything stated on that site in the fact that butter, in my opinion is far superior in flavor and texture than margarine.  I have yet to meet a dish that butter didn't improve the taste over margarine.  But there is the thing, it really is a lot about taste.  A good quote from the site about margarine:
"Not great for baking: does not allow foods to become flaky, rather more cakelike; does not spread as well as lard or shortening; adds a greasy taste. However, some bake with it all the time and have great success; it's a matter of taste."
Comment: The claim that margarine has less fat than butter is simply untrue.  At least in the US, the FDA standard of identity for margarine specifies "containing not less than 80 percent fat".  This is essentially the same as butter.
Comment: Sorry, have found better sources to mostly support [SAJ14SAJ](http://cooking.stackexchange.com/users/14401)'s comment... After reading new answers to my question [Substitues for vegetable oil spread](http://cooking.stackexchange.com/questions/35423/#35429), there is also a section of the [Code of Federal Regulations](http://www.accessdata.fda.gov/scripts/cdrh/cfdocs/cfcfr/CFRSearch.cfm?fr=166.110) that states "Margarine" is to "..contain[ing] not less than 80 percent fat.."...
Comment: ... and also a section of the [Code of Federal Regulations](http://www.accessdata.fda.gov/scripts/cdrh/cfdocs/cfcfr/CFRSearch.cfm?fr=101.67) dealing with fat content for "Butter", stating that "..the calculation of the percent fat reduction in milkfat shall be based on the 80 percent milkfat requirement..", which seems to allow for Butter varieties with the same, or less fat than Margarine
Comment: Hi. I know it's been a few years, but I just went to look at that article and it doesn't exist anymore. I don't know if you need it, just wanted to let you know!
Answer: If the recipe says margarine, use margarine. If the recipe says use butter, use butter. It can make a difference in how the recipe turns out. I have a cake recipe that ha to have margarine or it will boil over, it's a disaster. Tried and true.
Answer: You can use butter because it gives out more flavour to the cakes. I believe though that in normal sized cakes eg: a birthday cake, u would have to mainly use margarine as it can make a whole lot if difference and it contains less fat that butter however if making cupcakes for example sponge ones, it would be perfectly fine to use butter as it would only be a small amount!
Comment: Seems a bit odd to claim that you *have* to mainly use margarine in normal-sized cakes; most recipes for cakes of any size use butter, not margarine.
Answer: If you use butter instead of margarine in a cookie recipe then the cookies will burn on the bottom because that is what happened to me when I was doing a cookie recipe.


Do GBA cartridge batteries run dry after some time?

Question: Do Game Boy Advance cartridge batteries run dry after some amount of time, like GBC/GB games do? I got ton of games, the only save files I would miss are the ones from RPG games, and maybe some platformers. Would this happen after some time?
Answer: Only certain Game Boy Advanced cartridges use a battery backup. A GBA cartridge can contain either EEPROM, SRAM, or Flash RAM. Only the SRAM variant would need a battery backup. So for most games it is not a problem.
The only games I know of that use battery power to hold save data are as follows:

Baseball Advance
Boktai 1, 2 and 3 (JP)
Bomberman Tournament
Breath of Fire
Breath of Fire II
Castlevania: Circle of the Moon
Castlevania: Harmony of Dissonance
Dragonball Z Collectible Card Game
Hamtaro: Ham-Ham Heartbreak
Kirby: Nightmare in Dream Land
Krazy Racers
Lego Bionicle
Lego Island 2: The Brickster's Revenge
MegaMan Battle Network
MegaMan Zero
Metroid Fusion (Only some use a battery)
Metroid Zero Mission
Monster Rancher Advance
Monster Rancher Advance 2
Pokemon Emerald (Not for saving, but to power the Real Time Clock)
Pokemon Ruby (Not for saving, but to power the Real Time Clock)
Pokemon Sapphire (Not for saving, but to power the Real Time Clock)
Super Dodgeball Advance
Warioland 4

Source GBAtemp.
Comment: @Beavoru I edited my answer with more information. Neither of those games will lose data over time due to a battery running dry.
Comment: @user113908 - I just read that early releases and bootlegs can have batteries to backup the save files. Might be good to add to the answer.
Comment: What about games like Pokémon Fire Red, or Mystery Dungeon Red?
Comment: I think that list is incomplete - Legend of Zelda: The Minish Cap used battery backup, at least on my copy.
Comment: Add Harry Potter Prisoner of Askaban to that list, I had a copy that wouldn't save. Also potentially Yoshi's Island, but the copy I got was a dodgy copy from Bulgaria so that might not be true for a legit copy.
Answer: Yes, this will definitely happen. No battery lasts forever. Eventually, you will need to replace them in order to be able to store game saves.
Comment: Wait, what? Since when do GBA games use a battery to save? I know that with Pokemon Ruby and Sapphire, you can remove the battery entirely and have the save functionality work just fine. [People do this to get consistent RNG seeds for RNG abuse.](http://www.smogon.com/ingame/rng/rs_nonbredrng)
Comment: @user2357112 Depends on the cartridge. Some of them used flash, some of them used battery-backed RAM, and some (like Pokemon as you mentioned) used both - flash for long-term storage and battery for constantly-changing stuff. Minish Cap used battery-backed storage, for example (source: the battery in my copy died).
Comment: That depends on the usage of the battery. From what I've read, the battery (CR2032) can last for up to 5 years when used, but I wouldn't count on that.
Comment: Also worth mentioning: I read somewhere that you can use powersave devices to make a backup copy of your save, then restore that backup to the cartridge once you've changed the battery. So if you're looking to save your progress, it might be worth looking into
Comment: @Robotnik: you can also temporarily solder on a secondary battery/power supply ...
Comment: @fluffy That would explain why my copy of Pokemon Ruby is still running after 12 years.
Comment: @5pike 5 years seems very pessimistic. I have yet to experience aging cartridge problems with anything but NES games.
Comment: Oh ok, thanks!  do you know how much time (years) they will last? like an approximate number?


Difficulty singing along to a beat

Question: I can sing very well, but the problem I have is that I can't
sing along with a beat. I am either too fast or too slow, what can I do please?
Comment: Does this answer your question? [I am a singer who has problems with tempo](https://music.stackexchange.com/questions/30051/i-am-a-singer-who-has-problems-with-tempo)
Comment: Just putting out there rhythm is the single most important aspect of performing in a group, so you should really nip this issue in the bud as soon as possible. Shevliaskovic's suggestions should work well.
Answer: What I would suggest is to study the rhythmic part of the song. Practice the values of the melody rather than the melody as a whole, along with a metronome or some instrument. After you see that you can sing the rhythmic part correctly, sing  the melody as a whole, again with a metronome or something. Then try singing it with your band.
Comment: Additionally, don't "wait" for the beat. If you wait to sing a note until you hear the beat that that note is supposed to fall on you're going to be late.
Answer: One technique that I've learned from an experienced vocal coach is to use a recording or a backing track and just try to speak (instead of sing) the lyrics in the correct rhythm. In this way you only concentrate on the rhythmic element and you totally ignore the melody for the moment. Only after getting that part right should you try to combine the rhythm with the melody.
Answer: You may want to think about what songs you are attempting to play.  As a lyricist and a poet, I find it very interesting that, in a poem, you are stripped bare of any rhythm/tempo except that which is in the accent on words themselves.  In music, you can sort of force the words into the rhythm of the music.  So, you may be attempting songs that are just difficult to find the rhythm of the song.  It may benefit to find songs, initially, that are a pretty straightforward match between rhythm and wording.
As a more detailed example, in poetry, iambic pentameter requires that every other syllable is stressed.  In music, you can force a syllable to be stressed, even though the stress is not natural.

Difficulty singing along to a beat


What type of bearing could be used to keep a utensil level while being moved from plate to mouth?

Question: I need a bearing that the inner bore will stay level and balanced when the out ring is rotated. My son with autism lacks the motor function to feed himself with a spoon. He can turn his wrist, when the spoon goes to his mouth its 90 degrees off. I need to be able to insert bearing into a handle and have a spoon in the bore that will stay level.
Comment: My understanding is that you want the 'plate' of the spoon to rotate around the long axis of the spoon, with the hollow face always oriented upwards for no spillage?
Comment: Plenty available commercially. Search for [swivel spoon and fork](https://www.google.ie/search?q=swivel+spoon+and+fork) and hit the _Images_ link.
Answer: One difficulty here is that the masses involved are quite small so you need a very low friction bearing. Many industrial bearings are designed for high loads and speeds with quite close tolerances so in many cases they can be a little stiff under small forces even though this is small in the context of their intended application.
In your case you might be better off with a plain bearing with quite loose tolerances, for example a polished stainless steel shaft in a Teflon bushing as low friction is a much higher priority in this case than eliminating radial play.
One approach would be to use a teflon rod with a hole down the middle as the handle and have the shaft of the spoon attached to a ground steel rod which passes through it. Using the full length of the handle as a long bearing will support it better and give you more room to work with rather than trying to find a small bearing which fits forward of the handle.
It will also help if you can 'crank' the shaft of the spoon so that the contents of the spoon are a little lower than the axis of the handle so you get a pendulum effect, similarly you would want to keep the centre of mass of the bowl of the spoon as low as possible.
If might help if you made up a prototype in aluminium so that it is easy to bend by hand and quickly try different bend configurations to quickly work out what works best.
Answer: I'm gonna assume you need the spoon's plate to work like a gyroscope, where whichever way your son moves & holds the spoon handle, the spoon's plate stays upright.
I think you need a gimbal bearing.
The standard gimbal bearing:

This ball bearing was used to stabilise a camera, and I think the lessons from the project could be applied in stabilizing your spoon:
Comment: If I where to use a gimbal. Wouldn't I need the center of mass perfectly in the center of bore. Also if this helps I only need the spoon to stabilize on a horizontal plane. I doesnt have to keep the spoon from tipping forward.
Answer: The first question any engineer, if faced with a new problem, is if it allready has been solved. I assume you talked to people with similar special needs (unable to bend wrist) or their caretakers and didn't come up with a good solution.
I think the question for what kind of bearing you want is a sideshow, the first question is if your design is viable. I think not:
I assume your son holds the spoon before him, lower arm more or less level with the table, shoves the spoon into the food. Then he tilts the lower arm upward or upward without compensating in the wrist, so the plate of the spoon ends up upright. I assume there is litte inward movement, because then you'd have spillage towards the handle. So to achieve your goal - have the meals less frustrating and messy - you need make sure the palte of the spoon stays level.
Before you think about bearings, you need to consider which forces act on the spoon. In a spoon as in your drawing, the center of gravity of spoon + food will be close to the axis of rotation. Here's my proposal: the spoon attaches to a rod that runs the length of the handle. At the back side of the handle, the rod protrudesand makes an L-bend downward, where you attach a small weight. This will turn the spoon in the desired direction.
For the actual build, I think Chris Johns approach is best:

In your case you might be better off with a plain bearing with quite loose tolerances, for example a polished stainless steel shaft in a Teflon bushing as low friction is a much higher priority in this case than eliminating radial play.
One approach would be to use a teflon rod with a hole down the middle as the handle and have the shaft of the spoon attached to a ground steel rod which passes through it. Using the full length of the handle as a long bearing will support it better and give you more room to work with rather than trying to find a small bearing which fits forward of the handle.
Answer: I've been miming eating with spoon without wrist movement and I'm not quite sure I understand the problem correctly.
From my understanding using a gimbal bearing would more of a psychological torture device, and the solution is simple! The spoons handle only needs a dog leg in its handle,say 45 degrees, and/or the users nose length from rear of spoon to the handles upper bend of dog leg for obvious reasons, from there you could have a standard bearing fixed to either end of the remaining handle and tubing cut to desired length with inside diameter appropriate to the outside diameter of the bearings then slide/press bearings into tube.
HOWEVER!!! It will be imperative that consideration is made as to the action of loading the spoon with food... If the user targets the food with a forward trajectory it would work fine, BUT!, should the need arise to drag the spoon from the rear of plate/bowl/dish to the front or vice versa as you would for the proper etiquette of soup consumption, this design is flawed.
The key to circumventing this flaw is to limit rotation by way of two keys counter sunk into each end of tube handle immediately behind the bearings ends that face the inside of the tube and two more keys fixed to the inner shaft/axle between the tubing keys to limit rotation. I would also suggest making the rotational travel limiting keys customisable by identical multiple fixing points for two opposing outer keys.
Comment: Would you mind including pictures or diagrams of what you're suggesting? I'm having a hard time imagining what you mean when you talk about the dog leg with the bearings and keys.


Why is the time interval between two events measured by two synchronised clocks seperated by a distance not proper?

Question: Suppose that in an inertial frame two events A and B occur at two different places. If all the clocks are synchronised then why is the time interval (difference between the time of event A registered by clock A and the time of event B registered by clock B) not proper time interval? Is it only because the readings are taken from two different clocks at different position?
Comment: What do you take to be the meaning of a *proper time interval*? In SR, I'd take it to be the time between events as measured in a frame of reference in which the events occur in the same place. So your proposal is wrong by definition, with no subtlety involved. You should now be able to inhale once more.
Comment: I note that you are using Resnick 's $Introduction\ to\ SR$. He defines (on p 63 in my edition) the proper time interval as the time interval recorded by a clock attached to the observed body. This is equivalent to the definition I gave above, provided that the body is not accelerating. So I repeat my claim that your proposal is wrong because it goes against the very definition of proper time. John Rennie's answer below rightly points out that the $significance$ of proper time  goes beyond this simple definition (much as the constant $c$ is about much more than the speed of light).
Comment: yes,I did read that on Professor Resnick's Introduction to SR. But I didn't understand why we need to define proper time in this way, and that is because I didn't have very clear idea about space-time interval. But now I got very satisfactory answers, specially from Professor John Rennie, and Safesphere's answer was also very helpfull.
Answer: The proper time is the length of a world line between two points in spacetime. It is calculated using the metric, which in special relativity is the Minkowski metric:
$$ c^2d\tau^2 = c^2dt^2 - dx^2 - dy^2 - dz^2 $$
We often define a proper distance instead and this is related to the proper time by $ds^2 = -c^2d\tau^2$. Typically we use the proper time for timelike paths and the proper length for spacelike paths to avoid ending up having to square root a negative number.
The proper time depends on the world line. For any two points $A$ and $B$ there are an infinite number of paths that connect those two points, and those paths will in general have different proper times. However in introductory SR courses we frequently only consider straight lines joining the two points, and in that case for the two points:
$$\begin{align}
A &= (t, x, y, z) \\
B &= (t+\Delta t, x+\Delta x, y+\Delta y, z+\Delta z)
\end{align}$$
the proper time for a straight line joining $A$ and $B$ is simply:
$$ c^2\Delta\tau^2 = c^2\Delta t^2 - \Delta x^2 - \Delta y^2 - \Delta z^2 \tag{1} $$
Suppose in your example the two event are in the same place i.e. $A$ and $B$ are the same point. Then $\Delta x = \Delta y = \Delta z = 0$ so the proper time calculated using equation (1) is:
$$ \Delta\tau = \Delta t $$
So in this case the proper time is equal to the time interval between the events i.e. the proper time $\Delta \tau$ and the coordinate time $\Delta t$ are the same. But if the two events have a spatial separation the proper time and the coordinate time will be different.
The significance of the proper time is that it is an invariant i.e. all observers in all frames of reference will agree on the value of $\Delta \tau$. However different observers will disagree about the value of $\Delta t$.
If you're interested in learning more bout this an excellent place to start would be right here on this site. A search will find you lots of related questions and answers. This is a particular hobby horse of mine, so starting with my posts on the subject would be an option.
Comment: @sid: the terms *proper time*, $d\tau$, and *proper distance*, $ds$, tend to be used interchangeably. They are related by $ds^2=-c^2d\tau^2$. The proper distance is what I would usually call the *interval*, but as you say they are basically all the same thing.
Comment: Sir, is there any difference between proper time interval and space-time interval? I think both are the same thing with different name. Please, Correct me if I'm wrong.
Comment: Hmmm...Got it Sir :)
Answer: Proper time is your time measured by your clock. It is the time passed in your frame of reference regardless of how you moved. So the proper time is local to the observer. There is no such thing as "proper time between you and me" or "proper time at a distance" or "proper time between two separate objects".
A proper time interval is the distance between two events on a trajectory of an object in spacetime. If you have two objects, each would have its own trajectory and they would be separated. If you measure the distance between one event on one trajectory and another event on another trajectory, it is easy to imagine that the line connecting these points would not represent an actual spacetime trajectory of any object.
Comment: @sid Special Relativity can be explained at very different levels, so I cannot pick a reference, sorry. Just google and read what you understand. Instead, let me explain the interval. Take a sheet is paper and draw coordinates, time and distance. A straight line parallel to the time axis is for a non moving object that only moves in time. An angled straight line is a constant speed movement. A curved line is a movement with acceleration. All these lines are spacetime trajectories. Yet none of these objects move in their own frame, except in time. So every trajectory is the time axis for [...]
Comment: Yes,though your answer is very precise clear and highly appreciable, but one thing you need to understand that I'm a beginner in SR, and my study material is only a book of Professor Robert Resnick. The understanding of space-time, invariace of the interval etc. are not very clear to me.So, One more thing I want to ask(may be that is irrelevent in this discussion).  Can you please suggest me some study material/books where I can get such arranged topic wise discussion about space-time interval?
Comment: @sid [...] that observer. These lines are called world lines. Because in your own frame you move only in time, the distance measured along your world line is simply time measured by your wristwatch. It is called your proper time. Essentially, your spacetime trajectory is the time axis in your frame of reference. Straight lines - special relativity; curved lines (acceleration) - general relativity. Interval in general is the distance on this diagram between any two events, but it is only "proper", if both are on the same world line. Good luck and please check the answer that helps you most :)


Why does a corn cob turn black?

Question: We buy fantastic fresh corn from the farmer's market.  If we leave it for a few days, sometimes the cob underneath the kernels has turned black.  However, the kernels are still golden and taste fine.
Why does the cob turn black?
Comment: I haven't seen this before. A picture would be interesting. How are you storing them?
Comment: Good idea, but I've pitched all the examples. :)  I've been refrigerating them.
Comment: Try this link from Mississippi State University. http://msucares.com/crops/corn/corn7.html
Comment: @da Thanks for your contribution, but it doesn't answer the question of why the **cobs** turn black **after** harvest.
Answer: Perhaps this is cob rot, as described here, or one of the many other diseases described there.
This page describes black corn, which can apparently infect the cob.
Many pictures of diseased corn are shown here, perhaps one of them may match your case.
There seem to be a few varieties of fungal infections that would infect an ear of corn, some of which are apparently edible, as shown here.
Overall, it appears there are many varieties of fungal infections that can attack an ear of corn, so its difficult to be sure which one you saw.
Answer: Or, since it tasted fine, it is highly likely it was picked just after the growth peaked. Read about it here: https://www.pioneer.com/us/agronomy/kernel-black-layer-formation.html
Answer: Not sure this is a useful answer as such, but I have seen this myself. Last week I had corn and the ear (or cob) inside wasn't completely black, but did have the beginnings of blackening at one end, where the tassels would have been, with streaks penetrating the cob itself, yet, as you say, the kernels themselves were fine -  looked normal, tasted normal. My assumption is that it's some kind of fungal infection, possibly present in the tassels, and the longer the corn cob is stored, the blacker the ear becomes, as it degrades. Without keeping them for longer to see what happens, I can't say whether they eventually do become completely black.
Having said all that, though, I can't find any real evidence to back up this theory. Smut is the obvious contender, and it certainly can be present on the tassels, but it usually ruins the kernels rather than just the cob itself.
I suppose its possible that the particular variety of corn where you find this to be the case is one where this feature is normal, but again, I can't find a variety listed that mentions this attribute.

Why does a corn cob turn black?


virtual fax modem + fax service + console for viewing faxes

Question: I'd like to be able to setup faxing by running a virtual fax modem.  I don't understand how fax messages are sent and received, and I don't know much about COM, or how the fax modem communicates with a fax service.  I've read forums out there, but I haven't found a very good explanation on this topic, nor a good tutorial on how to set it up with open source products.  If anyone knows of something that's cheap to buy but works excellently, then by all means, let me know.  Also, will I need to purchase a dedicated phone number (land line) for setting this up?  I want to be able to receive and send faxes.  I might be on the wrong track here, because I wasn't sure if faxes could be received virtually either.  That's another question I had.  If this post is horrible and should be split out into separate questions, let me know and I will do so.  I'm open to running things in Linux or Windows.  I will vote up for any feedback what so ever.  The first thing that works well I will mark as the answer.  Trust me, if you give me some good feedback, it shouldn't take me long.
Answer: You're looking for HylaFAX. It uses a getty-alike to receive faxes and email them appropriately, and either a CLI tool or a virtual printer to send them.
Comment: Have you set this up before, or did you just Google it?
Comment: I set it up years and years ago, but haven't had a need to do so since then.
Answer: Also look into Esker VSIfax. It's commercial, but is a fully featured automated fax suite. It runs on Windows and Unix variants, with the ability to submit jobs to virtual fax servers.


Can I use a Canon 430EXII off-camera with just a Yongnuo YN-622C-TX?

Question: I'm using a Canon 430EX II with a 6D camera. Can I use the flash as a slave with the Yongnuo YN-622C-TX without any transceiver attached to the flash?
I'm really looking for the cheapest solution to use the high sync option of the flash wirelessly. Any advice is appreciated.
Answer: No. The Yongnuo YN622C-TX is a radio transmitter. The built in receiver in the 430EX II is an optical receiver. The two are not compatible without a radio receiver YN622C on the 430EX II. The YN622C runs about $35-40.
Your other budget option is to use a 90EX as a master flash to control the 430EX II. They go for around $45 on eBay. But the small size and guide number of the 90EX means the range will be somewhat limited, especially outside in bright light. The 90EX is marketed as a compact flash for the EOS M series of cameras, but it will control any slave flash compatible with the Canon E-TTL wireless optical system. This includes HSS functionality.
Answer: You will need to have a YN622C tranciever attached to the 430EX II.
Answer: No.  The 430EXII does not have a built-in receiver for the radio signals the YN-622C-TX transmits.  You'll need to purchase a YN-622C transceiver to use as a receiver on the foot of the 430EXII.
The only Canon flashes that have radio receivers built in are the 600EX-RT and the 430EX III-RT, and those use the Canon RT system, not the Yongnuo 622 system, so you'd have to go with a YN-E3-RT or other Canon RT master unit instead of the YN-622C-TX; or consider getting a wireless eTTL master unit and use the built-in optical slave in the 430EXII, but you'll have all the range, reliability, and line-of-sight issues of an optical system.
Alternatively, you could purchase a YN-685 flash, which has a YN-622C receiver built-in, instead of using a 430EXII. It's more expensive, and a big unit (larger than a 580EXII), but more convenient, since you don't have to pack the trigger and its batteries--just the flash.
But getting a $40 YN-622C transceiver is probably the cheapest route.
Comment: Muchas gracias, valuable info


How to bring Cholesterol down with workouts

Question: I did a blood test and my cholesterol level was 202mg/dL from 200.  I am little above normal.  Everyday, I eat meals that include cholesterol (3 meals.)  My age is 23, my height is 1.79m and weight is 68kg. Now, I every day walk at least 2 hours.  Yesterday, I walked more than 4 hours.  Once a week I go for football for two hours.  Also, I do my whole body workouts.  I don't eat anything that has sugar.  Now, is this "program" good to bring down cholesterol levels?  What workouts will give good results?
Answer: Research on Exercise and HDL Cholesterol

Exercise helps increase the production and effect of certain enzymes that enhance this "reverse cholesterol transport" process. A study conducted a few years ago analyzed how exercise type, frequency, and intensity impact HDL cholesterol.

While exercise regimens varied, on average patients in these studies
exercised for 40 minutes, 3-4 / week, and the effect on HDL was
measured after 8 to 27 weeks.
Across the studies, participants had increases in HDL cholesterol
averaging about 2.5 mg/dL. This increase in HDL cholesterol was only
modest but was statistically significant.
Furthermore, since cardiac risk is thought to drop by two to three
percent for each 1 mg/dL increase in HDL, a 2.5 mg/dL rise in HDL may
actually amount to a substantial reduction in risk.

Perhaps the most interesting finding from this study is the observation that the duration of exercise sessions - and not the frequency or intensity of exercise - correlated the best with rises in HDL levels. The investigators report that in research subjects exercising for at least 20 minutes, each additional 10-minute increase in exercise duration increased HDL levels by an additional 1.4 mg/dL.

Other Lifestyle Changes to Boost HDL Cholesterol
The results of this study indicates that exercising at least three to four times per week for at least 20 minutes will help you increase your HDL levels. In fact, increasing the duration of your exercise sessions by pacing yourself (that is, by going slower if necessary) appears to be the best way to translate exercise into higher HDL levels.
In addition to exercise, other lifestyle changes can help you increase your HDL level. These include:

Quitting smoking, which can increase your HDL cholesterol by up to 10
percent.
Losing weight: For every 6 pounds lost, HDL may increase by 1 mg/dL.
Choosing healthier fats such as the monounsaturated and
polyunsaturated fats found in olive, peanut and canola oils as well
as nuts, fish and other foods containing omega-3 fatty acids.
Consuming alcohol in moderation: No more than one drink a day for
women and two drinks a day for men age 65 and younger.

Source: https://www.ncbi.nlm.nih.gov/pubmedhealth/PMH0023971/
Answer: It is important to emphasize that two numbers of cholesterol levels exists: LDL and HDL.
To stay healthy you want to keep LDL low and HDL high.
Usually, it is hard to change the LDL level by exercises. A reduced fat percent of your body or a diet could be the proper tool.
HDL can be increased by cardiovascular exercises. Such exercises may just be running.
This paper mention a threshold of 7 to 10 miles/week to increase HDL.(Men)
Keep in mind that you have to do exercises for a longer period to achieve a measurable effect.
Don't expect any changes in the blood test before doing exercises (running) for several months.
Football two hours a week might be very helpful. Walking is just fine too, but I think you could spend your time better doing short workouts at a high heart rate, if you walk two hours a day just for staying healthy.


how to set a node to sleep in ns2

Question: I just want to set a node to sleep in "ns-2" and i have searched in protocols and i found a lot of objects and functions about sleep but i couldn't use them in other protocols to set a node to sleep.
When i use them i get Segmentation fault or Floating point and i know what these errors mean but i can't find a way to solve them.
Like when i use sleep() function from "SMAC".
I have searched in google and after a week i still didn't find any solution...! could you guys please help me here...?
Answer: I have found the solution months ago but i saw this question of mine so i said let's answer it so, people like me that couldn't find the answer until going through all that trouble, could easily find out how to solve it...
Well first of all let me introduce you to protocol's codes in ns2.
A protocol has been created with 2 main files(there is some protocols with only one file too but i'm talking about the most of them) in ns2 that one of them has .cc type that contains the protocol's name(like AODV.cc) for definition and the other one has the .h type for declaration and it also contains the protocols name(like AODV.h).

There could be other files including the protocol but the main is protocolname.cc.

We need to change/add some functions in the protocolname.cc so we could simulate our own protocol.
For example :
We need to use clustering for our protocol :
AODV.h :

public:
    AODV();
    void CLUSTERING();
    ...

AODV.cc :

void AODV::CLUSTERING(){
    if(current_){
         while(numberofNodes){
               // Selecting clusters
         }
    }
}

Now we know how the mechanism of ns2 works.so let's get started with sleep nodes.
First of all there is 4 functions in ns2 for turning a node to 'off', 'on', 'sleep', 'idle'.
The difference between these are not so big.
As you know the 'off' function turns a node to off but it still broadcasts something based on your protocol.

$ns_ at 7.0 "$node(2) off"

And you can turn it on like :

$ns_ at 7.0 "$node(2) on"

The base is :
$simulator at $time "$Node_($number) off"

I don't know how to set a node to sleep in scenario.tcl but you can do that in your protocol's codes.
Now, to set a node to sleep we could do several things...

setting nodes to sleep from energy model
setting nodes to sleep from wireless physics

First we'll try energymodel.cc and if it didn't work we'll use the other one.
To set a node to sleep from energymodel.cc we can use this code in void Mac802_11::recv function in ns-2.35/mac/mac-802_11.cc :

if(index_ == myNode){
    EnergyModel *em = netif_->node()->energy_model();
    if (em && em->sleep()) {
        em->set_node_sleep(1);
        //em->set_node_state(EnergyModel::INROUTE);
    }
}

Replace myNode with the number of the interface you want to set it to off.
If you are not using MultiInterface for your simulation so the number of interfaces will be equal to the number of your nodes.
example :
Normal :
            node ---- > interface ----> channel

MultiInterface :
                         ---- > interface[0] -----|
                        |                          ---------|
                        |                                   v
            node -------|---- > interface[1] --------- > channel
                        |                                   ^
                        |                         ----------|
                         ---- > interface[2] -----|

Open a terminal and cd to your ns2 directory, for example if you have ns-allinone-2.35, cd to /ns-allinone-2.35/ns-2.35/ and now type make and inter.
After it finished try to simulate your scenario.tcl.
Now if your simulation start and you see the nam file, when the nodes get the first packet, the shape of them must change from balck circle to black circle blue hexagon.
From then on the nodes must not send or receive any data packet.
If this way didn't work now it's the time to use the other option.
Go to /ns-2.35/mac/ and open wireless-phy.cc.
You'll see that at the end of the file it contains our 4 function that we need.
we can simply use those function on the wireless-phy.cc to set a node to sleep or off by just calling those functions.But we may need to use them in another layer like in mac.
To use those functions in mac-802_11.cc simply use the below code anywhere you want in mac-802_11.cc and add wireless-phy.cc to your mac headers:
 #include "wireless-phy.h" // at the header of mac-802_11.cc

 /*
  * Use the below code in any function you want in mac
  */
 Phy *p;
 p=netif_;
 ((WirelessPhy *)p)->node_sleep();

And to use another one of those 4 function just change the function's name like ->node_sleep(); to ->node_wakeup();.
Answer: A node can be "Off" and "On" by invoking WirelessPhy::command(int argc, const char*const* argv) of WirelessPhy.cc from Tcl script. To do this, say for Node_(0), once the node is defined in Tcl script, do:
set        Netif_0        [$Node_(0) set netif_(0)]

Note that the variable netif_ is an array and hence we use netif_(0) to get
the handle for the first Network Interface. netif_(1) and netif(2)...
can be similarly used for Second and Third Network Interfaces, if the node
was configured with multiple interfaces.
Once the handles are brought to local scope, we can use any command that is
defined in WirelessPhy and we can use $Netif_0 NodeOff to switch off the node to deactivate the Network Interface.

how to set a node to sleep in ns2


Does a Historical Traffic Chart for the Stellar Lumens Platform Exist?

Question: I'm aware of https://dashboard.stellar.org/ to view live platform transactions, but I would like to access a historical growth chart. As new apps and tools get brought on board, and as more people transact with Lumens, I'd like to have access to review true transaction platform growth.
Does a chart or an online tool exist for this data? For example, I'd like to see a chart of daily transaction volume over one or two years on the network.
Answer: Looks like Steller Expert offers some of this information.


How can you insert more emotions in scenes?

Question: I have a scene where my character has to feel scared, sad and alone. I'm good at describing her surrounding but describing feeling are a bit harder for me. I also have scene where she has to be heartbroken but I feel like it sound stiff and simple.
Comment: What POV are you writing in? First, third omniscient, close third?
Answer: Hemmingway has some solid advice (tip 5). Don't describe the emotion, describe the thing that caused the emotion.
Imagine a young couple, expecting their first child, and suffering a miscarriage. It's probably very difficult to describe accurately what that feels like, but even if you succeeded, it wouldn't make the reader actually feel it. If, however, you describe the sequence of events that caused the emotion: sudden stomach pains, the husband rushing to the hospital, waiting for hours to see the doctor, all that tension will induce emotion in the reader without you ever describing what anything feels like.
It's events that make readers feel, not descriptions of emotions.
The further you trace the events back, the more you layer the emotion. Contrast the shock of the miscarriage by showing the joy of a successful pregnancy. Of course, don't describe the joy, show the difficulty in getting pregnant, and then release that tension. Go back further, why does becoming a parent mean so much to both of them? The further back you go, the bigger the payoff.
Comment: Very solid advice. Don't describe what a character is feeling, describe their behaviour instead. The result is that you don't tell the reader what they are supposed to feel, you allow them to form their own reaction.
Answer: Well, to be honest, this is a perfect example where you want to show how the character is feeling. So have a thinking about what your character is doing in response to this heartbreak and insert this into the scene.
Like, I have a character in my novel, in one part, she is nervous when she is ambushed (quite by accident) by another character at a quiet moment, so I relay this in her behaviour. Fidgeting with her fingers, deliberately moving out of this person's way, hesitating to follow, walking but with distance.
So how does that heartbreak manifest? Is she crying? If so, what sort of crying is it - overwhelming, thick and fast tears? Or is she feeling numb? Can you show that by her not hearing what another character might say to her, or just aimless gazing out a window?
This isn't a comprehensive list of what you can do, but the emotions will show as you show what is going on.
Answer: If you are willing to be mean to yourself, maybe listen to sad songs, or read sad things, or tap into past memories of when you felt sad/heartbroken yourself (this applies to any emotion). Remember how your body responded then. Maybe, if you get involved enough, you'll feel reactions during the exercise (if you can even call it that). Then you can incorporate those into your writing.
Also, we all know that cliches and very overused tropes sound stiff and simple. They pull readers out of the story and make them go "Aha! There's that thing again! The author is trying to display _____!" So avoid using those kinds of things that you've seen a lot before, I guess.


Determining number of clusters in high dimensions

Question: I am doing KMeans clustering for sentence embeddings and my problem is the number of clusters. In general, feature size is an order of a few hundreds (in this case 768) and my concern is the sparsity of space. I tried to use gap statistic, but it just increases monotonically and has no maximum (I ended up with max 2048 clusters). Also, embeddings lie on a n-dimensional sphere rather than fill the space uniformly. My questions is: does it really make sense to use various "clustering metrics" to determine optimal number of cluster when the feature space is large?
Answer: There isn't a correct way to approach this problem. One common way is what you are doing, i.e.  check for various values of $k$ and have a heuristic tell me the best value. Some such methods are are the elbow, silhouette and the gap statistic that you're using. Determining the number of clusters via such a method is perfectly valid; in fact that's what they're for.
Another approach would be to try hierarchical clustering on the data and see which level leads to the maximum difference in variance.