How can I run MongoDB as a Windows service?

Question: How can I set up MongoDB so it can run as a Windows service?
Comment: Hmm. That is quite a bit more work than the accepted answer :-(.
Answer: After trying for several hours, I finally did it.
Make sure:

you added the <MONGODB_PATH>\bin directory to the system variable PATH
run command prompt as administrator

Steps:
step 1: execute this command:
D:\mongodb\bin>mongod --remove

Step 2: execute this command after opening command prompt as administrator:
D:\mongodb\bin>mongod --dbpath=D:\mongodb --logpath=D:\mongodb\log.txt --install

NOTE: you can also append --serviceName MongoDB after the command above.
That's All!

After that right there in the command prompt execute:
services.msc

// OR

net start MongoDB

And look for MongoDB service and click start.

NOTE: Make sure to run command prompt as administrator.
If you don't do this, your log file (D:\mongodb\log.txt in the above example) will contain lines like these:
2016-11-11T15:24:54.618-0800 I CONTROL  [main] Trying to install Windows service 'MongoDB'
2016-11-11T15:24:54.618-0800 I CONTROL  [main] Error connecting to the Service Control Manager: Access is denied. (5)

and if you try to start the service from a non-admin console, (i.e. net start MongoDB or Start-Service MongoDB in PowerShell), you'll get a response like this:
System error 5 has occurred.
Access is denied.

or this:
Start-Service : Service 'MongoDB (MongoDB)' cannot be started due to the following error: Cannot open MongoDB service
on computer '.'.
At line:1 char:1
+ Start-Service MongoDB
+ ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service],
   ServiceCommandException
    + FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Commands.StartServiceComman

Comment: You can also start it with `net start MongoDB` instead of using `services.msc`. (`mongod` recommended that to me.)
Comment: This worked for me. The path to the log file has to be created manually if it doesn't already exist (I used a path other than the mongo directory in the example).
Comment: Should be the validated answer
Comment: At first, Mongo started as a service, but my database was empty. I could only see my previously existing database by adding \data to the path : mongod --dbpath=D:\mongodb\data
Comment: "Make sure to run command prompt as administrator" - it did the job! Running with normal permission does not write any warning, but service is just not created. Permissions, permissions, permissions!
Comment: neither of the top 2 answers will keep the service running on reboot - see instead my answer below
Comment: `mongod --remove` was key for me, since I had an old install location, and `--install` didn't override with the new location on it's own.
Answer: I think if you run it with the --install command line switch, it installs it as a Windows Service.
mongod --install

It might be worth reading this thread first though. There seems to be some problems with relative/absolute paths when the relevant registry key gets written.
Comment: It requires a logfile path, you can add the dbpath and logfile path like this mongod --dbpath="c:\data\db"  --logpath="c:\data\db\log.txt" --install ,  After this you need to run net start MongoDB.
Comment: i finally managed to install by execute this:
mongod.exe --service
Comment: It seems like what you really need to do is enter the full path at the command line: c:\> c:\mongodb\bin\mongod.exe --service.  However, make sure to run the command window as administrator (especially on windows server) otherwise you'll be thwarted by UAC.
Comment: And after you run with --install, you'll have to `net start MongoDB`
Comment: this gist can be time saving for devleopment machine setups https://gist.github.com/serdarb/5102848
Comment: The answer should specify that you need to run `mongod --install` as an Administrator, otherwise it fails silently. As others have stated, you also need to `run net start MongoDB`.
Comment: this answer may be out of date.
Comment: Like @JCGrubbs said if you run as a regular user the command completes quietly without any errors but does not add a service. If you remember that, and follow these https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/#install-the-mongodb-service you'll be fine.
Comment: do i need to do it per path of data? i start mongo, with hello world, and the tutorial were not just about mongo so the detail were a little. the way it did it, said go to the same path as you did, then generate a fol;ter and used --path command to send data of a collection to there... now should we lunch it per collection specifying the path? for example you lunch two application on server?
Answer: not only --install,
also need --dbpath and --logpath
and after reboot OS you need to delete "mongod.lock" manually
Comment: +1 for deleting mongod.lock file. This still appears to be an issue with 1.8.1 running on 64-bit.
Comment: Better even to specify --config and define dbpath, logpath and other options there.
Comment: Appears that this `mongod.lock` bug is fixed on my `Windows 8 x64`
Answer: Unlike other answers this will ..
START THE SERVICE AUTOMATICALLY ON SYSTEM REBOOT / RESTART
MongoDB Install
Windows
(1) Install MongoDB
(2) Add bin to path
(3) Create c:\data\db
(4) Create c:\data\log
(5) Create c:\data\mongod.cfg with contents ..
systemLog:
    destination: file
    path: c:\data\log\mongod.log
storage:
    dbPath: c:\data\db

(6) To create service that will auto start on reboot .. RUN AS ADMIN ..
sc.exe create MongoDB binPath= "\"C:\Program Files\MongoDB\Server\3.4\bin\mongod.exe\" --service --config=\"C:\data\mongod.cfg\"" DisplayName= "MongoDB" start= "auto"

(7) Start the service .. RUN AS ADMIN ..
net start MongoDB

IMPORTANT: Even if this says 'The MongoDB service was started successfully' it can fail
To double check open Control Panel > Services, ensure the status of the MongoDB service is 'Running'
If not, check your log file at C:\data\log\mongod.log for the reason for failure and fix it
(Do not start MongoDB via Control Panel > Services, use .. net start MongoDB)
(8) Finally, restart your machine with MongoDB running and it will still be running on restart
If you ever want to kill it ..
net stop MongoDB

sc.exe delete MongoDB

Comment: thanks it worked for Me , I just had to change `3.4` to `3.6` version in this command `sc.exe create MongoDB binPath= "\"C:\Program Files\MongoDB\Server\3.4\bin\mongod.exe\" --service --config=\"C:\data\mongod.cfg\"" DisplayName= "MongoDB" start= "auto"`
Answer:
The below steps apply to Windows.

Run below in an administrative cmd
mongod --remove

This will remove the existing MongoDB service (if any).
mongod --dbpath "C:\data\db" --logpath "C:\Program Files\MongoDB\Server\3.4\bin\mongod.log" --install --serviceName "MongoDB"

Make sure that C:\data\db folder exists
Open services with:
services.msc

Find MongoDB -> Right click -> Start
Comment: Perfect!  Minor note, the folders must exist (at least the one for the logs).
Comment: Perfect solution.
Comment: Minor question regarding sidenote: Doesn't the file need to exist too? I can vaguely remember the absence of the (empty) file itself giving me problems.
Answer: You can use the command below for running mongodb as a windows service
"C:\mongodb\bin\mongod" --bind_ip  yourIPadress  --logpath  "C:\data\dbConf\mongodb.log"  --logappend  --dbpath  "C:\data\db"  --port yourPortNumber --serviceName "YourServiceName" --serviceDisplayName "YourServiceName" --install

If you use mongodb with default parameters, you can use these values :

yourIPadress : 127.0.0.1 or localhost
yourPortNumber : 27017 (default port) or dont put --port
serviceDisplayName : only if you run more than one service (since mongodb 1.8)

There's more information on this command here
http://www.mongodb.org/display/DOCS/Windows+Service
Answer: I tried all answers and then did it the way https://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/#configure-a-windows-service-for-mongodb-community-edition describes it.
Use a config file...
"C:\mongodb\bin\mongod.exe" --config "C:\mongodb\mongod.cfg" --install
Answer: This PowerShell Script Downloads and Installs MongoDB as Windows Service:
Set-ExecutionPolicy RemoteSigned

$mongoDbPath = "C:\MongoDB"
$mongoDbConfigPath = "$mongoDbPath\mongod.cfg"
$url = "http://downloads.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.4.9.zip"
$zipFile = "$mongoDbPath\mongo.zip"
$unzippedFolderContent ="$mongoDbPath\mongodb-win32-x86_64-2008plus-2.4.9"

if ((Test-Path -path $mongoDbPath) -eq $True)
{
  write-host "Seems you already installed MongoDB"
    exit
}

md $mongoDbPath
md "$mongoDbPath\log"
md "$mongoDbPath\data"
md "$mongoDbPath\data\db"

[System.IO.File]::AppendAllText("$mongoDbConfigPath", "dbpath=C:\MongoDB\data\db`r`n")
[System.IO.File]::AppendAllText("$mongoDbConfigPath", "logpath=C:\MongoDB\log\mongo.log`r`n")
[System.IO.File]::AppendAllText("$mongoDbConfigPath", "smallfiles=true`r`n")
[System.IO.File]::AppendAllText("$mongoDbConfigPath", "noprealloc=true`r`n")

$webClient = New-Object System.Net.WebClient
$webClient.DownloadFile($url,$zipFile)

$shellApp = New-Object -com shell.application
$destination = $shellApp.namespace($mongoDbPath)
$destination.Copyhere($shellApp.namespace($zipFile).items())

Copy-Item "$unzippedFolderContent\*" $mongoDbPath -recurse

Remove-Item $unzippedFolderContent -recurse -force
Remove-Item $zipFile -recurse -force

& $mongoDBPath\bin\mongod.exe --config $mongoDbConfigPath --install

& net start mongodb

Answer: This was the only thing that worked for me. As everything had to be an absolute path:
C:\Program Files\MongoDB\Server\3.2\bin>mongod --install --dbpath=c:/data/db --logpath=c:/data/logs/log.txt

I also had to run it from admin cmd
Answer: The recommended way mongod --install results in error:
2015-12-03T18:18:28.896+0100 I CONTROL  --install has to be used with a log file for server output

After having installed mongodb in C:\mongodb you need to simply add the logpath:
mongod --install --logpath C:\mongodb\logs\mongo.log

The path to the logfile must exist and it must be an absolute Windows path. Then you start the MongoDB service by typing:
net start MongoDB

Answer: Working on Mongo DB: 3.6
(1) Install MongoDB
(2) Add bin to environment path variable
(3) Create c:\data\db
(4) Create c:\data\mongod.log
(5) Run below Command on bin folder

.\mongod.exe --install --logpath c:\data\mongod.log --logappend
  --bind_ip 12
  220.127.116.11 --dbpath c:\data\db

(6) To start mongo db as service

net start MongoDB

(7) Finally run mongo in command line to check mongo shell is open or not.
Comment: Works also with mongod version 4.2.8. Thanks!
Comment: In step 5, if this error is thrown: `F  CONTROL  [main] Failed global initialization: FileNotOpen: Failed to open "C:\ProgramData\MongoDB\log\mongod.log"` all that is needed is to delete `mongod.log` file
Answer: Consider using
mongod --install --rest --master

