Images deleted after taking taking memory card

Question: i used 2gb memory card for 5 months in my HTC mobile, i have unmounted it and removed it safely to replace it with 16gb. but now when i try to connect the 2bg card to system and copy the images through adapter, they are lost...every other data is there except the Pics which i took using camera. please help me to recover that pics
Answer: If you have not overwritten the data in the 2GB memory card, then you can recover the pics using "Recuva" in Windows PC. The software is available for free download online. Install the software, connect the adapter, select the drive through the application's interface and you will be able to recover the pics.
Answer: I assume (only assume, not sure) that those pictures are not on your external memory card but on your internal one (often referred as SD card).
If you haven't configured the camera to explicitly use your external SD card, all your pictures are on your phone's internal storage, independently of your external one.
Look at your pictures folder on your internal storage. There is a good chance that you missing pictures are there.
Comment: the camera storage was explicitly set to memory card which i removed.by the way the phone memory doesnt contain any pics
Comment: Well then you may follow Mr. Tech's advice.
Comment: @saikumar Though you might think so, check twice. You might have "2 SD cards" in your device: the external one you're already considering, and an "internal SD card" (also called "emulated"). Sometimes one needs to really take a closer look to see which one is meant by dialogs. You could use a file-manager on your device to verify. Also, opening the "Gallery" app could help: are the pictures still shown there? Then they're most likely stored on the "internal SD card".
Answer: If all the other data is there and you have not deleted the pictures, then the pictures must be there in the sdcard, unless someone else deleted them or moved them.
Try inserting the old sdcard into the phone and see if the phone displays your pictures. If it does, connect your phone to PC in camera mode and save all pictures to your PC.
If the phone also does not show the pictures, you can try the Dara recovery as suggested by Mr.Tech
Comment: Did you get your images back?
Answer: If you have to many  pictures they show  blank  so you should  get a picture program that allows you to make stalks of your pictures to  save room and more  can be keep  on the phone that way


Magento 2.3 grunt compile

Question: My simple question is that, Do i need to compile less with grunt in magento?
My theme is working fine. However i am not sure that i need to compile less with grunt or not.
Is there any impact on performance ?
Please suggest what is best method ?
Answer: There will be no performance gaps. Official Magento documentation offers this way. More details here: https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/css-topics/css_debug.html
Comment: I assume we dont need to compile as magento automatically compiles it.
Then why they provided documentation to compile?
Answer: The short answer is no
The longer answer is that you can do although I've experienced some issues using grunt. Grunt is faster and at times gives more meaningful error messages.
The main issue is that it doesnt factor theme inheritance the same way static content deploy does. Which can lead to errors.
So personally I don't recommend using grunt. Certainly nothing beyond development.

Magento 2.3 grunt compile


Detect Function call or Transaction when no Event is Emitted

Question: Is it possible to detect a contract function call using a listener, even though it does not explicitly emit an event? I want to think this is possible, because block explorers like Etherscan are able to detect functions calls/transactions, as well as their metadata, such as block hash, value, caller, etc, even when the function called does not emit an event.
Answer: You can look at the data of the transaction. The data for a function call starts with the function signature (4 bytes), followed by the parameters of the function. If you want to see if a transaction called the transfer function of a token for example, you take the first four bytes of keccak256("transfer(address,uint256)") = 0xa9059cbb. Then you can simply check if the function data starts with those four bytes.


How do I dehumidify a season cabin in the winter

Question: My Aunt has a seasonal cabin in NH. At the end of the fall we shut the water off and close down the cabin. Last year we had to gut and re-do the entire cabin due to a mold problem. Part of the problem had to do with water getting in the half basement and then mold forming, but even before that problem, it always had a mold issue. It's my understanding that it's probably the late fall early spring that causes the issue, but that is just speculation. I am interested in putting a de-humidifier in the cabin, to ensure that it stays fairly dry, but I'm concerned about the fact that it will soon get below freezing. Perhaps there is on that has a frost shutoff? or perhaps I can rig something that will turn it off when the temperature goes below a certain value. I'm looking for recommendations on how to tack this problem.
Comment: @bin it's actually the opposite, given it's a closed space ( moisture content stays constant ) Relative humidity increases as the temperature decreases ( cold air holds less water vapor ) .... unless I'm miss understading what your saying
Comment: Why do you think you need a freeze shutoff? If you have a draining humidifier, no water accumulates. And when the temperature drops, the relative humidity also drops, so it probably won't cycle on much anyway.
Comment: I may be wrong about the latter point, but where would the water freeze?
Answer: You are correct that dehumidifiers typically do not operate below freezing temperatures.  In fact, many do not operate well if the temperature is below 65F.  Certain high performance units are rated to operate down to temperatures a little above freezing.
If the goal is to suppress mold growth by maintaining indoor relative humidity below 55% during cold temperatures, then the obvious answer is that both a high performance dehumidifier and a heater are needed.  Looking at the psychrometric chart for moist air, 56F air at 55% humidity has a dew point of 38F.  With a high performance dehumidifier and a heater set to maintain an air temperature of at least 56F degrees, the RH of the air in the cabin could be maintained at or below 55%.
Comment: The coldest the air can get on a good evaporator coil is roughly 5F warmer than the boiling refrigerant in the coil.  The boiling refrigerant must be above 32F or the coil collects ice.  33+5 = 38F.  That is about the coldest the discharge air from the evaporator coil can be during continuous running without freezing.  Consequently, the dehumidifier cannot lower the dew point below that..  At that dew point, the air must be heated to at least 56F to achieve the desired low humidity.
Comment: Hi Chris, I don't understand where the 38F dew point comes into play?
Comment: How much do you think it'll cost to heat a cabin all through a New Hampshire winter? It's probably safe to assume that it's not even  insulated. I don't think that's a practical suggestion.
Comment: I imagine it would be costly.  Other than what you tell me, I know nothing about the details of your particular situation.  Good luck with whatever you decide.
Comment: @MikeB:  My answer is not really a suggestion.  It is more of an answer to the OP's question.  If you have a practical suggestion for the OP, please post it.
Answer: To dehumidify in the late fall/winter/early spring you don't need a dehumidifier at all. Simply adding heat will automatically lower the relative humidity. Of course, if you did not heavily insulate when rebuilding the cabin, this will be expensive to do.
You could get cute and use a humidistat to control the heater rather than a thermostat, but you can also simply run a small heater full time.
Comment: You are correct, of course. I see the average climate in the fall for Manchester, NH is temperature around 60F with RH around 75%. Under those conditions heating the building to about 70F would achieve 55% RH indoors without a dehumidifier. Perhaps mold resistant building materials would be better than either one.
Comment: Great idea to use a humidistat to control the heater, BTW.


Rails email double escaping single quotes

Question: I have a mailer in rails for a number of different emails, one of which is sent to notify users that another user has commented on something.
When the email is generated, it includes the content of the comment, so I need to ensure that the comment is escaped, which rails is doing for me by default just like in all views. This is great, but when it comes to a single quote such as apostrophe's in words, it seems to be getting double escaped. The email I receive, shows
" It's all about the quotes isn't it. "

And if I inspect the HTML of the email in the rails log, it shows that the HTML produced is
" It&#x27;s all about the quotes isn&#x27;t it. "

So it's being escaped correctly, but then something is escaping it a second time.
My view is an html.haml file.
I've tried outputting the content with the raw command but it didn't make a difference so I'm pretty confused as to what's going on. I know in rails 3.2.8 they changed the escaping of single quotes, so I am expecting to see the ' but not the & as well.
Answer: Turns out it was a change one of the other developers had made. They'd added sanitisation to the input so it was being escaped before being stored, and then rails was escaping it when displaying so it was being double escaped. Sorted now :)


Is it a good idea to publish the white paper describing the technology right after filing patent application?

Question: I will publish patent application and I want to share my invention with others right after that. I want to see if there will be any interest from investors. Are there any dangers associated with such a disclosure (as the priority date is granted already)?
Comment: One way to handle discussions with investors is the use of non-disclosure agreements.
Answer: If you were to file another application claiming priority from the first patent application, and you were to further add new embodiments in that another application, then the publication of the white paper will be prior art against those new embodiments in countries/regions where you do not have a grace period. This means that claims directed to those new embodiments might not be novel or non-obvious over your white paper.
There are many factors that should be taken into account when deciding whether the publication is a good idea or a bad idea: the patent application itself, the technology of the invention, competitors, business model, etc.


Program languages recommended for complexity theory

Question: I am an undergraduate studying mathematics and one of my interests include complexity and computability theory. I have no experience in programming.
The computability theory books I looked into didn't seem to require the need to learn a computer language however books on algorithms always do. My question if I want to learn more about this field do I have to know programming languages or can I learn the topic from a purely theoretical perspective? And if programming languages are required to explore complexity and computablility, which would you in your experience say are the languages that would be best to invest in at an earlier stage of my education? Thank you.
Answer: If you want to learn about algorithms, it is a very good idea to learn programming. It always helped me to understand the algorithms, if I also programmed them. And if you are good with understanding algorithms, programming will not be very hard.
As programming languages i recommend python and C/C++
Comment: I would certainly recommend implementing a few standard algorithms and data structures. On the other hand, with more advanced algorithms it is often quite hard to implement them. Even if doable, it takes a lot of time that could be better spend on other things.


Disc brakes 29 inch bike

Question: I have a 2018 se big flyer and it has regular v brakes i was wondering if I could upgrade to disc brakes in front and back. I have look other places but no has anything to convert it.
Comment: Other questions on disk brake conversion https://bicycles.stackexchange.com/questions/16362/how-do-i-know-whether-my-bike-can-use-disk-brakes ,
Answer: If this is the bike at http://www.sebikes.com/bikes/cat/rad-series/big-flyer-29
Then it can't be done. The frame and fork lacks mount points for disc brake callipers.
Comment: If it's that bike... seriously, who makes a bike with only a rear brake? That's possibly the dumbest design decision I've ever seen.
Comment: It's for people who want to do barspins and either don't understand braking or can't afford gyro.
Comment: I think it is not unusual for BMX bikes to have only rear brakes or none at all. There seems to be a demand for BMX bikes with large wheels, eg for people who are too large for typical BMX bikes, or those who rather cruise than do tricks. The bike mentioned in the question appears to be such a bike.

Disc brakes 29 inch bike


What is the difference between rebirth and reincarnation?