Comment: consider to update your answer with ruby's answer (yours it is incomplete)
Answer: For version 2.4.3 (current version as of posting date), create a config file and then execute the following:
C:\MongoDB\bin\mongod.exe --config C:\MongoDB\mongod.cfg --service
Answer: This is what worked for me:
sc.exe create MongoDB binPath= "d:\MongoDB\bin\mongod.exe --service --config=d:\MongoDB\bin\mongod.config" displayname= "MongoDB 2.6 Standard" start= "auto"

escaping the binPath was failing for me as described in the Mongo documentation
Failed:
sc.exe create MongoDB binPath= "\"C:\Program Files\MongoDB 2.6 Standard\bin\mongod.exe\" --service --config=\"C:\Program Files\MongoDB 2.6 Standard\mongod.cfg\"" DisplayName= "MongoDB 2.6 Standard" start= "auto"

Comment: Run cmd as administrator and run this command: sc.exe create MongoDB binPath= "d:\MongoDB\bin\mongod.exe --service --config=d:\MongoDB\bin\mongod.config" displayname= "MongoDB 2.6 Standard" start= "auto"
Answer: The simplest way is,

Create folder C:\data\db
Create file C:\data\db\log.txt
Open command prompt as "Run as Administrator" and make sure the mogodb bin directory path is correct and write
C:\Program Files\MongoDB\Server\3.4\bin> mongod.exe --install mongod --dbpath="c:\data\db" --logpath="c:\data\db\log.txt"

Start mongodb service:
net run MongoDB

Comment: 'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
Answer: Working on MongoDB 3.4 [Windows]

Create dir C:/mongodb/data
Create a file in C:/mongodb/mongodb.config using this configuration:
storage:
    engine: wiredTiger
    dbPath: "C:/mongodb/data"
    directoryPerDB: true
    journal:
        enabled: true
systemLog:
    destination: file
    path: "C:/mongodb/data/mongod.log"
    logAppend: true
    timeStampFormat: iso8601-utc
net:
    bindIp: 127.0.0.1
    port: 27017
    wireObjectCheck : false

To install MongoDb as a service, run this command in powershell with admin power
mongod --config="C:\mongodb\mongodb.config" --install --service
Open Services.msc and look for MongoDb, then start it
Answer: Currently (up to version 2.4.4), if any path (dbpath/logpath/config) contains spaces, then the service won't start, and show the error: "The service is not responding to the control function".
Answer: I'm on version 2.4.9 and using a config file. The service wouldn't start until I surrounded the equals sign in the config file with spaces:
dbpath = D:\Mongo data
logpath = C:\mongodb\logs\mongo.log
logappend = true

Originally I had:
logpath=C:\mongodb\logs\mongo.log

I also discovered that when installing the service that you have to use an absolute path for the config file eg:
c:\mongodb\bin\>mongodb.exe C:\mongodb\bin\mongod.conf --install

Don't be tempted to put inverted commas around a dbpath with spaces.  The service will appear to start when you execute net start MongoDB but it will terminate.  Check the log files for confirmation that the service has really started.
Answer: Run "cmd.exe" as administrator and then run "sc.exe" to add a new Windows service.
for example:
sc.exe create MongoDB binPath= "c:\program files\mongodb\server\3.2\bin\mongod.exe"

Answer: I found that you should pass : dbpath , config and logfile to mongod with the install flag
example :
mongod --dbpath=c:\data\db --config=c:\data\db\config.cfg --logpath=c:\data\db\log.txt --install

note : I have mongod path in my path variable .
You can control the service with :
net start mongodb
net stop  mongodb

Answer: These are the steps to install MongoDB as Windows Service :

Create a log directory, e.g. C:\MongoDB\log
Create a db directory, e.g. C:\MongoDB\db
Prepare a configuration file with following lines
dbpath=C:\MongoDB\db
logpath=C:\MongoDB\log
Place the configuration file with name mongod.cfg in folder "C:\MongoDB\"
Following command will install the Windows Service on your
sc.exe create MongoDB binPath= "\"C:\MongoDB\Server\3.4\bin\mongod.exe\" --service --config=\"C:\MongoDB\mongod.cfg\" DisplayName= "MongoDB 3.4"  start= "auto"
Once you run this command, you will get the [SC] CreateService SUCCESS
Run following command on Command Prompt
net start MongoDB
Answer: If you install MongoDB 2.6.1 or newer using the MSI download from an Administrator Command Prompt, a service definition should automatically be created for you.
The MongoDB documentation also has a tutorial to help you Manually Create a Windows Service definition if needed.
Answer: This answer is for those who have already installed mongo DB using MSI installer.
Let's say your default installed location is "C:\Program Files\MongoDB\Server\3.2\bin"
Steps to run mongo as a window service

Open command prompt as administrator
Type cd C:\Program Files\MongoDB\Server\3.2\bin (check path properly, as you may have a different version installed, and not 3.2).
Press enter
Type net start MongoDB
Press enter
Press Windows + R, type services.msc and check if Mongo is running as a service.
Comment: Have correct path but getting error : `System error 2 has occurred. The system cannot find the file specified.` tried mongod , mongodb as well.
Answer: I just had to restart the MongoDB (v4.4) service after editing the config file on a Windows box. Here's what I did:

Press Win+R to open the Run panel
Type in "services.msc" and press Enter
Search for "MongoDB" - you can press "m" to jump to it.
Right click - select "Restart"

Thats it!
Answer: mongod --config "C:\Program Files\MongoDB\Server\3.6\mongod_primary.cfg" --install --serviceName "MongoDB_Primary" --serviceDisplayName "MongoDB Primary"

Answer:
check windows services
if you have service for mongo remove it by run bellow command  mongod --remove
create mongo.cfg file with bellow content
systemLog:
destination: file
path: c:\data\log\mongod.log
storage:
dbPath: c:\data\db
path: where you want to store log datas
dbPath: your database directory
then run bellow command
sc.exe create MongoDB binPath= "\"C:\Program Files\MongoDB\Server\3.2\bin\mongod.exe\" --service --config=\"C:\Program Files\MongoDB\Server\3.2\mongod.cfg\"" DisplayName= "MongoDB" start= "auto"
binPath : mongodb installation directory
config: .cfg file address
DisplayName:Your Service Name
start service
net start MongoDB

now every things are done . enjoy that
Answer: In my case, I create the mongod.cfg beside the mongd.exe with the following contents.
# mongod.conf

# for documentation of all options, see:
#   http://docs.mongodb.org/manual/reference/configuration-options/

# Where and how to store data.
storage:
  dbPath: D:\apps\MongoDB\Server\4.0\data
  journal:
    enabled: true
#  engine:
#  mmapv1:
#  wiredTiger:

# where to write logging data.
systemLog:
  destination: file
  logAppend: true
  path:  D:\apps\MongoDB\Server\4.0\log\mongod.log

# network interfaces
net:
  port: 27017
  bindIp: 0.0.0.0

#processManagement:

#security:

#operationProfiling:

#replication:

#sharding:

## Enterprise-Only Options:

#auditLog:

#snmp:

Then I run either the two command to create the service.
D:\apps\MongoDB\Server\4.0\bin>mongod --config D:\apps\MongoDB\Server\4.0\bin\mongod.cfg --install

D:\apps\MongoDB\Server\4.0\bin>net stop mongodb
The MongoDB service is stopping.
The MongoDB service was stopped successfully.

D:\apps\MongoDB\Server\4.0\bin>mongod --remove
2019-04-10T09:39:29.305+0800 I CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2019-04-10T09:39:29.309+0800 I CONTROL  [main] Trying to remove Windows service 'MongoDB'
2019-04-10T09:39:29.310+0800 I CONTROL  [main] Service 'MongoDB' removed

D:\apps\MongoDB\Server\4.0\bin>
D:\apps\MongoDB\Server\4.0\bin>sc.exe create MongoDB binPath= "\"D:\apps\MongoDB\Server\4.0\bin\mongod.exe\" --service --config=\"D:\apps\MongoDB\Server\4.0\bin\mongod.cfg\""
[SC] CreateService SUCCESS

D:\apps\MongoDB\Server\4.0\bin>net start mongodb
The MongoDB service is starting..
The MongoDB service was started successfully.

D:\apps\MongoDB\Server\4.0\bin>

The following are not correct, note the escaped quotes are required.
D:\apps\MongoDB\Server\4.0\bin>sc.exe create MongoDB binPath= "D:\apps\MongoDB\Server\4.0\bin\mongod --config D:\apps\MongoDB\Server\4.0\bin\mongod.cfg"
[SC] CreateService SUCCESS

D:\apps\MongoDB\Server\4.0\bin>net start mongodb
The service is not responding to the control function.

More help is available by typing NET HELPMSG 2186.

D:\apps\MongoDB\Server\4.0\bin>

Answer: Plz try the steps in Mongo DB: 3.6 & Windows 10

mongod --remove
mongod --dbpath=C:/data/db --port 27017 --logpath C:/data/log/log.txt --service
mongod --dbpath=C:/data/db --port 27017 --logpath C:/data/log/log.txt --install
net start MongoDB
Comment: MongoDB 4.0 runs fine on Windows 64-bit ... UNLESS you try securing it by adding the "authorization: enabled" line to the "Security" setting in mongod.cfg. Then it results in windows reporting an error message "the service did not start in a timely manner". Any idea what's happening here?


D-Wave Cloud Service - Pricing for Academic Research Project

Question: In D-wave's web portal, I found 3 different ways that one can gain access to more QPU/Hybrid Solver time. One of them is the academic research project. Does anyone here have experience of carrying out such project? And if yes, could you explain how it worked?
Answer: When I used their Leap service it was semi-free. When I opened an account they gave me 1 minute of QPU time and unlimited usage of all other offline libraries and D-Wave solvers. I also linked the project repo, this gave me another free minute per month of QPU time.
To not waste QPU time, I first configured everything classically and executed problems on CPUs. And only when I knew that I can't improve on classical configurations/settings I relaunched jobs on Hybrid (CPU + QPU) or just QPU. This was when the counter started ticking.
If your goal is to do some sort of benchmarking on some "standard problems" then definitely one free minute will not be even nearly enough.
I suggest to contact D-Wave directly.
Answer: There are two level of free access. For the basic level just sign for the Leap and GitHub (you have to link your Leap account with GitHub one). This allows you for one minute of computational time on QPU and 20 minutes of the time on hybrid solver. Remember however that hybrid solver also uses QPU time, although only 20 ms are on average consumed per one simulation. You can use the Leap account for one month.
Second level is called Developer. It has basically the same features as described above, however, each month your available computational time is renewed. But any code you develop under your account has to be ultimately published on GitHub as a public domain.


How do i fix the "A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header"

Question: I have an AI Thinker ESP32-CAM and I've had issues uploading the CameraWebServer sketch, every time I hit upload it says "A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header" and I've tried everything that I can think of, I disconnected and reconnected all the connections on my FTDI board and I've done all sorts of button presses during the connection, I've switched the voltage and I've bought a whole new board and I don't know what the issue is or how to fix it.
Comment: Did you connect IO0 to Ground?
Answer: ESP32 only works with 3.3 V serial do not switch the FTDI voltage to 5 V
Watch out for the serial connections too
U0R-->TX
U0T-->RX
If you mixed it up it won't work!
First of all you need to connect two pins only when uploading
It is all ready fixed for you need to press the rest button when uploading
and seeing these dots as below image.

ESP32-CAM on-board RST button Press and hold until you see uploading

After a few seconds, the code should be successfully uploaded to your board.
I hope this helped for you!
You can reffer to this link for more info
https://randomnerdtutorials.com/esp32-cam-take-photo-display-web-server/
Comment: Good info about ESP32. In addition, I think some confusion comes from the ESP32-CAM, which does have +5V option. And you have to ground GPIO0 in order to program that board. But other than that they are very similar. Again, this comment and link applies to ESP32-CAM, as the original question asked about. https://randomnerdtutorials.com/program-upload-code-esp32-cam/
Answer: I have had the same problem / error message with a different board. I did not realise that during upload you must make sure that any GPIO pins that the board uses to talk to the flash chip are NOT connected to other devices. The upload process should be:

Disconnect any GPIO pin connectors.
Upload your code.
Reconnect any GPIO pin connectors.

(In your question, you say "I disconnected and reconnected all the connections" but you do not say whether all your connections were disconnected while you were trying to upload your code.)
I found this information here (the text in that post says "This message normally means that the ESP32 can't talk to its attached flash chip (the flash chip may be in the module). Check the GPIO pins 6,7,8,9,10 & 11 (which are shared with the flash chip) are not connected to anything external or shorted together, etc.")
HTH.


Why does the integral $\int_1^\infty\frac{\sin(x)}{x^2}dx$ exist?

Question: As the title says, I'm trying to justify why the (Riemann) integral $\int_1^\infty\frac{\sin(x)}{x^2}dx$ exists. I'm not interested in determining its value. It seems to me that I should use the fact that the integral $\int_1^B\frac{\sin(x)}{x^2}dx$ exists for every $B>0$, because the integrand is continuous, and the estimate
$$\left|\int_1^B\frac{\sin(x)}{x^2}dx\right|
\le\int_1^B\left|\frac{\sin(x)}{x^2}\right|dx
\le\int_1^B\frac 1{x^2}dx<\infty.$$
However, the estimate only says that in the limit $B\rightarrow\infty$ the integral is finite if it exists, but I don't see how I conclude that the limit does exist.
Comment: @cthl No, that is not correct.  An improper Riemann integral that is absolutely convergent is convergent!  What on earth are you talking about??
Comment: What is your definition of convergence?  You've proven it is absolutely convergent and this implies convergence.
Comment: Notice that $\lim_{B\to\infty}\frac d{dB}\int_1^B\frac{\sin(x)}{x^2}\ dx=0$.  What should that tell you?
Comment: Absolute convergence does not imply convergence here, since I am using the Riemann integral, not the Lebesgue integral.
Comment: To check that absolute convergence implies convergence for the integral of Riemann it is enough to check the epsilon-delta definition of convergence of $\int|f|$ and compare with the epsilon-delta definition of convergence of $\int f$
Comment: @Dr.MV Sorry, I think I confused absolute integrability and what you called absolute convergence. So when you say "absolute convergence implies convergence", you mean that $\lim_{B\rightarrow\infty}\int_a^B f$ exists if $\lim_{B\rightarrow\infty}\int_a^B |f|$ exists, given that $f$ is integrable on every finite interval $\left[a,B\right]$?
Comment: Yes, you have it.  Well done.
Answer: You should prove the theorem that if $f \colon [a, \infty) \rightarrow \mathbb{R}$ is Riemann integrable on each interval $[a,b]$ for $b > a$ and $\int_a^{\infty} |f(x)| \, dx$ exists (as an improper Riemann integral) then so does $\int_a^{\infty} f(x) \, dx$ (absolute convergence implies regular convergence).
The main idea of the proof is to use the Cauchy criterion of convergence for an improper integral. Namely, the improper integral $\int_a^{\infty} g(x) \, dx$ converges iff for every $\varepsilon > 0$ we can find $M \geq a$ such that for all $y > x > M$ we have
$$ \left| \int_x^{y} g(x) \, dx\right| < \varepsilon. $$
Assuming this criterion, if $\int_a^{\infty} |f(x)| \, dx$ exists then for any $\varepsilon > 0$ we can find $M \geq a$ such that for all $y > x > M$ we have
$$ \left | \int_x^y |f(x)| \, dx \right| = \int_x^y |f(x)| \, dx < \varepsilon $$
but then we also have
$$ \left| \int_x^y f(x) \, dx \right| \leq \int_x^y |f(x)| \, dx < \varepsilon $$
so by the Cauchy criterion, $\int_a^{\infty} f(x) \, dx$ also conveges.
Comment: Very well written.  (+1)
Comment: Thank you, this took me a while to understand. If I understand this correctly, your first statement implicitly assumes that $f$ is integrable on every interval $\left[a,b\right]$, as is the case for my original function. I didn't see this implicit assumption and was concerned about a function like $f(x)=\frac{g(x)}{x^2}$, where $g(x)=1$ if $x\in\mathbb Q$ and $g(x)=-1$ otherwise, since in this case $\int_1^\infty |f|$ exists, but $\int_1^\infty f$ doesn't.
Comment: @cthl: Yeah. When one talks about the improper Riemann integral of $f$ on $[a,\infty)$, one implicitly assumes that $f$ is Riemann integrable on $[a,b]$ for all $b > a$ (otherwise, one cannot even talk about the limit of $\int_a^b f(x) \, dx$ as $b \to \infty$) so that such pathologies cannot occur. I'll edit the answer to be more precise.
Answer: Define $F:[1,+\infty) \to\mathbb R$ by $F(x) = \int_1^x s^{-2}\sin(s)\,ds$. You know $F$ is well defined, so we only have to prove $\lim\limits_{x\to+\infty}F(x)$ exists and is finite.
The estimate $$|F(y)-F(x)|\leq \left|\int_x^ys^{-2}\,ds\right|\leq\int_{\min\{x,y\}}^\infty s^{-2}\,ds=\frac{1}{\min\{x,y\}}$$
shows that if $x,y > M$, then $|F(x)-F(y)|<1/M$. If we take any sequence $(x_n) \to +\infty$, this implies $(F(x_n))$ is Cauchy, and therefore converges to a real number.
Now you can argue that $\lim\limits_{n\to\infty} F(y_n)$ is the same for any $(y_n)\to\infty$ and therefore that $\lim\limits_{x\to+\infty} F(x)$ exists.


Difference between "I like swimming" and "I like to swim"?

Question: So what is the difference between  "I like swimming" and "I like to swim"? Do they mean the same?
Comment: I recall once reading in a grammar book years ago that 'I like swimming' is a liking lasting for at least some period, while 'I like to swim' is more about the current mood.
Comment: There is a past sense where '... to swim' wouldn't fit as well. The best example I can think of is someone coming out of a pool after their first time who perhaps had held some trepidation prior and exclaiming 'I like swimming!'.  In that instance 'I like to swim' while not _wrong_, would sound stiltedly formal imho.
Answer: They can both be used to mean that you like doing the action of swimming, but "I like swimming" can also be used to mean you enjoy other things about swimming.
For example:

What exercise do you do?
I like to swim

or

I like swimming

are both right. "Swimming: is used as a verb, and either the infinitive or the gerund are acceptable.
But

What sport shall we watch today?

I like swimming

is right but

I like to swim

is wrong. "Swimming" is being used as a noun, and the infinitive of the related verb is not an acceptable substitute.
Comment: This answer would be even better if it explicitly discussed the differences between the words/phrases 'swimming' and 'to swim' and how they then relate to the subject of the sentences: 'I'.
Comment: Essentially this answer could be summarised by saying they are the same when being used as a verb (swimming, the action), but different when being used as a noun (swimming, the sport)
Answer: Virtually no difference, in this case.
Perhaps if you mean "the hobby or sport of swimming"  then "I like swimming"  and if you mean the "action and experience of moving through water" then "I like to swim."
But there is functionally almost no difference in meaning.  But note that with other verbs you may have to use one form or the other. E.g. "I enjoy swimming" is correct but *"I enjoy to swim." is a mistake.
Answer: Most linguists think there is no practical, semantic difference.
Some say there is a minor difference.
Here's what I think based on a French linguist's idea:
"I like swimming." implies the notion of swimming.
"I like to swim." implies something slightly more connected to the pronoun I.
Be that as it may, be aware that other verbs of emotion such as dislike, hate/love work the same way work the same way.
Comment: "i like swimming" can totally mean "I like to watch other people swim", "I am happy that swimming exists and is something people can do", or "I like the thought/concept/idea of swimming", but "I like to swim" cannot mean any of those. Are you sure most linguists think there's no semantic difference?
Comment: I agree, most of the time I wouldn't think there was any difference between them. If I actually think about it more though, "I like to swim" sounds like they're more likely to actually do it often, whereas "I like swimming" sounds a little more like they like it when they do it but they're not as likely to do it.
Answer: To build on DJClayworth's answer, "swimming" is somewhat unique because it's an activity that can be enjoyed without participation.
If you say, "I like to swim," you are saying that you personally enjoy the act of swimming. The sentence "I like swimming" can mean the same thing, but not always. This is because of a wider cultural context in which "swimming" can refer to a sport that sedentary observers can watch and enjoy, even if they don't personally enjoy being in the water.
For activities that don't have this same cultural context, the sentences would be understood to mean the same thing. For example:

I like to drive

and

I like driving

These sentences mean the same thing. The word "driving" does not refer to any sport or activity that observers watch and enjoy (for car races, you would use "racing"). So the sentence "I like driving" is taken to mean that you enjoy participating in the activity yourself.
Edit: Another example similar to "driving" is "talking." I'm not aware of any sport or similar activity referred to as "talking." If you say "I like talking," it will be understood almost universally to mean that you personally enjoy the act of saying things.
Comment: "How did the speech go?"; "Well, people are certainly talking", "I like talking. Much better than rioting."
Comment: It could be noted that "I like driving" could be used to describe enjoying going for a drive as a passenger, whereas I think "I like to drive" would be less likely to be used in that context, but not incorrect
Comment: Not that unique. Rowing, fencing, diving, weightlifting, sailing, accounting all spring to mind.