Question: In my readings of Buddhist commentary there is a distinction drawn between rebirth and reincarnation. But to me it is unclear what is the difference between rebirth and reincarnation--the explanations are rather abstruse. Is there a simple one-sentence explanation of this difference?
Comment: It would be great to have the precise terms in original language, that would make it much easier to answer. Can you provide them?
Comment: i downvoted the answers cos they don't say why 'reincarnation' implies a soul
Comment: now i wish i had not, but cannot reverse my vote. my [question here](https://buddhism.stackexchange.com/questions/21284/why-deos-rebirth-imply-there-is-no-soul) should i hope answer the question i've posed more thoroughly
Answer: Reincarnation implies a soul that takes a body; rebirth does not, so it is preferred.
Note that neither term has a widely used cognate in the Pali texts, perhaps because the concept of "re-" anything implies the continuation of an entity. Buddhism tends to talk about birth and death in a more linear fashion; rather than being reborn, it's "being born again" (e.g. dukkhā jāti punappunaṃ).
Further, the focus in Buddhism is on individual mind states and ultimate reality rather than the conceptual reality of birth and death, so it's not really a core teaching. Death is a concept; at the moment of a being's death, one body/mind experience ceases and the next one arises, just as it did through the entire life.
Answer: The Buddhist Pali word 'birth' ('jati') refers to the arising of the self-view of 'a being' ('satta').

And what is birth? The birth of the various beings into the various orders of beings... SN 12.2
'A being,' lord. 'A being'. To what extent is one said to be 'a being'? Any desire, passion, delight or craving for form... feeling... perception... fabrications... consciousness: when one is caught up there, tied up there, one is said to be 'a being.' SN 23.3
Why now do you assume 'a being'? Have you grasped a view? Just as with an assemblage of parts, the word 'chariot' is used, when the aggregates are present, there is the verbal convention of 'a being.' SN 5.10

The many different Pali words translated as 're-birth' essentially refer to the re-arising or re-formation of the self-view of 'a being' due to kamma (action).
For example, under the influence of self-view, a person undertakes a financial scam & celebrates when they become or are 're-born' financially wealthy. Then, when they are imprisoned for fraud, the same person is re-born as a prisoner in a jail & are unhappy.
In summary, despite the different interpretations, 'rebirth' is always a doctrine of 'moral efficacy'.
Where as 'reincarnation' is always a metaphysical doctrine of the soul or some other mental substance entering a new physical body.
A Buddhist can believe in moral 'rebirth' but not believe in 'reincarnation' (life after death).
Answer: Reincarnation involves a soul that transmigrates. A soul is the five aggregates minus physical form.
Rebirth is like lighting one candle with another candle. The stream of consciousness, a.k.a life force, continues from one existence to another but the remainder of the five aggregates; form, perception, sensations and mental formations (which would stay together during a reincarnation of a soul); dissipate.
Answer: Rebirth is when a soul leaves the body in the state of ignorance and then again gets a new body in ignorance.
Reincarnation is when soul leaves the body in full knowledge and such souls reincarnate only to fulfill a some mission or purpose in life.


How do you get moon zoomed over foreground?

Question: How does one get a picture similar to the one below with a crop sensor DSLR and using kit lens or 70-300mm lens without post-processing?
Answer: The trick is to use a long lens (the longer, the better), then get meaningfully far away from your foreground subject matter.
The long lens will make both the moon and the foreground appear much larger than they otherwise would. The narrower field of view does that for you. Moving further away from your foreground subject will make it appear smaller in the frame. That much should be obvious and intuitive. Double your distance, and the object becomes half of its previous size using the same focal length lens. The difference between 100m and 500m is huge. The thing is, though, that you can't make much of a difference in the distance between you and the moon no matter how many steps backward you take. The difference between 380,000km and 380,000.4km might as well not be there at all. So while the moon stays the same size, your foreground objects become much, much smaller.
Comment: +1, a great answer and thnx for the explanation
But will it be affective with a 300mm lens ?
Comment: @Sourav - yes, it will be. See [this question](http://photo.stackexchange.com/questions/24651/what-focal-length-lens-do-i-need-for-photographing-the-moon) for the first half of the equation, then remember that the moon will be half that size at 300mm.
Answer: If you cannot get the geometry to fit for practical reasons, you can double expose the shot. It is a trick used even in the old days with film, if at night with a black sky.
First imagine your shot in your head. Then take your widest angle view shot with the exposure that is nice for that. Then zoom in one the moon and expose it nicely, and place it in the frame where you want it. If at night it is easy to overlay these simply by adding them together or applying a "max" function. With the clone tool you can adjust the position of the moon as well.
If it is not dark you need to mask it in.
Here I made a fun, surreal example with a Zeiss Jena 135mm for the moon and a Pentax 50mm for the lamp post:


Running the voice recorder while in another view?

Question: Hello Okay right I have a view called 'RecordViewController' this has the voice recorder function so once the user presses 'record', it records their voice, I have also created a 'back' button. But once that back button is tapped the voice recording also stops. I want it so once the user goes back, its still recording their voice. Here is the code I used:
.h
<code>#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
#import <CoreAudio/CoreAudioTypes.h>

@interface RecordViewController : UIViewController <AVAudioRecorderDelegate> {
  IBOutlet UIButton * btnStart;
  IBOutlet UIButton * btnPlay;
  IBOutlet UIActivityIndicatorView * actSpinner;
  BOOL toggle;

  NSURL * recordedTmpFile;
  AVAudioRecorder * recorder;
  NSError * error;
  NSTimer *theTimer;
  IBOutlet UILabel *seconds;
  int mainInt;
  NSString *timeRemainingString;
}

@property (nonatomic,retain)IBOutlet UIActivityIndicatorView * actSpinner;
@property (nonatomic,retain)IBOutlet UIButton * btnStart;
@property (nonatomic,retain)IBOutlet UIButton * btnPlay;

- (IBAction) start_button_pressed;
- (IBAction) play_button_pressed;
- (IBAction)goBack:(id)sender;
- (void)countUp;

@end
</code>
.m
<code> #import "RecordViewController.h"

 @implementation RecordViewController
 @synthesize actSpinner, btnStart, btnPlay;

 - (void)countUp {
     mainInt += 1;
     seconds.text = [NSString stringWithFormat:@"%02d", mainInt];
 }

 - (IBAction)goBack:(id)sender; {
     [self dismissModalViewControllerAnimated:YES];
 }

 - (void)viewDidLoad {
     [super viewDidLoad];

     //Start the toggle in true mode.
     toggle = YES;
     btnPlay.hidden = YES;

     //Instanciate an instance of the AVAudioSession object.
     AVAudioSession * audioSession = [AVAudioSession sharedInstance];
     //Setup the audioSession for playback and record.
     //We could just use record and then switch it to playback leter, but
     //since we are going to do both lets set it up once.
     [audioSession setCategory:AVAudioSessionCategoryPlayAndRecord
 error: &error];
     //Activate the session
     [audioSession setActive:YES error: &error];

 }

- (IBAction)start_button_pressed {
  if(toggle) {
    toggle = NO;
    [actSpinner startAnimating];
    [btnStart setImage:[UIImage imageNamed:@"stoprecording.png"]
 forState:UIControlStateNormal];
    mainInt = 0;
    theTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(countUp) userInfo:nil repeats:YES];

    btnPlay.enabled = toggle;
    btnPlay.hidden = !toggle;

    //Begin the recording session.
    //Error handling removed.  Please add to your own code.

    //Setup the dictionary object with all the recording settings that this
    //Recording sessoin will use
    //Its not clear to me which of these are required and which are the bare minimum.
    //This is a good resource: http://www.totodotnet.net/tag/avaudiorecorder/
    NSMutableDictionary* recordSetting = [[NSMutableDictionary alloc] init];
    [recordSetting setValue :[NSNumber numberWithInt:kAudioFormatAppleIMA4] forKey:AVFormatIDKey];
    [recordSetting setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey];
    [recordSetting setValue:[NSNumber numberWithInt:2] forKey:AVNumberOfChannelsKey];

    //Now that we have our settings we are going to instanciate an instance of our recorder instance.
    //Generate a temp file for use by the recording.
    //This sample was one I found online and seems to be a good choice for making a tmp file that
    //will not overwrite an existing one.
    NSString *fileName = [NSString stringWithFormat:@"%.0f.caf", [NSDate timeIntervalSinceReferenceDate] * 1000.0];
    NSString *path = [NSTemporaryDirectory() stringByAppendingPathComponent:fileName];
    recordedTmpFile = [NSURL fileURLWithPath:path];
    NSLog(@"Using File called: %@",recordedTmpFile);
    //Setup the recorder to use this file and record to it.
    recorder = [[AVAudioRecorder alloc] initWithURL:recordedTmpFile settings:recordSetting error:&error];
    //Use the recorder to start the recording.
    //Im not sure why we set the delegate to self yet.
    //Found this in antother example, but Im fuzzy on this still.
    [recorder setDelegate:self];
    //We call this to start the recording process and initialize
    //the subsstems so that when we actually say "record" it starts right away.
    [recorder prepareToRecord];
    //Start the actual Recording
    [recorder record];
    //There is an optional method for doing the recording for a limited time see
    //[recorder recordForDuration:(NSTimeInterval) 10]
  } else {
    toggle = YES;
    [actSpinner stopAnimating];
    [btnStart setImage:[UIImage imageNamed:@"recordrecord.png"] forState:UIControlStateNormal];
    btnPlay.enabled = toggle;
    btnPlay.hidden = !toggle;
    [theTimer invalidate];

    NSLog(@"Using File called: %@",recordedTmpFile);
    //Stop the recorder.
    [recorder stop];
  }
}

- (IBAction)play_button_pressed{

  //The play button was pressed...
  //Setup the AVAudioPlayer to play the file that we just recorded.
  AVAudioPlayer * avPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:recordedTmpFile error:&error];
  [avPlayer prepareToPlay];
  [avPlayer play];
}

- (void)viewDidUnload {
  // Release any retained subviews of the main view.
  // e.g. self.myOutlet = nil;
  //Clean up the temp file.
  NSFileManager * fm = [NSFileManager defaultManager];
  [fm removeItemAtPath:[recordedTmpFile path] error:&error];
  //Call the dealloc on the remaining objects.
  [recorder dealloc];
  recorder = nil;
  recordedTmpFile = nil;
}