People Picker control stopped working

Question: I have a form designed in InfoPath which was working correctly containing a number of people pickers for traveller and preparer details.
I was playing around amending the form in SharePoint designer, looking to allow multiple entries in the traveller field.
Cut a long story short, I didn't want the changes, closed the form (but may have saved it) and now when I try and submit the original form, it comes up with an error
"The form cannot be submitted.
The form cannot be submitted to the specified SharePoint list or document library. The SharePoint location may be read-only or you may not have permissions to access it."
The form works perfectly if the traveller people picker is left blank.
The preparer people picker works fine.
Anyone help at all?
Comment: Could it be that you accidentally marked a field as "Enforce unique values" in the InfoPath form while playing around?
Answer: Fixed it - I had inadvertently restricted the selection from a specific SharePoint group instead of allowing all users!

People Picker control stopped working


Why is Verisign spidering my website?

Question: In my logs, I keep noticing that 184.108.40.206, which is Verisign, is spidering through every page on my website, excluding pages of forms. Does anybody know why they are doing this?
Comment: Why is this question tagged with SSL/SSL-certificate?
Comment: Probably need a bit of log detail on this one to see what's really going on.
Comment: If you're not using their services(see response from @mahnsc), it's probably just going to come down to "because they want to" and you'll have to ask if you really want to know. Anyone can run a spider. Years ago, a personal site I ran was regularly being hit by the [IAEA](http://www.iaea.org/) for reasons I couldn't even begin to speculate about.
Answer: It could be related to the daily malware scan[CNet, PDF @Verisign] they run automatically as a service to their ssl certificate customers. You could always opt out of the service temporarily in order to see if the crawls from that IP cease.
Answer: Other people have experienced similar things: http://www.forumpostersunion.com/showthread.php?t=4163
Specifically highlighting the last post, where the bot appears to be spidering things high in SEO ranking. My personal opinion, is that someone is spidering websites and in fact spoofing their IP to hide who they are. I don't believe VeriSign rents out infrastructure or servers, so either they have been compromised to someone is putting the blame on them.
My personal recommendation, is to simply ban the bot (not using a robots.txt file since I'd almost guarantee it ignores it) by IP address (some people report it using the entire range 69.58.178.* and not to worry too much about it unless it's slowing your website down.
Comment: Unless the attacker is on the same subnet as you and sniffing all IP traffic, IP spoofing only works one way. You can send spoofed packets, but then the responses won't come back to you. As such, it's pretty difficult to even open a TCP connection while spoofing your IP on the internet, much less try to spider a website (which requires actually reading the responses from the web server).
Comment: To send a GET request, you'd need to open a TCP connection, which requires a SYN/SYN-ACK/ACK handshake with correct sequence numbers, which is pretty close to impossible for the attacker to perform without seeing the random sequence number the sever chose for the SYN-ACK. And if you can't actually capture the server response to the GET request, how are you really "spidering" the site?
Comment: I understand it works only one direction. It is possible to send GET requests via an invalid IP. But we don't know where it finds the pages to spider. If the pages trend towards popularity before being crawled, perhaps the bot is cross-referencing with search engines.
Comment: IP Spoofing is highly overrated and best used for DDOS backscatter and joe jobbing where you want the replies to be directed to the spoofed IP. It doesn't work the way you think it works.

Why is Verisign spidering my website?


delete image from server, fix google error for that with htaccess

Question: i delete one image from my page and from google now i get error: "image not found".
What i need to do, that google forget this picture?
I need add 404 eroor with this picture link in .htaccess?
<code>Redirect 404 /my-picture.png
</code>
This fix my problem?
Answer: By default server should throw 404 when missing files are requested for. So it will be removed from Google index on subsequent crawls.
If you want to get it removed immediately, create a Google Webmaster account, add your site to dashboard. Once done you can submit all images/URLs which are not there anymore to Google and it will be removed from Google Search index.


How does Ray manage to grab Conny's bunny plushy and hide it from her?

Question: Re-watching The Promised Neverland anime and re-reading the manga, I still find the first major plot turning event a bit abrupt. Conny is saying goodbye to her friends at the house foyer with Mom behind her, holding her beloved bunny toy. And the next scene is Mom leading her to the gate without the bunny. The assumption is they go out the door straight after waving goodbye. So how did Ray pull it off?
Answer: This is an error introduced in the anime. In the manga, Conny is not shown to be holding Little Bunny when she leaves, as seen in the first chapter.

Later on, it is shown in chapter 13 how Ray gets Little Bunny.

This is just my interpretation since there's no dialogue, but it looks like Ray non-verbally offers to hold Little Bunny while he's handing over the suitcase. Since Ray is being so sneaky, Conny just forgets she's no longer holding her toy after the exchange. It's also possible he just asked for it. But given how attached Conny was to the toy, it seems unlikely she would have meant to permanently hand it over into Ray's custody.
Anime Continuity
Since Conny is explicitly shown to have the toy as she's leaving Gracefield, events couldn't have happened as they did in the manga. But since there is likely no actual explanation given in the show, we can only speculate on possibilities.
First off, there's the possibility that Ray somehow acquired a second Little Bunny. I don't think he could sew one himself though (notwithstanding whether Ray can sew, this would require materials, tools, and the time and space to make the duplicate in secret).
I think the more likely possibility hinges on toys being recycled and Ray being Isabella's spy. We know toys are recycled and stored in the secret room, because we see this during the series (see Little Bunny and Grace Field secret room).
Conny would obviously have no further need for the toy where she's going, so it could be that it was Isabella who took it from Conny. She may have even persuaded Conny to give it up before they left. From here, there are two options:

Ray may have then taken it from where Isabella stashed it and placed it where Emma and Norman find it.
Being Isabella's spy, Isabella may have directly given Ray the toy and instructed him to stash it somewhere. He instead places it where Emma and Norman find it.


Significance of -1 slope in CMOS inverter transfer characteristics

Question:
In the CMOS inverter transfer characteristics what is the significance of slope of \$-1\$ at the points where \$V_{IH}\$ and \$V_{IL}\$ have been shown? And how is this the occurrence of the values, \$V_{IL}\$ and \$V_{IH}\$ related to the point where the slope is \$-1\$?
Answer: This seems to be the standard textbook definition of VIH and VIL. Using a slope of -1 as the limit makes more sense if you think of inverters as amplifiers and remember that the input will have some noise:

simulate this circuit – Schematic created using CircuitLab
Going back to your graph, if the input voltage is between VIH and VIL, any noise will be amplified. If the signal passes through many gates (which it probably will), the noise could be amplified enough to flip a bit. This leads to the definition of the noise margins for the inverter:
$$NM_H = V_{OH} - V_{IH}$$
$$NM_L = V_{IL} - V_{OL}$$
Or at least, that's my understanding. I found some sources that said choosing a -1 slope as the threshold maximizes the sum of the noise margins \$(NM_H + NM_L)\$, but I'm not sure how that works.
There seems to be a lot of debate among textbooks and academics about how best to define \$V_{OH}\$ and \$V_{OL}\$. Some sources define them as the extreme limits of the output voltages, while some use the same -1 slope definition as the input thresholds. (The latter seems to be more formally correct.) I even found an IEEE paper which claims that all of the definitions are wrong, including the input thresholds!
I don't have a resolution to all this except to say that the significance of the -1 slope definitely has to do with noise margins. I believe that answers the original question.
Answer: While I can't be sure, since you have provided no context or links to the original source, I would guess that this is part of a discussion on how to quantify 3 terms: input high, input low, and mid-voltage.
What the author seems to have done is to take the position that, for a logic circuit, there will be input/output high and low regimes, where changing the input has little or no effect on the output, and a middle area where the output is sensitive to changes in input. Apparently the author has chosen to define the input high and low thresholds as those at which the change in input is equal to change in output - where the slope of input vs output is -1. The mid-point, where the input equals the output, is obviously where the curve intersects the line Vin = Vout; in otherwords where it intersects a line with slope = 1 and which intersects the origin.
This is a generalized approach to analyzing response curves, and has the advantage of dealing in a consistent way with curves which are not ideal. An ideal inverter, for instance, has an input/output curve with flat in the high and low regions and a vertical transition region. For such a devices, Vil, Vm, and Vih are the same. But real devices don't have infinite gain, and your figure seems to be one way to deal with this.
Note that this is not the only way to deal with the problem. You might, for instance, define the transition points as those which produce outputs of 10% and 90% of the output range, and Vm as the 50% point. Or any other set of values you like.
Comment: what kind of source are you to here,of which i have not provided the link. I would like to make it as descriptive as possible
Comment: I'm sorry,  I don't understand the question. You provided no source for the diagram, and I certainly don't know where to find it.
Comment: ok....actually it is a book named "Microelectronics circuits" by Sedra Smith
Comment: I still don't understand the question.
Answer: The "slope=1" comment indicates that the diagonal line shows the point where Vin=Vout.  If one has two inverters in a back-to-back configuration to form a latching circuit (to change the latched state, use stronger transistors to overpower the latching transistors), both inverters could sit at that precise voltage indefinitely.  If one inverter's input was a little higher, that would cause its output (the other inverter's input) to go a little lower, which would in turn cause the that inverter's output (the first inverter's input) to go higher, etc. eventually causing the latch to fully switch, but if the voltages are both infinitesimally close to the Vin=Vout voltage, switching could take an arbitrarily long time.
The places where the slope of the transfer function is -1 define Vil, Voh, and Vih, though it's not quite clear whether there's any special significance to the spot where the slop passes negative unity beyond the fact that on every gate with whose transfer function's second derivative is monotonic, and whose output voltage range is as large as its input voltage range, will have such points.
Answer: I also see no specific significance in the points having a slope of -1,
The most important point of this transfer curve is the point "VM" where input voltage=output voltage. This property of the CMOS transfer curve is used to bias the CMOS unit and to use it as a "linear" amplifier because this point - more or less - is in the middle of the Quasi-linear part of the transfer curve. Simple biasing is possible using a large resistor between input and output of the CMOS device. This gives a stable bias point for amplification of an input signal - either connected via a coupling capacitor or via an additional resistor. In the latter case, due to negative feedback the gain is smaller but has a value that can be selected (and fixed) by the resistor values (opamp principle).
Answer: The output remains relatively unaffected with noise if the small signal model gain (dVout/dvin) of the circuit remains below unity. In the figure, the slope of the VTC begins from zero, becomes more negative above VIL, and it approaches zero again when Vin>VIH. That is why some designers consider the limits of margin noise at slope=-1.
Comment: Welcome to EESE. However, I hope you realize that you are answering a >3yr old question that already had a detailed accepted answer.