@end
</code>
Comment: next time please use code formatting, and only post code snippets relevant to your question
Comment: My goodness that was some seriously disgustingly formatted code.
Answer: As you have structured your code now, the audio recording code is completely dependent on the presence of the user interface. As soon as your view controller gets deallocated, the audio recorder gets destroyed, too.
You have to decouple the audio recording code from the user interface code. Create a separate class that contains all properties and functionality that is related to recording. Then create an instance of that class outside your view controller (e.g. in your application delegate) and only pass this object to your view controller. The important thing is that the recorder object is totally unaffected by the presence or absence of the view controller.


Unable to connect to OpenVPN outside LAN

Question: I've setup OpenVPN behind a router, and port forwarded 1194. The VPN is using the subnet 10.3.15.0/24 and has 192.168.1.14 on the LAN.
It works when I'm connecting locally, or from my home network connecting to the public IP. But not on other networks I've tried.
I'm unable to establish a connection to the VPN and on the client I get:
Mon Apr 20 13:50:42 2015 UDPv4 link local: [undef]
Mon Apr 20 13:50:42 2015 UDPv4 link remote: [AF_INET]83.***.***.***:1194
Mon Apr 20 13:51:42 2015 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Mon Apr 20 13:51:42 2015 TLS Error: TLS handshake failed
Mon Apr 20 13:51:42 2015 SIGUSR1[soft,tls-error] received, process restarting
Mon Apr 20 13:51:42 2015 Restart pause, 2 second(s)

I thought it could be a firewall issue, this is from my iptables:
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
ACCEPT     all  --  10.3.15.0/24         anywhere             ctstate NEW

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

But I've tried to flush the table, which did not work.
And when running tcpdump -qni any port 1194 there is some communication (in both cases):
13:44:35.936684 IP 194.***.***.****.53929 > 192.168.1.14.1194: UDP, length 14
13:44:41.043704 IP 194.***.***.****.22955 > 192.168.1.14.1194: UDP, length 14
13:44:43.063426 IP 194.***.***.****.22955 > 192.168.1.14.1194: UDP, length 14
13:44:43.544690 IP 194.***.***.****.53929 > 192.168.1.14.1194: UDP, length 14

I also noticed something about destination port unreachable, but those errors went away.
This is my server configuration:
port 1194
proto udp
dev tun

ca openvpn_certs/host-ca.pem
cert openvpn_certs/host-cert.pem
key openvpn_certs/host-key.pem
dh openvpn_certs/dh1024.pem

server 10.3.15.0 255.255.255.0
route 10.3.15.0 255.255.255.0
ifconfig-pool-persist ipp.txt

push "dhcp-option DNS 18.104.22.168"
push "dhcp-option DNS 22.214.171.124"
push "redirect-gateway def1 bypass-dhcp"
push "remote-gateway 10.3.15.1"

client-to-client
max-clients 20

keepalive 10 120
comp-lzo

user nobody
group nobody

persist-key
persist-tun
status /var/log/openvpn-status.log
log-append /var/log/openvpn.log

verb 11

Here's my client configuration:
client
dev vpn
dev-type tun
proto udp
remote server.remote 1194
resolv-retry infinite
nobind
ns-cert-type server
persist-key
persist-tun
pull
ca certs/ca-host.pem
cert certs/cert-local.pem
key certs/key-local.pem
comp-lzo
verb 11

The server runs Alpine linux while the client runs Gentoo.
I'm stuck and have no idea where to look, any ideas or guidance?
Thanks!
Comment: How did you set up your keys? I would recommend following [this guide](https://wiki.gentoo.org/wiki/Create_a_Public_Key_Infrastructure_Using_the_easy-rsa_Scripts). Could you post the openvpn log from the server?
Answer: First of all, I'm not sure which version of OpenVPN you are using, but 'remote-gateway' is not a valid option in v2.3.2. If you're using an older version, check your local man page and remove that directive if necessary.

According to the OpenVPN wiki, the error "TLS key negotiation failed..."  is almost always a result of:

A perimeter firewall on the server's network is filtering out
incoming OpenVPN packets (by default OpenVPN uses UDP or TCP port
number 1194).

This seems unlikely in your case, but check your router's firewall just to be sure.

A software firewall running on the OpenVPN server machine itself is filtering incoming connections on port 1194.

The filter table you provided looks fine, assuming you normally have the default INPUT policy set to accept. Otherwise, you need to allow UDP port 1194:
iptables -A INPUT -p udp -m udp --dport 1194 -j ACCEPT

A NAT gateway on the server's network does not have a port forward rule for TCP/UDP 1194 to the internal address of the OpenVPN server machine.
The OpenVPN client config does not have the correct server address in its config file. The remote directive in the client config file must point to either the server itself or the public IP address of the server network's gateway.
Windows firewall is blocking access for the openvpn.exe binary. You may need to whitelist (add it to the "Exceptions" list) it for OpenVPN to work.

If you still have problems, there is likely an issue with your Public Key Infrastructure. I'm not familiar with Alpine linux and whether their OpenVPN package comes with easy-rsa, so go ahead and download the latest release and extract it to an appropriate location on both your server, and, a (preferably) non-network-connect machine (your Certificate Authority). For simplicity, I'll assume that your server is generating requests for clients. On both systems, change to the directory where you extracted EasyRSA and...
cp vars.example vars
editor ./vars

On the CA system, uncomment and edit the organizational fields accordingly (EASYRSA_REQ_COUNTRY, etc.). On the server, optionally change "set_var EASYRSA_PKI" so it points to an appropriate location (e.g. /etc/openvpn/pki).
Generate certificate requests on the server:
./easyrsa init-pki
./easyrsa gen-req <your_server_name> nopass
./easyrsa gen-req <some_client_name> nopass

On the non-server, create a new CA:
./easyrsa init-pki
./easyrsa build-ca

Copy the .req files to your CA system, then import and sign them:
./easyrsa import-req server /tmp/<your_server_name>.req
./easyrsa import-req client /tmp/<some_client_name>.req
./easyrsa sign-req server <your_server_name>
./easyrsa sign-req client <some_client_name>

Copy the newly signed certificates, as well as the CA certificate, to an appropriate location on the server and client. Then, on the server, generate dh params:
 ./easyrsa gen-dh

Finally, copy the client key to the client machine (if its not already there), and update your configurations with the new key and certificate locations.
Comment: Can you add in the relevant parts of the link into your answer? We ask this to help the OP out, so they will not have to search through information that may not pertain to them. This is also to preserve the relevant information in case the hosting site goes down. For more information, see this [meta post](http://meta.stackoverflow.com/q/8259).
Answer: Ensure that your server's certificate was signed with the nsCertType=server designation (this is depreciated and not the default if you used easyrsa3). If not, the 'ns-cert-type server' directive in your client config would cause the tls handshake to fail. Use ' remote-cert-tls server' instead.


How to convert model.h5 to model.pb?

Question: I wrote in google-collab to get the model using keras, but I have to do predictions in Visual Studio using tensorflow
I've search for a method converting models from keras .h5 to tensorflow .pb, but none of them worked as it should.
Comment: Hi! Have seen this page on stackoverflow yet? https://stackoverflow.com/questions/45466020/how-to-export-keras-h5-to-tensorflow-pb
Answer: Keras does not include by itself any means to export a TensorFlow graph as a protocol buffers file, but you can do it using regular TensorFlow utilities. Here is a blog post explaining how to do it using the utility script freeze_graph.py included in TensorFlow, which is the "typical" way it is done.
However, I personally find a nuisance having to make a checkpoint and then run an external script to obtain a model, and instead prefer to do it from my own Python code, so I use a function like this:
def freeze_session(session, keep_var_names=None, output_names=None, clear_devices=True):
    """
    Freezes the state of a session into a pruned computation graph.

    Creates a new computation graph where variable nodes are replaced by
    constants taking their current value in the session. The new graph will be
    pruned so subgraphs that are not necessary to compute the requested
    outputs are removed.
    @param session The TensorFlow session to be frozen.
    @param keep_var_names A list of variable names that should not be frozen,
                          or None to freeze all the variables in the graph.
    @param output_names Names of the relevant graph outputs.
    @param clear_devices Remove the device directives from the graph for better portability.
    @return The frozen graph definition.
    """
    graph = session.graph
    with graph.as_default():
        freeze_var_names = list(set(v.op.name for v in tf.global_variables()).difference(keep_var_names or []))
        output_names = output_names or []
        output_names += [v.op.name for v in tf.global_variables()]
        input_graph_def = graph.as_graph_def()
        if clear_devices:
            for node in input_graph_def.node:
                node.device = ""
        frozen_graph = tf.graph_util.convert_variables_to_constants(
            session, input_graph_def, output_names, freeze_var_names)
        return frozen_graph

Which is inspired in the implementation of freeze_graph.py. The parameters are similar to the script too. session is the TensorFlow session object. keep_var_names is only needed if you want to keep some variable not frozen (e.g. for stateful models), so generally not. output_names is a list with the names of the operations that produce the outputs that you want. clear_devices just removes any device directives to make the graph more portable. So, for a typical Keras model with one output, you would do something like:
from keras import backend as K

# Create, compile and train model...

frozen_graph = freeze_session(K.get_session(),
                              output_names=[out.op.name for out in model.outputs])

Then you can write the graph to a file as usual with tf.train.write_graph:
tf.train.write_graph(frozen_graph, "some_directory", "my_model.pb", as_text=False)

Credits: jdehesa
You can find more at:

How to export Keras .h5 to tensorflow .pb?

Keras as a simplified interface to TensorFlow: tutorial
Answer: There are different tools for converting hdf5 to .bp file as:
1 - convert trained Keras model to a single TensorFlow .pb file
2 - or keras-to-tensorflow as alternative
Comment: It'd be good if you could include more information than just links, so the answer is self-contained (or make a comment out of this answer; just including the links).
Answer: for tensorflow 2
import tensorflow as tf
model = tf.keras.models.load_model(keras_model_path)
tf.saved_model.save(model, "save/folder/path")

Other alternative
import tensorflow as tf
model = tf.keras.models.load_model(keras_model_path)
model.save("save/folder/path")

These two approaches create a folder and stores the modelfile as saved_model.pb.

How to convert model.h5 to model.pb?


Lazy-load certain files for routes that don't begin with `addin`

Question: I have a website build by AngularJS and angular-ui-router. In index.html, I load a lot of .js and .css files.
Now, I realize that a part of these .js and .css files are not necessary for the routes like https://localhost:3000/addin/.... So I want to load them by ocLazyLoad only for routes like https://localhost:3000/xxxxx/... where xxxxx is not addin.
Does anyone how to accomplish that in the code?
Answer: Try
.state('xxxxx', {
    url: '/xxxxx',
    templateUrl: 'xxxxx.html',
    controller: function($ocLazyLoad) {
        $ocLazyLoad.load('xxxxx.module.js');
}

Update
As per what you asked in your comments, you can't have like not for states. You need to map states explicitly.
One way I can think for creating a state which is not /addin, is to first explicitly map them in $stateProvider and then redirect via some redirect state and then load modules which you want to lazy load.
Redirect states other than addin by doing somthing like this for redirection
Comment: Sorry, `xxxxx` is a general term which represents all the words except `addin`.


Why do we join our hands in the way we do, when we pray?

Question: Whenever we pray, we tend to keep our hands together.
Is there a reason why we do so ??
Comment: Namaste is derived from Sanskrit and is a combination of two words, **"Namaḥ"** and **"te"**. **Namaḥ means 'bow','reverential salutation' or 'adoration' and te means 'to you'**. Therefore, Namaste literally means "bow to you" translated as **"I bow to you"**. We bow to god whenever we pray so that his blessings are on us and he fulfills the wish.
Answer: There are two verses in the Bhagavad gita that talk about that, 11.35 and 11.14. You can see it at http://www.vedabase.com/en/bg/11/35 and http://www.vedabase.com/en/bg/11/14
And the word describing this practice is kṛtāñjali, meaning "one who joins the hollowed palms in reverence or to solicit a favour (holding the hollowed palms together as if to receive alms or an offering), standing in a reverent or respectful posture".
Arjuna did it to offer obeisances to the Supreme Lord Krishna.
Today we are also doing the same because it's a common practice in Hindu dharma as we see from the above Gita verses and other scriptures.


TToolButton Height Grows with Style = tbsDropdown

Question: I noticed that the height of a TToolButton increases when you set the button's Style to tbsDropdown. I can understand the width increasing, so the button has space to draw the down arrow, but I'm not sure a height increase is necessary.
Steps to reproduce the issue (Delphi 2010, Windows 7 x64):

Add TToolbar to a form, ShowCaptions=True
Right click to add a button to the Toolbar
Set button Style=tbsDropDown and notice the button grows in height

The same height increase happens when there are images assigned to the
toolbar, in which case there is already plenty more vertical space available
in the button to draw the drop down.
Here's a visual example:
alt text http://img440.imageshack.us/img440/1462/ttoolbar02.png
alt text http://img291.imageshack.us/img291/966/ttoolbar01.png
Is there a workaround for this without hacking the VCL, or is this hardcoded into the Windows control?
Answer: It's part of the underlying Windows control. A quick look into ComCtrls shows that changing the TToolButton.Style calls it's SetStyle method. If, in SetStyle, ShowCaptions is True then the TToolBar.ButtonWidth and ButtonHeight are both set to 0, and TToolButton.RecreateButtons is called.
RecreateButtons, in turn, calls TToolBar.ResizeButtons, which simply sends (posts) a message to the ToolBar using
Perform(TB_AUTOSIZE, 0, 0);

TB_AUTOSIZE is intended to be used, according to MSDN,

after causing the size of a toolbar to change either by setting the button or bitmap size or by adding strings for the first time.

Since SetStyle sets both the ButtonWidth and ButtonHeight to 0, this message would seem to be correctly sent.
Answer: Looks like something is wrong with the theme support in underlying windows control. Switch off the runtime themes (Project/Options/Application, uncheck "Enable runtime themes" checkbox), ignore the increased button heights at design time (Delphi IDE uses themes) and run the application - you will see normal heights of the toolbar buttons.


Configuring GIT with Hudson

Question: I am naive to HUDSON and GIT, i followed some tutorials and tried to configure hudson and git.
Settings that i have done till now,

Set the path to git executable
created a empty local repository using mysysgit UI.
create a new job with git as source code management,

URL of Repository:  file:///c:/GitShare/Test/MyRepo
Branch Specifier :  master

save the file and run the build

I got the following error:
Started by user anonymous
Checkout:workspace / C:\Hudson\jobs\Test1\workspace - hudson.remoting.LocalChannel@1ed8c3
Using strategy: Default
Checkout:workspace / C:\Hudson\jobs\Test1\workspace - hudson.remoting.LocalChannel@1ed8c3
Fetching changes from the remote Git repository
Fetching upstream changes from file:///c:/GitShare/Test/MyRepo
ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway
ERROR:  (Underlying report) : Error performing command: C:\Git\bin fetch -t file:///c:/GitShare/Test/MyRepo +refs/heads/*:refs/remotes/origin/*
Cannot run program "C:\Git\bin" (in directory "C:\Hudson\jobs\Test1\workspace"): CreateProcess error=5, Access is denied
ERROR: Could not fetch from any repository
FATAL: Could not fetch from any repository
hudson.plugins.git.GitException: Could not fetch from any repository
    at hudson.plugins.git.GitSCM$3.invoke(GitSCM.java:824)
    at hudson.plugins.git.GitSCM$3.invoke(GitSCM.java:782)
    at hudson.FilePath.act(FilePath.java:758)
    at hudson.FilePath.act(FilePath.java:740)
    at hudson.plugins.git.GitSCM.gerRevisionToBuild(GitSCM.java:782)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:568)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1218)
    at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:507)
    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:424)
    at hudson.model.Run.run(Run.java:1367)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:145)