Name this insect

Question: This is the monsoon season and some black insects are flying in my house. They have a very bad smell. Does anyone know what is the name of that insect, including English and Hindi name?
Answer: Your photo is not exactly the best one for species identification. However, since you said that it has a "very bad smell", it seems to me that it is a bug (Hemiptera) from the Family Pentatomidae, which includes the stink bugs.
Quoting the Wikipedia page linked above:

The stink bug derives its name from an unpleasant scent from a glandular substance released from pores in the thorax when disturbed. The chemicals involved include aldehydes, making the smell similar to that of coriander. In some species, the liquid contains cyanide compounds and a rancid almond scent, used to protect themselves and discourage predators.

I have never been to India, but in South America I've encountered some stink bugs which produced a very disgusting smell, some of them unbearable (for a couple of seconds only).
Here is a close view of a stink bug (this one is not from Asia and, therefore, probably not your species):

Finally, to narrow it down to the species, you have to check the Pentatomidae species in India.
Comment: I think it is the earth boring dung beetle from the family Geotrupidae.
Comment: The photo is not a stinkbug, and it doesn't look like any dung beetle I'm familiar with.  I agree with MB_7 that this is a member of the Cydnidae, which are noted for their foul smells.
Answer: It is a bit old but since I ended up here while searching for the same insect, here is what I believe is the insect in question (I also have an experience with it in our little garden).
Its name is: "burrowing bug" or sometime referred as "Cydnidae" (scientific name).

Also, check out this video (if it still remains) :
https://www.youtube.com/watch?v=FABjzwRTeR4
Best regards,
Answer:
That's the earth boring dung beetle. It has a very bad smell and it belongs to the family Geotrupidae. You can learn more about it here https://www.britannica.com/animal/dung-beetle
Comment: Is there any way to get rid of them? As Their smell is very burst that if I flies on body and get rubbed. These insects are flying around my house as this is the rainy season.
Comment: @SagarGupta well you can check their source around your house and how they come into your house

Name this insect


My book has a similar characters as the book The One and Only Ivan. Will I get in trouble if I publish my book?

Question: We have completely different plots, I have several characters that are similar but different to each other. The One and Only Ivan had a gorilla, elephant, and dog, while I have a chimpanzee, elephant, and dog. The chimpanzee is different from the gorilla, however, the two elephants are similar. They have different intentions, but the traits are similar. Both elephants are curious. Both of them are away from their real home. The biggest difference is that the character from the One and Only Ruby is not shy, while mine is. Both dogs are completely different. Although I've added several tweaks to the characters, I'm afraid that they might be too similar. Will I get in trouble if I publish my book?
Comment: Hi Alexandra, welcome to writing.se! Take the [tour] and visit the [help] for more information. I've closed your question as it is very similar to one we've had before. That's ok! Duplicates can help other users find the answers they need easier. However if you don't feel that question answers yours, you can [edit] your post to clarify how it is different and flag your question to get reopened. Good luck and happy writing!
Answer:
Both Ellie and Ruby are curious. Both of them are away from their real home.

In all honesty, if those are the only traits they have in common, then it's unlikely that anyone is going to notice any similarity at all. Certainly, this isn't anywhere near enough for you to get in any sort of trouble if you were to publish your book.
If your protagonist was also called Ruby, and your story's plot was noticeably similar to that of "The One and Only Ivan", then that would be a different matter, but from your description, these books have so little in common that there's no possible way you could be accused of plagiarising it.
Comment: You should edit that information into the question, along with any other similarities you think your story may have with *The One and Only Ivan*. It's generally considered unfair to move the goalposts after a question's already been answered, but I think it would also be unfair of me to just ignore your clarifications and leave an answer that's only partially helpful to you.
Comment: Hey @F1Krazy, thanks for the immediate response. I just happened to found three other characters that are somewhat similar to The One and Only Ivan. In the One and Only Ivan, there a gorilla(Ivan), an elephant(Ruby), and a dog. The problem is, I just happened to have a chimpanzee AND a dog. They all have different traits that are unique, but I think that the species are a little bit too alike. The chimpanzee and dog characters are very different from each other. I may just be getting worried, but will I get in trouble if I include these characters as well?


Grafting branches on rootstock

Question: I have recently gotten into grafting. I just finished grafting my apple scions to my rootstocks. During that process I came up with a question. Typically you graft your scion to the trunk of the rootstock, somewhat low down on it. But if you planted the rootstock, let it develop branches, then grafted your desired scion(s) to the branches instead, would that work?
Comment: I seem to recall that it is possible to graft multiple types of scion to a single rootstock. That way you can have the wondrous spectacle of multiple types of apple on one tree. Even such glories as the tree having sequential flowering of different colors.
Answer: You can do that, but it's reputed to be very difficult to maintain, as generally whatever the most vigorous scion is will tend to "take over" and corrective pruning to prevent that is an ongoing battle you'll have to fight every year.
So it's not commonly done, in practice.

Grafting branches on rootstock


The difference between "take hours" and "last hours"

Question: We say: "the meeting will last two hours". But we say: "how long does the flight take?"
Please let me know the difference between last and take and when we should use each.
Answer: Both "take <time>" and "last <time>" are used to indicate the duration of an event. I think "take" is generally used to refer to a delay before you get the expected outcome, while "lasts" is used when the benefit (or pain) is ongoing.
Like, "It takes six months to get an application approved." As far as the applicant is concerned, nothing productive happens in that six months. He's just waiting for the end. But, "The flavor of the chewing gum lasted for an hour." You got the flavor all along. "From when we first saw the clouds, it took four hours for the rain to start. Once it started, it lasted two hours." It "took" time before it started; but once it started it "lasted".
Like I once heard a joke that went like this: The motor vehicle bureau has announced a 15% increase in the cost of all license renewals. But, they assure customers, they will get more for their money. In the future, all visits to the motor vehicle bureau will last 15% longer.
To ruin a joke by explaining it: The humor of this joke keys on the word "last". We don't think of a visit to a bureaucracy as an event to be desired for itself. So it "takes time" — we have to sit and wait. By saying it will "last longer" it implies that the visit is something fun that you want to do, like going to an amusement park.
Answer: Time is not something people can talk about without metaphors. The constructions

<Event> take <Measure of Duration>

<Event> last <Measure of Duration>

use different metaphors, with different affordances and assumptions.
(1) is the Subtraction metaphor that is prominent in the Time is Money theme,

A jawbreaker takes a dollar. ~ It takes a dollar for a jawbreaker.
A jawbreaker costs a dollar. ~ It costs a dollar for a jawbreaker.
He spent a dollar on a jawbreaker.

though this doesn't allow cost, because the TIM metaphor doesn't metaphorize cost, only spend. (the reason why is in the paper if anybody is interested.)

A haircut takes an hour. ~ It takes an hour for a haircut.
*A haircut costs an hour. ~ *It costs an hour for a haircut.
He spent an hour on a haircut.

Basically, this is useful when one wishes to refer to the extent that doing something detracts from the time at one's disposal, rather like subtracting cost from available cash.
(2), on the other hand, is part of the Time is a Journey metaphor theme, where last has its usual meaning of 'final, terminal, opposite of first'.
To last is an intransitive verb with a quantified temporal adjunct (e.g, three hours), and not a direct object. If three hours  were a direct object, it would Passivize, but it doesn't:

The meeting lasted three hours. ~ *Three hours were lasted by the meeting

Last as a verb means to continue moving (metaphorically) for some distance (= time), until reaching the end of whatever event is the subject of last. It doesn't behave at all the same way as take:

A haircut lasts an hour. ~ *It lasts an hour for a haircut.

and there are several other motion predicates one can use instead of last:

The meeting ran (on) (for)/went (on) (for)/continued (for) three hours.

This construction with last seems to refer to a limit on one's duration during the event, whereas with take it seems to refer to a limit on one's available time for the event.

He lasted until the third lap, but then a tire blew.
He took way too long to get to the turn.
Answer: You use take to state how long is needed to complete an activity. Your focus is on the end point or achieving a goal.

It took me 2 hours to get to the theater.

You use last when your focus is on the duration of an activity; the end of the activity is not the reason why the activity is undertaken.

The play lasted 3 hours.
Answer: In this context, "take" and "last", both refer to a specific amount of time.

Take: require or use up (a specified amount of time)

The jury took an hour and a half to find McPherson guilty.

It takes me about a quarter of an hour to walk to work

Last: (of a process, activity, or state of things) continue for a specified period of time.

The guitar solo lasted for twenty minutes.

The play didn't last more than ten minutes.
Answer: If you use "take," I believe you are implying that you are directly involved.  The meeting can take two hours, and you'll probably be quite bored.  If it lasts two hours, you're probably waiting for it to end so you can talk to someone else who happens to be in the meeting.
Events "last."  People "take."  Even if you say "It takes 3 hours to drive to Philly," you are referring to a person doing the driving. Or flying, in your example.
Comment: "It takes 3 million years for a supernova to end."  (Probably not accurate.)  I don't think the distinction you've made exists.


Visa or not visa in 2020 (type)

Question: I am spanish and I have got a job offer in the UK as a tutor in a college starting in August 2020. It Is not permanent job.
Do I need visa to work there as a spanish tutor?
I don't live in England.
Answer: As I understand it, during the "transition period" free movement still applies, so until the end of the year you can in-principle move to the UK and take a job without a visa. You can then apply under the EU settlement scheme to remain in the UK after the end of the transition period.
The big wildcard here though is the covid-19 situation. Right now face to face education in the UK is basically shut down and establishments are struggling to figure out how to teach remotely. People are being told not to travel unless it is essential. Frankly at this time noone knows how the situation will have developed by August.
Comment: The EU Settlement Scheme is probably not a viable option here, due to the residency duration requirements over the past 5 years.
Comment: My understanding is that as long as you arrive by the end of the transition period you can get "pre-settled" status. Then later if you remain in the UK you can upgrade to settled status.
Comment: @Moo Peter Green is correct.  The best course of action is to register for the settlement scheme to acquire "pre-settled" status.  Settled status is analogous to permanent residence under the free-movement directive (and the implementing regulations).  Pre-settled status is analogous to the "right of residence of more than three months" that currently automatically leads to a right of permanent residence after five years.

Visa or not visa in 2020 (type)


Can you build a retaining wall vertically with no angle?

Question: I am planning to redo our front steps in stone and my plan is to essentially have two stone walls on each side of the steps coming down from the entrance. For appearances it would be definitely ideal to keep these walls completely vertical for the aesthetic, but I am worried that the weight of the compacted gravel under the steps will be too much of a force pushing on the wall. PLUS, since were up in Canada, I'm concerned that water that inevitably gets into the gravel will push those walls outwards when it freezes. Is there anything I can do to keep it vertical or is that a pipe dream? Thanks for your help!
Comment: Hello, and welcome to Home Improvement. How tall would these walls be? Would you add a diagram? And, you should probably [take our tour](//diy.stackexchange.com/tour) so you'll know how best to participate here.
Comment: How long and wide are the steps, and what material will the treads be? Concrete block as a core could be more stable, and would avoid freeze/thaw expansion causing cracks.
Comment: A true retaining wall requires a footing. Do you have a footing. How big? How much rebar...size and spacing? If no footing, expect the wall to move and crack. (Depending on the size of the steps and height of wall, there is a way to support each other.)
Answer: I have built many vertical retaining walls. Drainage is the first concern then the height. Code may require rails over several feet (in my area 3' is the max). You did not specify the number of steps or the rise (if more than 3' even with drainage usually reinforcements are required). With some walls this is drilled holes that are pinned together. Some are mortar.
So yes you can go vertical but more information is needed on the height and conditions to give a specific recommendation.
Answer: if the walls are close to the steps they could support the treads directly. the steps could be hollow underneath instead of gravel fill.
alternatively mix some cement with that gravel fill it'll stand up on its own then.
Answer: Drainage will keep the water away from the backside. Vertical concrete walls are common but require reinforcing (due to tension forces) and an adequate footing that resists both overturning and sliding. Typically, non-reinforced walls, like the rock wall that you want to do, are often sloped slightly backward. They resist the soil simply through dead weight and gravity. If you want to be sure, consult a structural engineer.


how to gzip compress js/css in drupal 7

Question: My site will run on D7. but it will too slow. i want to compress (gzip) js and css. I have check my site on https://developers.google.com/speed/pagespeed/insights and it will told me for compression of js can css files.
Comment: Regarding "it will run too slow", I'm curious how slow you're talking about.  Compressing js and css is going to shave maybe 0.5 seconds off of your page load at best.  Arjan's answer includes "Cache pages for anonymous users" which is going to dramatically improve performance if your pages have been loading over 1-2 seconds.
Answer: The easiest way is to go to Configuration > Development > Performance (admin/config/development/performance), and enable:

Cache pages for anonymous users
Cache blocks

And also:

Compress cached pages
Aggregate and compress CSS files
Aggregate JavaScript files

For websites with mostly anonymous (not logged-in) visitors, this is often sufficient. Note that if you enable compression in Drupal, you should not enable page compression on the web server level (Apache) as well.
Answer: If you are running into a bit performance problem, the following two Q/A are worth to read:

https://drupal.stackexchange.com/questions/27834/why-drupal-is-running-slow?lq=1
https://drupal.stackexchange.com/questions/724/why-is-drupal-7-so-slow

how to gzip compress js/css in drupal 7


How to use diminished scale over I IV V changes in blues

Question: I want to spice up my solos over a Blues progression. I already can play a variety of scales but the Diminished scale is something I would like to add because of the particular sounds it creates. In what ways would I use it to enhance the solo?
Thanks.
Answer: In a standard 12-bar I-IV-V blues progression (here in F)
||: F7 | F7 | F7 | F7 |
| Bb7 | Bb7 | F7 | F7 |
| C7 | Bb7 | F7 | C7 :||
there are three places where you should start trying to incorporate the diminished scale:

bar 4, where the F7 chord can be interpreted as a dominant chord resolving to Bb7. Here you can add tension by using the half-whole scale (F-Gb-Ab-A-B-C-D-Eb) which adds some altered tensions to the F7 chord that resolve nicely to the Bb7 chord.
The second place is bar 6 where Bb7 moves to F7. Here we cannot simply interpret Bb7 as a dominant chord resolving to its I-chord, because in this case it should be followed by a chord with root Eb (Bb is the V of Eb). However, in your solo you can substitute the Bb7 chord in bar 6 by a B diminished seventh chord (Bdim7). This basically just means to move the root up by one half step and leave all other chord tones unchanged. You do this substitution by simply playing the B diminished scale (whole-half) over the Bb7 chord in bar 6. In this way you create tension which resolves to the F7 chord in bar 7 (Bdim7 resolves to F7/C). This substitution (Bdim7 for Bb7 in bar 6) is commonly done in a jazz-blues. But even if the chord is played as a Bb7, you can do this substitution in your solo.
The last place is bar 12 where the C7 chord is the dominant chord resolving to F7 in bar 1. Here you just do the same as in bar 4 (but with root C instead of F): you add tension by playing the C half-whole scale over C7 which resolves to F7.

The 3 bars mentioned above are the most obvious choices for using the diminished scale in a I-IV-V blues. Of course you can play the diminished (half-whole) over every dominant-seventh chord, but if you do this in a simple blues progression, you will stop sounding bluesy.
If you're interested in using different scales over a blues progression, you should check out this example by Oz Noy:
Scales over 12-bar Blues
Comment: Excellent explanation in the 12-bar format. I appreciate everyone for their input.
Answer: Consider the half whole diminished scale:
R b9 b3 3 #4 5 6 b7 R
All notes except one are very commonly used in blues soloing.
the inclusion of both the b3 and 3 gives the essence of blues (mixing major and minor). The 'blues note' (b5/#4) is there. All of the chord tones are there. The 6 is there. So it suits blues very well.
Try these over a dominant chord: (notes for an A7)
b3 3 R      (C C# A)
.#4 5 b7 R   (D# E G A)
6 b7 R     (F# G A)
They are all very familiar sounding blues licks.
However the b9 is very rare in traditional blues. The fact the scale has only one 'outside' note (in a blues context) makes this scale a great introduction to more outside jazz & fusion style blues.
As for your question, to incorporate it into your own playing you use that same method as you would (or should..) for any other scale: learn licks! Listen to jazz and fusion and you'll hear this scale often.
Here a short one to get you started (in A)
A C C# E G Bb C C# A
All ascending except for the final C# to A.
I won't mention the whole half dim. scale as it is nowhere near as useful in a blues context for reasons that should be obvious:
R 2 b3 4 b5 b6 6 7 R
Answer: There are two diminished scales, the half/whole and the whole/half. This translates ,in C,as C,Db, Eb, E, F#,G, A, Bb, for the first, as it jumps semitone/tone, etc. The other works starting with C, D, Eb etc.Both work best over a diminished chord. I have used note names as they came, not particularly accurately.
To fit into a solo, one way is to look at a bar, say, C7, and check which notes will fall on , say, beats 1 and 3. A run of triplets using the first 6 of the half/whole would put a C on beat one, E on beat two. If that was repeated, it would mesh in with the C chord underlying.
You may find that the other sounds better - or continue the rest of the bar going up. Key notes fit in key places, sometimes with a bit of re-timing, but that's what it's about .Try it. If it sounds good, it probably is.And vice versa...
If you're thinking just of the notes a tone and a half apart, they fit best over a diminished chord, more like an arpeggio.
Comment: Sounds like the diminished scale is creating tension wrapping around chord tones by a half step. Therefore a stronger resolution to the chord tones. Sounds like an example of a riff in Bebop soloing where you kind of wrap around the chord tones.
Comment: A diminished arp. Starting from any chord tone of a dominant chord Gives all the chord tones and one tension note: a b9 which resolves nicely to the root
Answer: What Fergus said is true if you start a diminished arpegio from any chord tone but the root. Lets say you are playing over A7 (A C# E G)
If you start a diminished chord over the 3th, C# you get C# E G A#
over the 5th, E you get E G A# C#
over the 7th, G you get G A# C# E
All the above had the same chord tones as a rootless A7 b9
But if you start a diminished chord from the root of A, you will not get those notes.
Answer: Many people are limited in their use of the diminished octatonic scale because they restrict their use of it to chords that fall exactly within the scale. While being exact is admirable, it only gets us so far!
Try using the Whole-half scale over the entire blues. Looking at the W/H, we see it's missing something we usually rely on: a perfect 5th scale degree. So we can add that one note and open up a world of possibilities. Or we can delay the appearance of that note and build tension.
Let's look at an F blues using F, G, Ab, Bb, B, (C), Db, D, E:
What we have here that we don't have with the Half/whole is the 4th scale degree, Bb. That's an essential note in building blues lines. What's unusual over the F7 chord is the E natural, the Maj 7 instead of flat 7. But think of many Parker blues, and you will realize why he liked the maj7 as a I chord in blues: it opens up the melodic strength of the leading tone. Listen to Bessie Smith or other old blues singers, and you will hear the maj 7 scale degree used melodically repeatedly. You may think this collection of notes are more appropriate for a minor blues progression, and of course, you're right, they are perfect for minor blues as well! Even in dominant blues, we will often hear the subdominant minor function pop up, in this case as a Bb min or an Eb7 in the 6th bar before resolving back to F. Or if we use the #IV dim 7 in that bar, we can still emphasize the b6 scale degree, creating a Db7/B sort of sound.
"What about the C7?" you ask. (I know you must have asked by now!) Well, this is a very special use of the diminished scale, because we're using it over a chord whose root isn't even in the scale! But it is in my Diminished Plus One scale. And we have the entire C7b9 chord available plus the b13. "Okay, great -- but what about the Gm7 that proceeds it?" Well, a Gm7 is also contained in there, as is a Gm7b5 if you prefer (a very cool alternative ii chord for blues!), but more importantly a G7 altered is available (or tritone substitute Db7).
So all the bases are covered. Except maybe that pesky little flat 7 (Eb) that you know and love so well. So throw it in there too; now you are using a 10-tone scale, but why not? It's still based on the 8-tone diminished scale that you have practiced and mastered.
Please try this before you pooh-pooh the idea! You'll have some fun, I think.


Com.pandora.android

Question: I have a photo that started showing up on my camera roll it is in its own file titled com.pandora.android. When I delete it and restart my phone is comes back. The path is /storage/emulated/0/bmwgroup/com.pandora.amdroid.
Does anyone know what it is or how to remove it permanently? This is on a Samsung galaxy 6.
Answer: The folder belongs to the Pandora app. You probably don't want to remove it as it will be needed for the app to function.
You can always remove the app and then delete the folder if you dislike it.
Alternatively, you could ensure that your photos app doesn't show photos from that folder (/storage/emulated/0/bmwgroup/com.pandora.android) if that's a supported feature.
Finally, you could create a file titled '.nomedia' in the folder. Then restart your device and the photos application should ignore the photos in the Pandora folder.

Com.pandora.android


Reducing flicker when you change images in a panel

Question: How do I reduce flicker in a vb2005 panel?
Inside the parent panel I have 2 other panels that I'm am using.
The outer most panel contains a background sprite and the two innermost panels are overlays that change to fit the places in the background sprite.
When I change the overlay sprites I would like to reduce the flicker and make it a smooth transition from one sprite to the next.
Here is the code that changes the images in the overlay panels
the overlay panel is not changed if the new value is the same as the old value
<code> Private Sub TrackBar2_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrackBar2.Scroll, TrackBar1.Scroll
    If (Panel2.Tag <> TrackBar1.Value) Then
        Panel2.Tag = TrackBar1.Value
        Panel2.BackgroundImage = tops(TrackBar1.Value) //img array for the top panel
        Panel2.Update()
    End If
    If (Panel3.Tag <> TrackBar2.Value) Then
        Panel3.Tag = TrackBar2.Value
        If (TrackBar2.Value > 0) Then
            Panel3.Location = New Point(182, 210)
        Else
            Panel3.Location = New Point(182, 209)
        End If
        Panel3.BackgroundImage = bottoms(TrackBar2.Value)//img array for the bottom panel
        Panel3.Update()
    End If
</code>
Answer: You're not going to like this answer. The flicker is caused by the fact that the default .NET panel is not double buffered - so it does all the drawing directly in the visible memory, not a back buffer.
You need to subclass the Panel class and enable double buffering on the new class. This can be done by doing a
<code>SetStyle
</code>
call in the constructor with the flags OptimisedDoubleBuffering and DoubleBuffering enabled.
Once you have the new panel class that is double buffered, you can use them in your application instead of the standard Panel.
I told you you wouldn't like the answer ;)
Answer: Rein is right, subclassing is the best way. In the meantime though, change that call from Update to Invalidate; that might help a little.


Can I replace "would" with "will" in this sentence "how would that benefit me."?

Question: I am watching a movie in which two people fight with two zombies. One of them says "Do you want to switch?" and
other says "How would that benefit me?"
In the second sentence can I replace "would" with "will"?
Answer: Yes, however the word "would" is a "lets just say this happened" or "might" but "not guaranteed" situation. When you change it to say "will", it changes the story to mean something that is going to happen .
Answer: You can do it.
But, the meaning of the sentence, which paraphrase looks like that 'How do you imagine my benefit from switching ? ' will change to the meaning of 'What is your sure knowledge about my benefit from switching?'


Performance-wise, is it better to link to data or paste values (Excel)?

Question: I've got a 300+ MB Excel file that I'm working with, to which I add a new sheet with a ~60,000 x 5 array of data, plus additional calculations using that data, every month.  Performance is not great - it takes forever to open.  I've done what I can to eliminate the use of volatile functions, other than a few indirect() functions for page referencing.  My question is whether it is better to paste values of the monthly data, or link to the data in the workbook that I'm sourcing it from (a new one each month).
Answer: I think you will find you get better performance out of pasting values. Less calculations for Excel to complete while opening the file. One thing that might help to is go to File>Options>Formulas and change calculations to manual. That way it won't be updating all the other formulas when opening the file, but when saving. You could open the file then click save when you are ready for the updates.
Hope that helps,
Brad
Answer: What Brad said, plus just checking, are you using a solid state hard drive as your hard drive? I find them a huge help in all demanding applications.
Comment: Unfortunately not.  It's a work machine.


Mounting multiple devices at a single mount point on Linux

Question: Is there a way to mount multiple hard drives to a single mount point? Let's say I run out of space on /home and decide to add an extra hard drive to the computer. How do I scale the space on a mount point? If I use RAID, can I add drives on the fly to increase space as I run out of them? Is there an alternative to using RAID if I am not interested in maintaining a high level of redundancy?
Comment: go for zfs on Linux.
Answer: You may be interested in UnionFS. It may be simpler to setup on an existing system than an LVM.
From the UnionFS page, http://www.filesystems.org/project-unionfs.html :

This project builds a stackable unification file system, which can appear to merge the contents of several directories (branches), while keeping their physical content separate. Unionfs is useful for unified source tree management, merged contents of split CD-ROM, merged separate software package directories, data grids, and more.

I hope you find this helpful.
Answer: You can use lvm for this. It was designed to separate physical drive from logical drive.
With lvm, you can :

Add a fresh new physical drive to a pool (named Volume Group in LVM terminology)
pvcreate /dev/sdb my_vg
Extend space of a logical volume
lvextend ...
And finish with an online resize of your filesystem
e2resize /mnt/my/path

But beware it's not a magic bullet. It's far more harder to reduce a filesystem, even with LVM.
Answer: The LVM answer is a good one, but raid can do this as well, so adding another.
The linux software raid (mdadm) does allow adding disks to an array that's already created. When you do it will re-balance the data onto the new drive.
If youre not interested in redundancy, you can use raid-0 which simply stripes data evenly across all disks.
However raid-5 offers at least some redundancy without losing much storage (you sacrifice one disk's worth).
But with that said, raid works best when all the drives are the same size. If they arent the same size, portions of the drive will be unused as it'll only use as much as the smallest drive. If I recall correctly, LVM stiping does not have this issue as if the drives arent the same size, the extra space just wont be striped.
Answer: You can use mhddfs instead lvm as if one disk is failed then only data on that disk will be lost.
It runs on user space using fuse modules but I'm using it for very heavy load infrastructure
[root@storagenode1 ~]# df -hl
Filesystem            Size  Used Avail Use% Mounted on
/dev/sdl2             259G  2.1G  244G   1% /
tmpfs                  48G     0   48G   0% /dev/shm
/dev/sdl1             485M   30M  430M   7% /boot
/dev/sda1              24T   23T  1.4T  95% /mnt/disk01
/dev/sdg1              24T   22T  2.6T  90% /mnt/disk02
/dev/sdf1              24T   22T  2.6T  90% /mnt/disk03
/dev/sdb1              24T   20T  4.5T  82% /mnt/disk04
/dev/sde1              39T   30T  8.3T  79% /mnt/disk07
/dev/sdh1              28T  6.6T   21T  24% /mnt/disk08
/dev/sdj1              39T   32T  6.5T  84% /mnt/disk09
/dev/sdi1              20T  792G   19T   5% /mnt/disk10
/mnt/disk01;/mnt/disk02;/mnt/disk03;/mnt/disk04;/mnt/disk07;/mnt/disk08;/mnt/disk09;/mnt/disk10
                      218T  153T   65T  71% /mnt/disk99

This is the main developer website,
and here you can download packages for Centos6, as I'm doing

yum install mhddfs
create mount points for local disks as normal and mount them
create anouther directory to hold all your disks, my case called disk99
mount all disks into disk99 using mhddfs

vim /etc/fstab  add this line
mhddfs#/mnt/disk01,/mnt/disk02,/mnt/disk03,/mnt/disk04,/mnt/disk07,/mnt/disk08,/mnt/disk09,/mnt/disk10          /mnt/disk99     fuse    defaults,allow_other,mlimit=10%,nonempty,logfile=/dev/null,loglevel=2   0       0

Warning: in my case with heavy load mhddfs was logfile size consuming and crashed the server many times, therefore I use /dev/null for logging.
I couldn't make logrotate work  with mhddfs because you need to remount when you change logfiles.
Answer:
Is there a way to mount multiple hard drives to a single mount point?

Probably not in the way that you want to. You can do all kinds of funny things, but this doesn't solve the problem you're trying to resolve.

Let's say I run out of space on /home and decide to add an extra hard drive to the computer. How do I scale the space on a mount point?

One approach would be the following steps:

add one or more new drives to your computer
create an LVM using the new drive(s)
format the new LVM (probably to ext4 or xfs)
mount it to a temporary spot (ex: /dev/tmp)
copy the contents of /home to the new lvm (/dev/tmp) with rsync or cp
do a "swaperoo" (unmount the old drive at /home, unmount the new drive at /dev/tmp and mount the new drive at /home
optionally extend the new LVM using the old drive
update fstab so that the mount is persistent across reboots

The above steps should probably be done by booting into an OS from a live USB/CD such as Gparted.

If I use RAID, can I add drives on the fly to increase space as I run out of them?

Yes you can.  Exactly how is hardware dependent (assuming you would be using hardware raid).

Is there an alternative to using RAID if I am not interested in maintaining a high level of redundancy?

"High levels of redundancy" is subjective, and not all RAID provides redundancy. Here's the high level breakdown of RAID options:

RAID 1 (mirroring) is fully redundant, probably don't want this
RAID 6 (2 parity blocks) can handle 2 disk failures without data loss, minimum 4 drives, probably don't want this
RAID 5 (1 parity block) is tolerant to a single drive failure, minimum 3 disks, might fit your needs
RAID 0 (striping) has no redundancy and you will loose all data if a single drive fails (though it provides great performance), might fit your needs

Alternatively, you could also use ZFS which is what I would do.  From Wikipedia: "ZFS is scalable, and includes extensive protection against data corruption, support for high storage capacities, efficient data compression, integration of the concepts of filesystem and volume management, snapshots and copy-on-write clones".  In my experience, ZFS is very flexible and can be configured (and tuned) to do most anything you want. It handles RAID, LVM, copy-on-write, fast compression, etc. It's a bit more involved to administer than ext4 or xfs, but if you have to mess with raid/lvm anyways then it's really not that different.


Transforming discontinuous functions for use in neural networks

Question: Are there any general methods of transforming discontinuous functions/values for use in something like a neural network?

For example:
Angles are discontinuous from 2pi -> 0, even though the values are essentially the same. The simplest transform I can think of in this case is to convert the angle into a set of minimum angular distances from 3 evenly spaced angles (0, 2/3pi, 4/3pi).
In that case, no two different angles should result in the same three distances, yet two very similar angles should always result in three very similar distances.
While I haven't extensively tested this, the transform seems more suitable when trying to use a minimally complex classifier (such as a single layer neural network).

I'm wondering if there is any sort of 'general form' of this style of transformation that could be applied to other situations.
Answer: Why not using sin(x) and cos(x)? (It's just the first idea that came to my mind)


What do I look for when getting a PPL at a college or local school?

Question: I am interested in getting a private pilots license and I know I can go to a near by airfield to get one. However I would like to know if anyone has received one through college and if it would be best just to wait until then? The cost at the airfield near me is around $12,000 but i have not found a cost for getting one in college.
Comment: You might want to mention in which region you live, or in which region(s) you would consider to acquire the license.
Comment: @ThundaChicken76 "What is best" questions will always get closed. However, if you were to rephrase it "What should I consider when comparing a & b" you'll likely get the question reopened.
Comment: The Midwest more, specific Indiana. I know Purdue has programs like and Western Michigan does as well. Other than those two I've had a hard time finding colleges that provide private pilots licenses.
Comment: Find the lowest cost flight school you can.  Part 61 or part 141 is irrelevant.  You will pay considerably more for a certificate at a college but the quality of instruction could be lower.  College instructors are typically low time instructors building time for airlines.  A local school may have more experienced instructors who teach because they enjoy it.  Just a thought
Comment: I believe Vincennes also has a flight program, and I think Rose Hulman does as well.
Answer: There are 2 major drawbacks to getting a PPL through a college program.
1) Admissions
In the comments you mentioned Purdue University. An excellent school, but they have very high academic standards (my son was interested in going there - didn't get accepted). There may be some variation for admission to the flight school program vs other degree tracks, but you'll still have to get admitted to the university of choice.
2) Cost
When getting your PPL in conjunction with a college degree, you're going to be taking a whole lot of general education courses that don't apply to flying. To go back to your Purdue example, they will not want you parading yourself as a proud Purdue alumn, yet not have the basic education levels that people would expect from a Purdue grad (IU v Purdue sparing aside). That means you're going to be taking writing and basic math and humanities classes, none of which have anything to do with getting your PPL. Each one of those credit hours will cost you. As will your flight hours. A school like Purdue is a prestigious, Big 10 school and tuition there ain't cheap. Purdue (again, mentioned in the comments and I have some personal experience) will run somewhere in the neighborhood of $30,000 per year for in-state tuition. I don't know the length of their flight school program, but you could do 2.5 trips through the flight school you mentioned for that kind of money.
If you go the straight up flight school route, you're going to be paying for flying lessons and flight time and that's it. Not having gone to flight school, I don't know what the admissions criteria are, but I'd venture it's not much more than having a medical certificate and the cash to start paying. If you run out of cash, you can put your training on hold for a while.
Of course, if you're going to school to get a degree and you want to make getting your PPL part of the process, not the sole reason for being there, that's a different story as far as classes go, but you're still paying a lot for the privilege of taking flight lessons through a university.
Comment: @ZeissIkon I was gettin' there! I wanted to have an answer in before the question got closed...
Comment: The usual advice is not to answer "bad" (likely to be closed) questions -- if you know it's going to be closed, rushing in an answer isn't desirable.  Ideally, if a question is closed as OT, opinion based, or unclear, it shouldn't have answers when it closes.
Comment: @ZeissIkon that's quite true, and I've said that myself to others... I think this could be quite salvageable if it were rephrased "what do I look for" as opposed to "which is best". I'll go make that suggestion.
Answer: You go to a college because it's part of a career track and as such will be filled with all sorts of courses that are professionally useful but not directly related to learning to fly airplanes.  And it won't be any cheaper.  If you just want to learn to fly for recreation, find a local school with the best instructors and equipment.
Probably the best overall and cheapest way to do a Private it is to find 2 partners and buy a trainer (2 partners gives you the optimal dilution of fixed ownership costs), and hire an instructor to train the 3 of you.
And if you really want to learn to fly, properly, start with glider training first.
Comment: Thanks for the response, and I am planing on going to college for aviation technology/aerospace engineering. I just was curious on which would be more beneficial college or local school for PPL.


how to import songs from iphone music library to my app

Question: I am developing a music app where i need to copy songs from iPhone music library to my app's document directory. I need the Objective-C code or framework if any to select multiple songs from music app and save to my app. I have search stackoverflow but could not find a complete solution.
Comment: Welcome to SO, please be a bit more specific when asking question: what have you tried, what do you expect, etc. See [how to ask](http://stackoverflow.com/help/how-to-ask)
Comment: Thank u. I have tried this. https://bitbucket.org/artgillespie/tslibraryimport
Comment: I want that songs be imported with all its meta data
Answer: Please refer below Links..
You can access the Media Files in iTunes using MPMediaPickerController
MPMediaPickerController *mediaPicker = [[MPMediaPickerController alloc] initWithMediaTypes:MPMediaTypeMusic];
mediaPicker.delegate = self;
mediaPicker.allowsPickingMultipleItems = YES; // this is the default
[self presentModalViewController:mediaPicker animated:YES];

Below link is what you need.
http://iphoneghostrider.blogspot.in/2014/05/import-music-and-save-it-to-document.html
Below link is used to Import Media Files to Documents Directory
Application crashed while importing songs from Ipod library in Iphone for iOs 5.0
Below link is the sample give by Apple
https://developer.apple.com/library/ios/samplecode/AddMusic/Introduction/Intro.html
Hope it helps you...!
Answer: Swift 4 version based on Vidhyanand's answer:
let pickerController = MPMediaPickerController(mediaTypes: .music)
pickerController.delegate = self
present(pickerController, animated: true)

Also make sure to include the following usage description to your Info.plist, otherwise the picker will not be presented:
<key>NSAppleMusicUsageDescription</key>
<string>Usage description</string>

Answer: You need the Media Player framework:
MPMediaLibrary, MPMediaQuery, etc.
MPMediaQuery *everything = [[MPMediaQuery alloc] init];

NSLog(@"Logging items from a generic query...");
NSArray *itemsFromGenericQuery = [everything items];
for (MPMediaItem *song in itemsFromGenericQuery) {
    NSString *songTitle = [song valueForProperty: MPMediaItemPropertyTitle];
    NSLog (@"%@", songTitle);
}

(OR)
Try this link
http://code.tutsplus.com/tutorials/ios-sdk-music-library-access--mobile-6188
Comment: sir i want the songs to be imported and saved in my apps document folder. Also i want that songs be imported with all their meta data
Comment: follow this link......step by step http://code.tutsplus.com/tutorials/ios-sdk-music-library-access--mobile-6188
Answer: Open Xcode and select "Create a new Xcode project". Select "view-based application" and click "next". Enter a name for your project (I called mine "Music"), enter your company identifier, make sure you select iPhone for device family, and then click "next". Choose a place to save your project and click "create".
Step 2: Import the MediaPlayer Framework
In the navigator area of Xcode 4, select the project name (in our case "Music"). Next, select the current target ("Music" here again), and then select the "Build Phases" tab. Expand the "Link Binary With Libraries" option, and then click the "+" button to add a new framework. Type "MediaPlayer″ into the search box, and select the MediaPlayer.framework option that appears in the list. Click "Add" to include this framework in the linking phase of your project.Now that you have added the media player framework into your project, you need to import that framework into the view controller that will use the iPod
library. Go to the MusicViewController.h file and insert the following line of code below the UIKit Step 3: Importing the Project Images
Download the source code and drag the images map to your project. Make sure that the checkbox by Copy item into destination group's folder (if needed) is checked. This map contains the images we will use in this app.
Step 4: Designing the Interface
In the "Music" folder in the "Project Navigator" click on MusicViewController.xib.
Drag a UIImageView from the library to the view. Make sure the utilities window is shown and go to the Size Inspector. Set both the width and height to 200, the x-coordinate to 60 and the y-coordinate to 20. This image view will show the songs artwork.
Now drag a UISlider to the view and arrange it with the blue guide lines to the bottom of the view. Also make it a bit wider, so it uses the entire width of the view between the two blue guidelines. We will use this slider to adjust the volume.
Now drag 4 UIButtons to the view. Drag the first one under the image view and set its title to "Show Media Picker". This one will do just what the text says. The other three buttons will be the control buttons. Select the other three buttons and go to the Attributes Inspector. Set the type to Custom and set the image of the buttons respectively to PreviousButton.png, PlayButton.png and NextButton.png. Arrange the buttons like below.
At last, drag three UILabels to the view. Delete the text of all the labels and arrange them like below (I added some text, so you can see where the labels are. You won't need to add this text). These labels will show some information about the currently playing song.
Step 5: Making the IB Connections
Now that we have designed out interface, we can make the connections. Click the middle button of the editor to show the assistant editor .
Click the image view and CTRL-drag to the interface. A pop-up will show. Enter the text "artworkImageView" for name and then click "connect."
Now Click the slider and connect it the same way, but name it "volumeSlider". CTRL-drag again from the slider to the interface, but this time under the curly braces. Set the connection to Action instead of Outlet. Enter "volumeChanged" for the name and make sure the event is Value Changed and click "connect".
These 4 buttons also need actions. Connect them the same way the slider action was connected. Name the actions as follows:
Show Media Picker button: showMediaPicker
Previous button: previousSong
Play button: playPause
Next button: nextSong
The play button also needs an outlet. Connect it the same way we connected the outlet for the image view, but name it "playPauseButton".
At last we need to create the outlets for the labels. Connect them again the same way we connected the image view outlet. Name the first label "titleLabel", the second label "artistLabel" and the last label "albumLabel".


Duplicate protocol definition warning, but I need multiples of this protocol

Question: Note: This is similar to this question but it is not the same. I promise.
I have a series of table views that call upon a modal view for sorting the table's contents. To do this, I set up a simple protocol in one table view controller's header file and it worked great. I then copied this protocol over to my other table view controllers and got this warning:

Duplicate protocol definition of 'ModalViewDelegate' is ignored

Now I realize it is just a warning, but I would rather not see it every time I compile. To get rid of the warnings, I imported the header file in which the protocol was originally defined. Once again, I was not completely satisfied. It seems sloppy to import the header file to every table view just so I can use the protocol without warnings.
If you have read this far, I thank you. My questions are 'Why is this happening? Is there a better way of getting rid of this warning while still using the same protocol?'
Comment: Implement the protocol in its own header and include where needed.
Comment: Without code it's gonna be really hard to do anything useful.
Answer:
Is there a better way of getting rid of this warning while still using the same protocol?

The compiler needs to know about the protocol in order for you to refer to it. There's two ways you can make that happen: import the header where the protocol is declared into the files where you're using it, or make a forward declaration of the protocol in those files: <code>@protocol MyProtocol;</code>. The second is really only useful when protocols need to refer to each other (to avoid circular imports); if a class needs to adopt the protocol, it needs to see the declarations of the methods in the protocol, which means it needs to see the protocol declaration itself, i.e., the header.

It seems sloppy to import the header file to every table view just so I can use the protocol without warnings.

This is not sloppy, it's the way things work. It sounds like it may make sense for you to put the protocol declaration into its own header and import that wherever it's needed.
Comment: Thanks! I totally forgot I could make a header just for the protocol. This is the solution I was looking for.
Answer: I discovered a similar warning where a @protocol was defined within the header of a class.  Breaking that protocol out into its own .h and importing it elsewhere fixed it.