UPDATE
thanks for replying, i had already given all the permission to user, and had specified the path i.e. "C:\Git\bin\git.exe".. after working around i am able to connect to a local repository through Hudson but when i tried to connect to another local repository i am getting  the following error.
Started by user anonymous
Checkout:workspace / C:\Hudson\jobs\Job1\workspace - hudson.remoting.LocalChannel@84a6c0
Using strategy: Default
Checkout:workspace / C:\Hudson\jobs\Job1\workspace - hudson.remoting.LocalChannel@84a6c0
Fetching changes from the remote Git repository
Fetching upstream changes from git://220.127.116.11/GIT_Repo
ERROR: Nothing to do
[DEBUG] Skipping watched dependency update for build: Job1 #3 due to result: FAILURE
Finished: FAILURE
I guess repository is not initialized properly, can you please tell me the steps to create local repository and to publish it publicly.
Steps i have followed to create a repository:
1. open Git Bash Shell,
2. navigate to the repo folder which is having project to be published, and typed "git init" command.
Question 2:
if my repository is located on "c:/GitShare/Repo".
This "Repo" folder contains a ".git" and Project(to be published) folders.
Than what will be URL for the repository?
Comment: Here's the important line of your error message: `Cannot run program "C:\Git\bin" (in directory "C:\Hudson\jobs\Test1\workspace"): CreateProcess error=5, Access is denied
`
Answer: Are you sure that you have your paths and permissions set correctly?

When asked for the path to the git executable, Hudson may want you to specify a full path including the .exe filename, and not just C:/Git/bin (which is just the folder it's in).
Alternatively, whatever user Hudson is running as may not have access to that directory.

Configuring GIT with Hudson


How does mass density affect gravity?

Question: If I have two equal mass of objects, and one is less dense but spread over a larger volume, how does their gravity differ from two masses of equal mass and density?  (assuming the given volumes do not intersect.)
Comment: Per equivalence principle it doesn't.
Comment: Do you mean gravity as it would feel far away from the obects on a third body, or just their gravitational pull on each other?
Comment: on each other, I think.
Answer: If we assume that the objects are spherically symmetric, then as long as you are outside the object the gravitational field is not dependant on the radius (and therefore density) of the object.
Classically (i.e. non-relativitically) this result is due to Gauss' law. When we move to general relativity the result is due to Birkhoff's theorem.
Comment: Assuming they are not spheres and their shapes are not necessarily symmetric.  I'm curious about the SHAPE of the mass affecting it's gravity, so I don't see the classical model as being specific enough.  Would space follow such an object's topography, allowing me to consider object's gravitation as being be akin to something like the Ricci Flow?  I'm looking into Birkhoff and related Schwarzchild but I don't see them making cases for amorphic masses
Answer: If one has two spherical objects with same mass $m$ and densities $\rho_1$ and $\rho_2$, the gravitational field is the same in the two cases $\rho_1=\rho_2$ and $\rho_1\neq\rho_2$. This is a consequence of Gauss' law (see answer of John Rennie).
However, if the mass distribution is not spherical, the gravitational field does depend not only on the densities of the two mass distributions, but also on the geometrical shapes. The situation gets more complicated.
Example
I consider here a situation where the dependence of the gravitational field on the density and shapes of the charge distributions is very pronounced.
Consider a comparison between A) two spherical objects with mass $m$ and density $\rho$; and B) one spherical object with density $\rho_1$, and the a thin foil with the same mass $m$ but with a very small density $\rho_2\ll \rho_1$.
At large distances from these two objects, the gravitational field is the same in the two cases A) and B). Indeed, it is the same as of a single sphere of mass $2m$.
At small distances however, the gravitational field is completely different.
Consider for example the point located at the same distance $d$ between the two spheres in A) and between the sphere and the thin foil in case B). Suppose also that in the case B) the distance $d$ is smaller than the dimensions of the thin foil.
Case A) the gravitational field in the middle point is simply zero, since the contributions of the two spheres are equal and opposite and cancel each other.
Case B) the gravitational field of the thin foil is largely negligible (it is proportional to the mass density in this case) if the distance $d$ is much smaller than the linear dimension of the foil, and the only contribution to the field in this point is that of the sphere. In this limit (linear dimension much greater than $d$) the foil can be thought as an infinite plane with finite mass $m$ but with density $\rho_2=0$ (see also the related problem of the electric field of an infinite charged plane).

How does mass density affect gravity?


Does kha'zix passive trigger on ult while he is still visible?

Question: If you set a pink ward and kha'zix ults within the reveal area, will the unseen threat passive work anyway?
Answer: If your passive is already up you won't lose it, however if you have already consumed the buff any method of revealing will prevent getting the passive again. This counts for  warded bushes, Warwicks Blood Scent and diverse traps. The only exception is your Ultimate. You can be revealed during your stealth but you will still get the passive. Source (The site was deleted in english but is still available with spanish ability titles somehow)
On the other hand every kind of "stealth" will give you the passive buff. Most common used are: fog of war and bushes. You can however also get the passive by Nocturnes Paranoia, your ultimate and even Graves Smokescreen.
Answer: It does refresh, it's something put in there deliberately by riot. So ulting near a pink isn't useless.
Answer: Kha'zix' passive activates when he is unseen by all enemies. If they can see you during your ult (eg pink wards) it will not refresh his passive.


Cannot bind text field to selected item in JTable in NetBeans

Question: I am trying to use NetBeans to bind a JTextField to the selected element of a JTable.
The JTable gets its data from an AbstractTableModel subclass which returns Cow objects.  At present, each Cow object is displayed as a String through its toString method.
I am trying to bind the text property of the JTextField to the name property of the Cow object which is selected in the JTable.
I bound the text property of the JTextField in NetBeans to:
flowTable[${selectedElement.name}]
This produces the following line of generated code:
org.jdesktop.beansbinding.Binding binding =
  org.jdesktop.beansbinding.Bindings.createAutoBinding(
    org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
    cowTable,
    org.jdesktop.beansbinding.ELProperty.create("${selectedElement.name}"),
    cowNameTextField,
    org.jdesktop.beansbinding.BeanProperty.create("text"));
The bound value of the text field is always null.
What am I doing wrong?
Comment: Can you post more code (your tablemodel, table...)
Comment: I am no longer working on this project for which I ended up not using NetBeans bindings at all.
Answer: Does your Cow class have a public String getName() method returning the name?
If it doesn't, the outcome you're getting would be expected. If it does, could you post more code (your data class, tablemodel, table...).
Answer: If you only are interested in a String in the table, and not the Cow object itself:
table.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
    @Override
    public void valueChanged(ListSelectionEvent e) {
        if(!e.getValueIsAdjusting()) {
             Object value = table.getValueAt(e.getFirstIndex(), COLUMN_X);
             jTextField.setText(value.toString());
        }
    }
);

Comment: hello , what do you mean by COLUMN_X ... is that referring to a constant column number that I am supposed to bind the text field with  ?
Answer: Does your Cow class support adding a PropertyChangeListener? I did not use the beans binding support from NetBeans that often, but I remember you needed it. Anyway, a little more code could help with finding out whats going wrong.


Do gods need to be worshiped?

Question: I am working on my first homebrew setting using a spelljammer sort of cosmology, and I have run into some confusion. So far, my understanding is that gods in D&D only exist where they have followers. How, then, does a god create a world from nothing? If no world = no worshipers = no god to create the world?
Comment: yes, sorry. My campaign is going to be run using the 5th edition rules on my homebrew world, which exists in a crystal sphere amongst countless others similar to the spelljammer setting. I was unsure of how the gods would have been able to create the world within the crystal sphere without the strength they gain from their followers. Or how they could exist without them in the first place. I probably shouldn't have used both tags, sorry about that.
Comment: "my understanding is that gods in D&D only exist where they have followers" — I doubt this is actually true; do you mind providing any citation of game text?
Comment: read it as "do dogs need to be worshiped"
Comment: Welcome to the site! Enjoy the +1 for a fun question. I see you've used the tags for both 5e and Spelljammer, but there is no official 5e spelljammer setting. Can you clarify which you want an answer based in?
Comment: Welcome to RPG.SE! Take the [tour] if you haven't already, and check out the [help] for more guidance.
Comment: If one of the tags is better removed, you can (and should) do that now. This site favors editing questions and answers for clarity. And we want questions to "stand on their own" without the need to read comments. Comments are considered temporary.
Comment: and why does god need a spaceship?
Comment: Related to D&D gods, specifically in a "spelljammer sort of cosmology" : [MrRhexx video "Why do Gods Fear Space in Dungeons and Dragons"](https://www.youtube.com/watch?v=-iZHTXOPbJw) .  There are a few other good "god ecology" videos that might be useful source material; I can't actually watch it right now to confirm that it's the one I'm thinking of, but perhaps [this from AJ Pickett](https://youtu.be/BKFMOmgj3GU)
Answer: In the Forgotten Realms setting, there is an Overgod, Lord Ao. (see also this question)

He was credited as the creator of the cosmos, and even existed beyond concepts such as alignment and divine rank.
...
Ao had the power to create gods out from thin air.
...
...unlike the gods under him, Ao did not need the worship of mortals and did not desire it either, whereas those "normal" gods who did not receive the worship of mortals could die from lack of it.

So in answer to your question, there are Overgods who do not need worshipers.
Comment: *"there are Overgods "* - correction: there is **an** Overgod.
Comment: @BobJarvis-ReinstateMonica I believe the final passage in the old Avatar trilogy was, in fact, Ao getting ready to commune with his "superiors" to report on the state of the realms.
Comment: does he also have the power to create air, or does he need to find air prior to creating gods?
Comment: Ah - but if Overgods there are, created then whom Them? (Hint: turtles it is, up all the way...) (And to Yoda, many apologies offered are :-)
Answer: Gods don't necessarily need worshippers
The idea that the power of a god is derived from the belief placed in the god by its worshippers is a common one in fantasy, but it is not universally true in the genre generally or in D&D specifically.
The first chapter of the Dungeon Master's Guide, A World of Your Own, details the Core Assumptions of the game and has the section Gods of Your World, about the different kinds of pantheon and belief system you can use. It is a default assumption of D&D that gods exist and supervise the world in some capacity, but neither of these sections ever suggests that the power of a deity is in any way constrained by its number of mortal followers or that a given deity needs to have followers at all - this idea is almost completely absent!
The only place it comes up here is in the Forces and Philosophies section of this chapter, which describes allowing characters who might normally be divinely empowered to instead draw their abilities from personal belief and conviction in a philosophy or ideal, but notes that:

The power of a philosophy stems from the belief that mortals invest in it. A philosophy that only one person believes in isn't strong enough to bestow magical power on that person.

But this doesn't generally apply to the gods as described earlier, and in context I would interpret this as being necessary only because there isn't an actual god to provide the power instead.
Of course, if you have a world where the power of gods is associated with the belief invested in them by mortals - say, the Forgotten Realms - this question is valid. So what about the Realms, then?
Gods didn't always need worshippers
It is true that in the Forgotten Realms, the power of a deity is explicitly tied to their popularity amongst mortals. A god with a large portfolio and a huge flock of worshippers is more powerful than a god who has only a small portfolio and receives few prayers - remembering that FR society is generally polytheistic, and a deity who does not necessarily have a large number of dedicated followers may still receive many prayers from those dealing with their domain and derive strength this way.
However, the world of Aber-Toril was supposedly created by Selune and Shar, two goddesses that formed out of primordial nothingness and created the whole world of the Forgotten Realms before any mortals existed. How did they do this if the power of a god in the Realms depends on their mortal followers?
The simple answer is that, at the time, it didn't. Before the Time of Troubles, a god's power was derived directly from their portfolio and their mortal worshippers were irrelevant. One of the consequences of the crisis was that the overgod Ao, angered by the deities' disregard for their followers, decreed differently.

The close of the Avatar Crisis brought a change to the way the deities of Faerun relate to their followers. By Ao's decree, a deity's power is in part derived from the number and fervor of his worshipers, and so deities can no longer afford to ignore their faithful. (3e Forgotten Realms Campaign Setting, p.264-5)

Of course, in FR's case this requires the existence of an even greater divine entity, the overgod Ao, who created the universe all these gods exist in and has the power to simply decree things like that. But your setting could take a similar approach, with the original prime mover being an inherently powerful but aloof deity of some kind, and the more active gods of the world being those created or empowered by mortal worship instead.
Comment: Yes, when a DM is deciding how something in their world should work, and wondering if it's "ok," the Core Assumptions rules are a great place to start.
Answer: What you should always remember as a DM is that nothing about the "official" D&D lore is a hard rule consistent over every possible setting.  Things like "gods need followers" or "chromatic dragons are evil" are assumptions that the game makes about your world by default and that are true in the Forgotten Realms or other official settings.  In general, you should follow these conventions if you don't have a particular reason not to, since it makes everything a bit more consistent and it makes sources like the Monster Manual easier to use - and it saves you the DM a lot of work.
But if one of your core ideas about your world contradicts one of these assumptions, you should definitely go through with it. If a rule or a piece of lore is in your way, you shouldnt be afraid to change it in order to make your game more fun. So if you like the idea of gods existing regardless of mortals to revere them, do it.  It only means you may have to change a few more aspects of the default D&D to suit your idea.
Answer: This answer is about the official Spelljammer/Planescape lore, from which you can base any homebrew. You are, of course, free to change anything you like, but I think for this question you don't need to be told that.
The first planes to exist were the Inner Planes, the elemental planes and planes of energy. The Material Plane formed from the mixture of the elements and energies, and then life appeared upon it. The beliefs of living things then created the Outer Planes, and thus most deities post-date life. (Even though a large amount of the variety of life on the Material Plane is due to divine intervention, there must have been some life before them. Aboleths and le shay, certainly,1 though there must have been more than that, probably something or somethings humanoid.)
The Material Plane is divided into Crystal Spheres, each of which generally contains a solar system. Realmspace for the Forgotten Realms, Greyspace for Greyhawk, etc. Between the Crystal Spheres is the phlogiston, where spelljammers travel. And each Crystal Sphere (presumably) has an overdeity, e.g. Ao for the Forgotten Realms.
It's not really made clear where the Crystal Spheres and there attendant overdeities come from, or how any of this happens. As far as anyone who's talking knows, both were just always there, at least for as long as the Material Plane has existed. Maybe an aboleth or le shay could shed light on the matter.
But the long and short of it is that Crystal Spheres and overdeities come part and parcel with one another. Overdeities are extremely enigmatic and aloof, so very little is known about them, and it's not really clear what—if any—limitations they have with respect to their Crystal Spheres. I don't believe we even know if overdeities get to create the worlds within the Spheres, or if those come with. Ultimately, it doesn't have to be a thing you really decide, because there's almost no way anyone is ever going to find out those answers. You'd probably have to ask an overdeity for most of them, and as a rule those don't answer questions.
Regular deities, rather than overdeities, definitely don't have much of anything to do with it, though. Regular deities can shape things to an extent, and can definitely create life forms of great variety (e.g. Corellon Larethian is known to have created the elves, Moradin the dwarves, Gruumsh the orcs, so on and so forth), though they aren't the origins of everything (e.g. humans don't have a creator deity).
Anyway, overdeities don't require worship, it's only regular deities that do. Really, in most ways, overdeities aren't like other deities at all. They are linked solely to one Crystal Sphere, they don't have a divine realm somewhere, you cannot meet them incarnate, and their power within their Crystal Sphere is, if not absolute, at least well beyond anything the deities who operate there can question. When Ao makes a rule that the deities of the Realms don't like—and the Realms have a lot of onerous rules for deities—they can't do anything about it at all, they just have to figure out how to follow the rule.
So it's conceivable that overdeities existed prior to believers, it would just be yet another way in which overdeities aren't really deities at all, but their own special breed above deities.

Aboleths claim to be—and almost certainly are—the first sentient beings in the multiverse. The gods are, to them, upstarts. Le shay, on the other hand, predate the multiverse, somehow having survived from some previous multiverse to exist in this one. So they'd be the ones to talk to. I'd probably start with the le shay, if I had my choice....
Comment: I like that this answer addresses the Spelljammer aspect. But I think it would be presented a lot better if the penultimate paragraph were first. I.e. make the core point up front, then elaborate to support.
Comment: Except that they'd probably eat your soul first, right? ;-)  *Le shay, on the other hand, predate the multiverse, somehow having survived from some previous multiverse to exist in this one. So they'd be the ones to talk to. I'd probably start with the le shay, if I had my choice*
Answer: A deity is more "present" where followers are found, but followers aren't related to their mere existence. For example, "Overdeities" are discussed in Faiths and Pantheons and those aren't even known by mortals.
If you can comment with the source you're referencing here, we may be able to work through whatever caused the confusion.
Comment: Are you citing *Faiths and Pantheons* from 2002 to answer a question about 5E, which was released ten years later, or is there a later version of *Faiths and Pantheons?*
Comment: Welcome to RPG.SE! Take the [tour] if you haven't already, and check out the [help] for more guidance. If you want to ask the OP for clarification, you should do so in a comment on the question (...though you shouldn't include the part that answers the question in said comment).
Answer: Your question is one of theology and entertains multiple mutually-exclusive-yet-coexisting answers from various D&D products. Given that each crystal sphere has their own creation myths and pantheons, we do better to not rely on campaign-specific answers, but try to look for information from meta-settings: Spelljammer and Planescape.
The one sourcebook on religions and deities in the Planescape campaign setting is  On Hallowed Ground. This book makes it clear that everything on the Outer Planes is sustained by belief and that deities make use of this fact. Yet it also does not shy away from the following open-ended question/speculation (page 37):

Here's the chant ... : The Inner Planes, seat of the elements and building blocks of nature, appeared first. The Ethereal Plane came second, followed by the Prime Material Plane, where the elements combined and formed mortals. Mortals created knowledge, and knowledge formed the Astral Plane, the bridge to belief. And with the development of belief came the Outer Planes. ... since the theory implies that primes existed before the Outer Planes ... the idea isn't exactly welcomed on the Great Ring.

A similar open-ended theological speculation is presented in the Concordance of Arcane Space sourcebook of the Spelljammer boxed set (Creation of the Universe sidebar starting on page 42). The phlogiston that fills the "volume" beyond the crystal spheres and the flow is beyond the reach of the deities; priests on spelljamming vessels cannot loose contact with their gods. Six different hypotheses are put forward, one of which speculates that there are gods-of-gods which created the universe, another speculates that the shells of the crystal spheres are naturally occuring and that the deities simply occupied these spheres and lied to mortals about creating them. [You can read a summary on the Spelljammer fandom wiki.]
In summary
The answer to your question is not well-established in the lore. It is clear that belief is essential for most deities, yet it is left to each gaming table to decide the correct answer for others (or to decide whether a correct answer exists at all).
Answer: The Gods who created the universe need prayers because they created the universe
It sound like a bit of a tautology, but it is not intended that way.
Sure the gods are powerful.  They can raise the dead, conjure up a +5 sword with a wave of their hand, and even create servitors (incredibly powerful and sentient beings).
But that's peanuts compared to a universe.  Even compared to a single solar system (which most crystal spheres seem to be).
The act of creating the world.  Its matter and magic.  Its races.  The very laws of physics and metaphysics.  That took a lot out of the gods.  And now they need to recharge.  And that recharging mechanism is the prayer of their creations.
Of course, the greedy little things keep making demands in order to keep praying.  Which slows down the recharging process.  Every spell granted is a bit of power that the god could have used to regain her former stature.  But if you don't give the clerics their spells, they and the people they minister don't worship as often or faithfully.
Not to mention rather than just sharing equally, or based on who contributed what, some of the gods are trying to snatch more than their share.  Converting followers, or having their followers wipe out others.
tl;dr: They used to be Gods, but creating the universe reduced them to gods, so they need prayer to survive and to regain their former strength.
Comment: Can you provide any citations to backup this answer?
Comment: @PurpleMonkey Nope.  This answer is based on the OP's comment that this is for a homebrew campaign, and the situation laid out in said comment.  Therefore I suggested a reason that the situation of the creators needing prayer might be the case.
Comment: the OP may be using this for a homebrew campaign but that campaign is still using D&D 5e rules and is based on Spelljammer's cosmology. As written this answer appears to be just a random idea with no concrete foundation in either D&D 5e *or* Spelljammer rules. Unfortunately, random ideas aren't the sort of answers we're looking to cultivate on this site. [We require answers to be backed by citations/experience](https://rpg.meta.stackexchange.com/q/8696/14878).

Do gods need to be worshiped?


Shortest path through $\sqrt{n}$ points out of $n$

Question: Say I sample $n$ points uniformly at random in the unit square, and then I look for the shortest path through $\sqrt{n}$ of those points (rounding up, say).  What happens to the length of this path as $n\rightarrow\infty$?  Does it increase, decrease, or converge (or "none of the above")?
Comment: The quantity you're interested in is certainly bounded, because the length of the shortest path through *all* $n$ points (i.e. the TSP tour) has a length that is bounded by $\sqrt{2n} + 1.75$, as proven in [1], which we can approximate as simply $\sqrt{2n}$ since $n$ is large.  If you take this tour and break it into segments consisting of $\sqrt{n}$ points each, you know that one of those segments has length of at most $\sqrt{2}$.

[1] Few, L. "The shortest path and the shortest road through n points." *Mathematika* 2.02 (1955): 141-144.
Comment: Using the known TSP bound that John Gunnar Carlsson mentioned, one can probably get a heuristic bound by first asking what the typical size is of the smallest square that countains $\sqrt{n}$ points in the unit square.
Comment: I think it should decrease, even if it were n^c many points rounded up, for fixed positive c less than 1.  Set d to satisfy 2d +c=1, and consider a kxk square partition for k = floor(n^d).  One of those pieces will have n^c points in it, and the length of the path should be O(n^-d), or some appropriate power.
Comment: Hmm.  Maybe asking c greater than 1/2 is ambitious.  I still think it should converge for c=1/2.
Answer: The following is a partial answer.
It is useful to rescale. So think of a Poisson process in the plane and consider the box of side $n$. There will be roughly $n^2$ points there.
Let $A_{[a,b]}$ be the random variable you described, but  in the box $[a,b]^2$. You are really interested in $A_{[0,n]}/n$. You have essentially that $A_{[0,2n]}\leq A_{[0,n]}+A_{[n,2n]}$ (there is an error due to the segment connecting
the path in the first box and the path in the second; probably that error is negligible but I did not check that). An application of the sub-additive ergodic theorem then gives that $A_{[0,n]}/n$ converges to a deterministic number. Going from a Poisson number of particles to a fixed number of points is routine.
The above argument becomes rigorous if you ask your path to start at $(0,0)$ and end at $(1,1)$ and go through $\sqrt{n}$ points.
A simple bound (independent of the above reasoning) is obtained by looking at the longest (in terms of number of points) increasing path. This is equivalent to the length of the longest increasing subsequence of a random permutation, and the number of points is $(2+o(1))\sqrt{n}$. The length of the increasing path going through all these points is roughly $\sqrt{2}$. You can of course
take only $\sqrt{n}$ of these points, I do not think the length will change much. Interestingly, the constant $\sqrt{2}$ shows up again, as in John's answer. I suspect this might be the correct answer. Did you try to simulate?
Comment: (continued) This tells us that $\kappa$ (whatever its value is) is also a valid bound for the quantity of interest, which is less than $\sqrt{2}$.
Comment: Actually, the $\sqrt{2}$ is a fairly weak upper bound and can be improved by using the Beardwood-Halton-Hammersley theorem, which says that for a sufficiently large set of uniform samples in the unit square, we have $L_n/\sqrt{n} \rightarrow \kappa$ (almost surely), where $L_n$ represents the TSP tour of $n$ points, and $\kappa$ is the "TSP constant" which is known to satisfy $0.6250\leq\kappa\leq0.9204$, and it is conjectured that $\kappa \approx 0.7124$. This is described in formulas (18) and (19) of http://mathworld.wolfram.com/TravelingSalesmanConstants.html.
Comment: In fact, for the modified problem I defined (path starting at (0,0) and ending at (1,1), $\sqrt{2}$ is a trivial lower bound and also an upper bound from the LIS analysis. So for that modified problem, $\sqrt{2}$ is the correct answer.
Comment: John's argument applies to a worst case scenario. For what it's worth, I'd be quite surprised if with the additional randomness from the OP, the quantity in question didn't go to zero. (For example, this would follow if it could be shown that suitably selected $n/4$ points cluster in a square of sidelength $q$, for a fixed $q<1/2$.)
Answer: The comment by John Gunnar Carlsson and answer by Ofer Zeitouni give an upper bound. Comments by two people suggested that the actual behavior should be to decrease to $0$. In fact, there is a positive lower bound: The probability that there is a path through $\sqrt{n}$ points of length less than $0.214$ goes to $0$ as $n\to \infty$.
The idea is that if we pick a random path, the probability that this path is short is extremely small. Then we use the union bound over all possible paths of length $\sqrt{n}$ out of $n$ points.
It suffices to consider points chosen from a fine grid, or equivalently a large square subset of $\mathbb Z^2$, and to use the $L^1$ metric instead of $L^2$.
Roughly how many paths are there in $\mathbb Z^2$ on $m$ points of $L^1$ length at most $d$, where $d \gg m$, and we start at a fixed point? We can divide the distance into $m-1$ steps plus the unused distance. The number of ways to do this is ${d+m-1 \choose m-1} \sim d^{m-1}/(m-1)! = o\left(\left(\frac{ed}{m}\right)^{m-1}\right)$. For any such division of distances, we can choose a lattice point on each "circle." There are $4r$ lattice points of distance $r \gt 0$ from the origin and for $d \gg m$ we can increase the count by making each distance nonzero. By the AM-GM inequality, the count of these choices is at most the case where they are all equal, $\left(\frac{4d}{m-1}\right)^{m-1}$. So, the number of paths is
$$\begin{eqnarray} & o\left(\left(\frac{ed}{m}\right)^{m-1} \left( \frac{4d}{m}\right)^{m-1}\right) \newline &=o\left( \left(\frac{2\sqrt{e}d}{m} \right)^{2m-2}\right).\end{eqnarray}$$
The total number of paths in $\lbrace 1, 2, ..., d/c \rbrace^2$  of $m$ lattice points starting at a fixed point is $(\frac{d}{c})^{2m-2}$. So, the probability that a random path of $m$ points has $L^1$ length at most $c$ times the grid dimension is
$$o\left( \left(\frac{2\sqrt{e}c}{m} \right)^{2m-2}\right). $$
Let $n=m^2$. The number of paths of length $m$ among $n$ points is $n(n-1)\cdots(n-m+1) \lt m^{2m}$. So, if we choose $c$ so that the probability is $o(m^{-2m})$ then the probability that there is a path that short in the $L^1$ norm goes to $0$ as $n\to \infty$. This is accomplished by setting $c \lt \frac{1}{2\sqrt{e}}$. Since the $L^2$ norm is smaller by at most a factor of $\sqrt{2}$, for any $c \lt \frac{1}{\sqrt{8e}} =0.2144$ the probability that there is a path whose Euclidean length is shorter than $c$ goes to $0$ as $n\to \infty$.
While the constant might be improved, the probability bound is good enough to say that if we add the points one by one, then almost surely only finitely many times will there be a path on $\sqrt{n}$ points of length smaller than $c$.
Comment: @JohnGunnarCarlsson: I think I can answer this: it's the number of ways to partition the total distance $d$ into $m$ individual steps, where a step can be zero (this accounts for the extra $m-1$ on the top). This isn't the number of paths yet, it's the number of possible distance sequences we can encounter as we travel along a path of length $\le d$.
Comment: @John Gunnar Carlsson: It was from allocating the total distance $d$ into $m$ bins consisting of the $m-1$ steps and the unused distance. Equivalently, sum over the ways to allocate distances $0,1,2,...,d$ into $m-1$ bins. If $d=10$ then the path $(0,0)\to(1,1)\to(1,1)\to(3,4)$ would correspond to steps of $L^1$ sizes $2,0,5$ with $3$ unused. Allocating $d$ objects into $m$ bins is equivalent to choosing $m-1$ separators out of $d+m-1$ objects and separators.
Comment: This is a nice analysis, but the final step left me mildly confused. You seem to be assuming that the actual experiment (uniformly distributed points, then pick the shortest path) can be approximately described by instead imposing a uniform distribution on the paths. Is that clear?
Comment: @Christian Remling: If you pick $n$ points IID uniform, then each of the roughly $n^{\sqrt{n}}$ possible paths is uniformly distributed, just as though you only picked those $\sqrt{n}$ points. They aren't independent, but the union bound/linearity of expectation does not depend on independence. We can count the expected number of paths of length less than $0.214$ and find it is asymptotically much less than $1$. Thus, the probability that the shortest path is shorter than $0.214$ is small.
Comment: By the way, it looks nicer to do this analysis with integrals instead of sums, integrating over a simplex. The measure of a circle is still linear. I used a discrete sum to avoid worrying about the Jacobian. Also, the actual integral can be done instead of using the AM-GM inequality, but I think it is a little tricky and it would just affect the constant. One variation of that integral was on the Putnam exam.
Comment: Thanks for the clarification. You can't be off by much with your method (the base of the $(\ldots)^{2m}$ can be off at most by a multiplicative constant) because an essentially stronger bound would prove the result also for paths of some length $L_n=o(\sqrt{n})$, which is false by John's argument.
Comment: @Christian Remling: Yes, I meant the constant can be improved to be closer to the upper bound of $\sqrt{2}$. Using the $L^2$ norm directly improves the constant to $1/\sqrt{2\pi e}=0.24$. I'm not sure if avoiding the AM-GM inequality improves the constant more.
Comment: @DouglasZare, can you explain where the term ${d+m-1 \choose m-1}$ comes from?  I don't understand how this describes the number of paths.


Solving algebraically Quadratic inequalities with modulus abs $(x^2+5x-6) \gt 5$

Question: I tried to solve this inequality algebraically by opening modulus and doing $x^2+5x-6 \gt5$  or $\lt -5$. I got $2$ solution sets with no overlap.
When we solve graphically there are $4$ points of intersection.
How do we get the answer algebraically ?
thanking you in advance
Ashwini
Answer: We need to solve $$(x^2+5x-6)^2-25>0$$ or
$$(x^2+5x-11)(x^2+5x-1)>0$$ or
$$\left(x-\frac{-5-\sqrt{69}}{2}\right)\left(x-\frac{-5-\sqrt{29}}{2}\right)\left(x-\frac{-5+\sqrt{29}}{2}\right)\left(x-\frac{-5+\sqrt{69}}{2}\right)>0,$$ which gives the answer:
$$\left(-\infty,-\frac{5+\sqrt{69}}{2}\right)\cup\left(-\frac{5+\sqrt{29}}{2},\frac{-5+\sqrt{29}}{2}\right)\cup\left(\frac{-5+\sqrt{69}}{2},+\infty\right).$$
Answer: If you look at it graphically, i.e. plotting the quadratic, and look at where the equality is satisfied, you will see that you should get two "solution sets". If you wanted to solve for these intervals algebraically, begin by splitting the problem up. First, you want to set the quadratic equal to 5 and solve, then set it equal to -5 and solve. Setting it equal to 5 will yield two solutions, a and b, where a < b, which we can see that any value greater than b and any value less than a will violate the inequality. Doing the same for -5, we get two values, c and d, and we can see that any values between these two values will also violate the inequality. Putting these results into interval notation shall get you your result.


Improper integral involving sinh

Question: I am trying to calculate the following improper integral:
$$
\int_{-\infty }^{\infty }\frac{x}{x-\sinh \left( \frac{\pi x}{2}\right) }ds
$$
I try to calculate it using the residues theorem. Therefore I extend the integrand away from the real axis as:
$$ \frac{z}{z-\sinh \left( \frac{\pi z}{2}\right) } $$
The integrand has only poles on $ z=\pm i $, because at $z=0$ the limit is $ -\frac{2}{\pi-2}\ $. Then I consider a contour integral that comprises the integral along the real axis from −R to +R together with the integral along the semi-circular arc on the upper half-plane. When R→∞ the contribution from the straight line part approaches the required integral because the curved section vanishes in the limit.
According to this, the integral should be equal to:
$$ 2 \pi i Res(\frac{z}{z-\sinh \left( \frac{\pi z}{2}\right) },z=i)=  2 \pi i (i)=-2\pi=-6.283185308 $$
But when I numerically compute the above integral has a value of $ -3.838888154$.
What I am doing wrong?
Thanks a lot!
Answer: There are further poles, as you can see e.g. in these plots. I doubt that these poles can be expressed in closed form.
Comment: Totally True!! In view of this, I think that it is not possible to obtain a closed form solution for this integral. Thanks a lot for your help and time!

Improper integral involving sinh


How is antimatter made?

Question: How is antimatter made in laboratory? Can anyone explain, at the particle level, specifically how anti-protons and anti-electrons are made?
Comment: Please have a look at pair production http://en.wikipedia.org/wiki/Pair_production and then specify your question.
Comment: Anyone else thinking that this topic should be suggested to How It's Made?
Comment: This is the theory how it made. Practically how they achieve?
Answer: Creating anti-protons is straightforward in principle because any high energy collision produces a shower of protons, antiprotons and various types of pions. The pions decay in a few nanoseconds, so you just have to wait for the pions to decay then separate the antiprotons from the protons.
At Fermilab a 120GeV proton beam was collided with a nickel target to produce the protons and anti-protons. The proton/antiproton mixture was first passed through a lithium lens to produce a collimated beam, and subsequent magnetic separation produced separate beams of protons and antiprotons.
Although making antiprotons is easy, if by making antimatter you mean making neutral antimatter like antihydrogen that's much, much harder. The energies of antiprotons created from the nickel target are far higher than the ionisation energy of (anti)hydrogen, so the antiprotons need to be cooled and trapped then reacted with positrons to create antihydrogen.
The first significant amounts of antihydrogen to be made were created by the Alpha group at CERN. There's a nice video that describes their experiment here. They hold the antiprotons in a magnetic trap then adjust the field to allow them to come into contact with the positrons.
Comment: Making anti-protons is dead easy. Turning them into a cooled collimated beam suitable for use in an accelerator is not at all easy. Although it was done at Fermilab the intensity of the anti-proton beam was far lower than could be (relatively easily) achieved with a proton beam.
Comment: Is making anti-protons that easy? It's a bit harder/more expensive than protons? Isn't it? Isn't that why LHC is $pp$ rather than $p\bar p$? (though at high energies with the pdfs the distinction isn't that important).
Answer: Since John is not addressing positrons one should know that positrons are easily created once a photon has more energy than twice the mass of the electron, in electron positron pairs.
This can be seen clearly in this bubble chamber picture:

where the positron  is shown in purple on the right. One knows they are electrons (positrons) because of the rapid energy loss of the track due to the ionization, indicating the small electron mass.
To get positron beams one has to generate the pair on thin targets in vacuum, as the pair creation happens in the electromagnetic field of the nucleus, and then separate with magnetic fields the positrons from the electrons.

How is antimatter made?


Android multiplayer via bluetooth

Question: How do I transfer game commands between 2 android devices via bluetooth first of all is possible to do this??If possible then someone please help in doing so.Thank u
Comment: http://developer.android.com/guide/topics/connectivity/bluetooth.html
Answer: This is definitely possible. You should look at the Android developer documentation for bluetooth (Ocelot has posted the link).
At the minimum you will have to do this -

Discover the devices
Pairing and connecting devices
One of the device needs to become server. It will open a socket and listen for connection.
Other device(s) need to become client. They will try to connect to server.
Once a connection is established, client and server can exchange strings of message. These strings can be your game commands.

From my own experience, I would say pay good attention to architecture design for exchanging commands. As it may soon become messy.
Comment: oh thank you Vinayak . Is the game engine necessary for that or can i do it with native api?
Comment: @srinivas: I am not aware of a game engine that provides bluetooth API, so you will have to go with native API probably, whether you use game engine or not.

Android multiplayer via bluetooth


All my application run as admin rights

Question: for some reason all application or anything on my laptop has admin rights even tho i choose not to run as admin, for example, if i run notepad, chrome, it askes me for admin rights, im pretty sure the check on "Run as admin" on those are disabled... Even when i try to download a random .rar on internet, openning that random .rar also ask me for admin rights! How do i fix this problem? I dont want to reset because of personal reasons. Thank you.
My UAC setting is at second from the top and the laptop is safe from viruses i have Malwarebytes and Windows defender always running and i scan them regularly.
Comment: Does this also happen when booting in Safe mode?
Answer: User Account Control setting is too high possibly:
1 Open the Control Panel (icons view), and click/tap on the User Accounts icon.
2 Click/tap on the Change User Account Control settings link.
3 If prompted by UAC, click/tap on Yes.
4 Move the slider up or down to the setting for how you want to be notified by UAC, and click/tap on OK. (see screenshots below)
https://www.tenforums.com/tutorials/3577-change-user-account-control-uac-settings-windows-10-a.html
UAC could be set in Local Group Policy: https://docs.microsoft.com/en-us/windows/security/identity-protection/user-account-control/user-account-control-group-policy-and-registry-key-settings#user-account-control-behavior-of-the-elevation-prompt-for-standard-users
Comment: @MyLinh - You shoud edit your question and mention it in that case.

All my application run as admin rights


Include a directory recursively for vim autocompletion

Question: I use vim from the base directory of my source code. I would like to have autocomplete consider every word of every file in this directory (and subdirectories) when editing a single file.
Comment: Thanks guys, the set complete= and argadd both worked.  Didn't try Exuberant Ctags due to lack of Scala support.
Answer: Completion is controlled by the 'complete' option. With the k flag, you can have Vim scan files. The ** wildcard stands for a recursive descent into subdirectories. Voila:
:set complete=k**/*

When you want to keep the other default locations (other buffers, included files, etc.), use :set complete+= to add to it.

Alternatively, as this can be too slow for a default, you can use the 'dictionary' option and use Ctrl-X Ctrl-K completion:
:set dictionary=**/*

Answer: :argadd **/*

This will recursively load all files into buffers, and the completion will consider them. Beware that this will load all files, including files you might not want to add, such as binary files or files in CVS directories. A more fine-grained glob such as the one below might be a good idea.
:argadd **/*.cpp

Answer: I think a much better approach is to generate a tags file in your directory system using Exuberant CTags.
For starters, build your tags file in the root of your source with:

ctags -R .

This may find more than you like, but you can tune it with further command line options.
Set your tags option to refer to this file ("tags" is the default name), or use set tags=./tags;/ to search up your directory tree to the first tags file found.  See :help file-searching to understand the ;/ syntax for upward search.
Finally, make sure that 't' is in your complete option.  It's there by default, but check with set complete?.  If it's not there, set complete+=t will put it there.
I personally remove 'i' and 'd' from my 'complete' option, because the disk access is annoying, even though typing CTRL_Y (yes, accept completion) or CTRL_N (no, reject completion) or continuing normal typing will stop the search.  If all the included files are in your tags file, you'll find the completion instantly.


PATH environment variable in linux

Question: I want to know how the standard environment variables given by the linux OS like PATH, HOME are set automatically. In which file are these read from. There should be some file from which these variables are set when a particular user login.
Comment: As additional lecture you could read [From Power Up To Bash Prompt](http://tldp.org/HOWTO/From-PowerUp-To-Bash-Prompt-HOWTO.html). Old, but gives a good introspection.
Answer: The answer to your question can be found in INVOCATION section of man bash.
Here's relevant excerpt:
   When  bash is invoked as an interactive login shell, or as a non-inter-
   active shell with the --login option, it first reads and executes  com-
   mands  from  the file /etc/profile, if that file exists.  After reading
   that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile,
   in  that order, and reads and executes commands from the first one that
   exists and is readable.  The --noprofile option may be  used  when  the
   shell is started to inhibit this behavior.

   When  a  login  shell  exits, bash reads and executes commands from the
   file ~/.bash_logout, if it exists.

   When an interactive shell that is not a login shell  is  started,  bash
   reads  and executes commands from ~/.bashrc, if that file exists.  This
   may be inhibited by using the --norc option.  The --rcfile file  option
   will  force  bash  to  read  and  execute commands from file instead of
   ~/.bashrc.

   When bash is started non-interactively, to  run  a  shell  script,  for
   example, it looks for the variable BASH_ENV in the environment, expands
   its value if it appears there, and uses the expanded value as the  name
   of  a  file to read and execute.  Bash behaves as if the following com-
   mand were executed:
          if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi
   but the value of the PATH variable is not used to search for  the  file
   name.

There's even more in the man page, I recommend you read it.
Comment: what if he's not using bash?
Comment: man page for `ksh` also has `Invocation` section. `csh` has `Startup and shutdown`, which describes files read by starting shell. I expect other shells also have relevant sections in their manuals.
Answer: Things are a little more complex than just what your shell provides.
There are three main ways to login:

login from a true terminal (nowadays, mainly the console)
login from a pseudo-terminal (mainly network connections)
login from a graphic environment

They all are able to set up the environment before executing your shell, and they all do (HOME, LOGNAME, TERM are probably not set by your shell, and even if you have no start-up files, your shell usually inherits the PATH environment variable).
When logging in from a true terminal, the process handling the connection will probably set up the TERM environment variable and delegate the rest of the work to the login program. That program does some verifications (such as preventing login for root on insecure terminals), ensures that the whole environment excepted TERM is clean, initializes HOME, PATH, SHELL, TERM, MAIL, and LOGNAME and then launch your login shell.  Your shell will then do its own initialization.
When logging in from a pseudo-terminal, the same things happen with a little twist. Often the environment gets more initialization from the process handling the connection than just the TERM environment variable (network protocols often have a way to transfer the environment from the other side) and thus login is used in a mode in which it doesn't clean the environment, the clean up is done by the program handling the connection.
Graphic environments usually don't delegate to login but behave similarly.  After verifying your credentials, they create a clean environment (with usual environment variable and at least DISPLAY set correctly; they often allow a sysadmin provided script to add things) then launch the start up script for your desktop environment; those may try to get the environment from your login shell and also often provide the possibility to provide a script to complete the set up. So when you launch any program from your desktop, its environment is the combination of what the graphical login program, your desktop environment and your login scripts set.
One last thing: when you launch a terminal emulator, you may get either a login shell (in which case the login script from the shell is executed and thus you get to see the effect of your latest changes in it, but won't see the same environment as the other programs) or not (in which case the login script from the shell isn't executed, you don't see your latest changes, but you get the same environment as the other programs — modified by the interactive initialization script of your shell).
Answer: check /etc/bash* /etc/profile* files.
Comment: +1 for a solution that would work for other shells other than bash ONLY
Answer: You should take a look at the .profile file in the root of user directories - variables like those can be set (or overridden) there.
However, if you mean where do all environmental variables get set - I'd assume that they get inherited from some parent process. Perhaps a look at something like this might help.
Answer: Check the man page for bash as it should give you all the files that are checked (and in which order) depending on your distribution.  The env command will tell you what is set -- but not where from. However, a quick grep will tell you where those are set.

PATH environment variable in linux


Input size in graph algorithms

Question: I know from the book by Neapolitan that for any algorithm input size is defined as the number of bits to encode the input. In graph algorithms, the input size is defined as $|V(G)| + |E(G)|$ for the input graph $G$. On the other hand, we save graphs in computers by their either adjacency lists or adjacency matrices which are of size $2|E(G)|$ and $|V(G)|^{2}$. So how is the input size $|V(G)| + |E(G)|$?
Answer: The size of adjacency list representation is $\Theta(|E(G)| + |V(G)|)$, and not $\Theta(|E(G)|)$. For example, consider a graph with $n$ vertices and $0$ edges. The adjacency list corresponding to each vertex is empty. But storing the null pointer requires constant space for each vertex. Therefore, the size of the adjacency lists is $|V(G)|$ here.
Comment: So if we want to compute the (almost) exact size of an undirected graph $G$ which is in adjacency list representation, it's $|V(G)| + 2|E(G)|$. Right?
Comment: @Emad For an undirected graph: yes. For a directed graph, precisely it is $|V(G)| + |E(G)|$ . Although it is better to say $\Theta(|V(G)| + |E(G)|)$ for both.
Comment: And for the adjacency matrix representation, it's $\Theta(|V(G)|^{2})$ for both types?
Comment: @Emad right. Always.

Input size in graph algorithms


I was a W2 taxpayer now a new 1099 tax payer with a newly formed LLC with EIN number

Question: I am being paid a 10k salary for driving the business from the company whose product i will be selling, but they are in Overseas. The newly formed LLC is me only at this stage? How can i overcome this as for a home loan i am required to be a W2 not a 1099?
Answer: In the US, W2 and tax returns are required to show ability to earn and history of income, which would be sufficient to pay off the loan being taken out. Usually banks use income to debt ratio of about 30% give or take.
For self-employed, banks are looking for much more robust history of earnings, given the inherent lack of security in income for self-employed people. You can probably find another job paying similarly to what you've been earning for the last X years, but can you build another business from scratch quickly? Probably not.
With no income history and no relevant evidence from your business, you won't be able to satisfy banks' quest to ensure that you can actually pay the loan back. Defaults and foreclosures are expensive, and even if there's a mortgaged property, most lenders want some assurance that you'll pay the loan back. In the situation you've described, I doubt any mainstream lender would consider you, you'll either need to wait for your business to become established and reliably profitable, or look for lenders willing to take extra risk (and pay much more in origination costs and interest to compensate them for that risk).
Comment: Just part of the cost of being a business...
Comment: Thank you for your feedback and understand.  However in this case i am guaranteed the 10k per month (not contract permanently) but instead of me being paid i invoice them and then they pay me, is there no way of setting this up that this should be sufficient?
Comment: Guaranteed, but no contract? How does that work? Guaranteed by what? What are they paying you for? It all doesn't make any sense at all. Banks are doing risk assessment. You're not matching any pattern, they don't want to deal with exceptions.