List Template issue on Sharepoint Foundation 2013

Question: I have an issue with the list template on Sharepoint Foundation 2013.
I've downloaded list as a template from SP 2007 (calendar is my template list in this situation). Done everything with .stp, .cab and back to .stp files and uploaded it to SPF2013 List templates. All is fine here.
THE ISSUE: I'm trying to add an app using that template and after a while trying to add it, SPF2013 throws me an error message "Unexpected error". The error message itself is blank - SPF2013 help window doesn't give me any info.
The only reason that I can think of for this to happen - there are more than 1000 entries in the calendar. However, I was able to import couple of calendars with more than 1000 entries no problem, it just suddenly stopped doing that for the next ones.
My question is - does anyone know why the error occurs and the app can't be added based on the template? Is it due to the amount of the entries?
Answer: You can't export a template from a previous version of SharePoint and expect it to work. You need to rebuild your template in SharePoint 2013.
Comment: Well technically I agree and disagree with you.
I have multiple templates that I've exported from SP2007 (saved list / calendar as a template in .stp file) and migrated them onto SPF2013 using this information http://www.sharepointdiary.com/2011/09/migrating-sharepoint-2007-site-list-templates-to-sharepoint-2010.html
However, some specific templates simply doesn't load and I presume it's due to the size of it / contents.
Comment: Yeah, it's officially not supported to do so although there are hacks to work around it.
Comment: Thanks anyway, Trevor! After multiple templates worked for me this way - I would more expect it to work rather than not. So just thought there are some size limitations etc. It might be the structure of the lists / calendars, but it's weird when calendar with 1200 entries works perfectly fine and then calendar with 1248 entries doesn't..


How to download the contents of a paginated Jquery/JS table?

Question: My wish is to download the entire contents of a paginated Jquery or Javascript table, without having to click by hand on every of the 200 pages and copy the contents.
Example of table to get :
http://theforexchampionship.com/ranking/
In a more general way, this question applies to tables created by JQuery plugin such as Jquery Datatables ?
Is there a way, like, an automated script, a tool to inject parameters in the JS (such as "0, 999999" boundaries to a JS lib that would provide a function with a min and max bounds), or some way around it??
Precision : I am talking about a website of which you do NOT have access to source code
Comment: Are you talking about Data-Scraping? You want to scrape the data from a website you don't own?
Comment: The backend is sending a table, no json, so don't know if that will be usefull for you..
Comment: @Fresheyeball : yes, i didn't know there was a word for this.
Answer: There is usually a data service behind such tables (i.e. something that will reply with the data for every page).
Have a look at the source code of the page to find out how it works and then write your own code which connects to the same source, fetches the data and displays it any way you like.
Note that you don't need a web server for this; a local HTML file with some JavaScript in the same folder will work.
Some things that might hurt on the way:

If the site needs authorization, you will have to replicate that somehow
Data in databases is protected by copyright or special legislation in some countries; be aware that someone might object
Even if it would be legal, some admins/companies hate it when people hammer at their doors. If you don't want to be banned, ask for permission.
Answer: You could use trigger to execute client events and then loop through each table cell using each


Can you disable apache logs for a single site using htaccess or in the Virtual Host settings?

Question: I'm working on a web site where the client doesn't want ANY logging on the site for privacy reasons. The site will be hosted on the same Apache Web Server as a number of other websites which is why I can just turn logging off in Apache. Is there some way to disable logging for an individual site using htaccess rules or by adding something to the VirtualHost settings?
Answer: The options seem to be

Sending to /dev/null on *nix or C:/nul on Windows (see here)
Removing the base logging directives and duplicating them in each vhost (so there is no logging on for vhosts by default)

Seems like there should be some better way to do this, but that's what I've found.
Answer: Yes, just comment out (using a '#') the ErrorLog and CustomLog entries in the httpd conf for your virtual host.
http://www.mydigitallife.info/how-to-disable-and-turn-off-apache-httpd-access-and-error-log/
Comment: That works for disabling logging for the entire web server, which will work, BUT I was hoping to be able to do it on a site by site basis.
Answer: I achieve this by making the logging dependent on a non-existing environment variable. So in the VirtualHost you can have:
CustomLog /var/log/httpd/my_access_log combined env=DISABLED

and so long as there is no environment variable called DISABLED then you'll get no logs.
I actually arrived here looking for a neater solution but this works without having to change the global httpd.conf.
Edit: removed reference to .htaccess because CustomLog only applies in the global config or in the virtual host config as pointed out by @Basj
Comment: This does not seem to work from `.htacess`, only from global config or VirtualHost: https://httpd.apache.org/docs/2.4/mod/mod_log_config.html#customlog
Comment: More info in the "conditional logging" section, https://httpd.apache.org/docs/2.4/logs.html


How to set a field's value on the view mode of a NetSuite custom record, using client script?

Question: I have a doubt about the nlapiSetFieldValue and nlapiGetFieldValue methods on NetSuite API.
Do these methods work somehow on client script, when the record is in view mode? I'm having a hard time getting and setting any fields values without accessing the DOM elements directly.
Here's what I'm trying to achieve:
I have a process running in background, and on a custom record's view mode I have a button to check its status. When the status changes, I only need to refresh one field with its current value, wich I'm getting via a restlet call.
I'm trying to avoid reloading the whole page, to improve performance.
Please notice that I don't need to commit the value, because it already is saved on the record. I just need to show the updated status on runtime.
Thanks in advance.
Answer: I just received an answer from the NetSuite team:
There isn't a way to use API methods to achieve this, so their suggestion is to reload the page on this case.
You can always access the DOM elements directly, but this is not a best practice.


Should we display Title of the Menu on the header even though user can see the menu title on the sidebar?

Question:
Do we still need to display the title on the header, if the title already can be seen on the sidebar like in the wireframe?
Answer: Not all users can 'See' the title.
Headings can help "chunk" and label groups of related content. And people who use assistive technologies such as screen readers can quickly and effectively navigate a page by its headings. When you make things accessible, they become easy to use for everyone.
Also, headings are required to meet the AA standard by WCAG SC# 2.4.6
Answer: Yes, I believe it's still very important to display the title.

Title helps and aids the page's hierarchy
Better SEO. source
Responsive (in case you need to hide the navigation for mobile, or if it is a feature even on desktop)

One of the best examples would be this very website we're on, if you click on "Questions" for e.g. you will notice that there is a title on that page "All Questions".


What kind of 24 inch bmx is this?

Question: I have a 24 inch bmx and have no clue what it is. I need help please!!!
Comment: I believe it's a bicycle.... a blue one.
Comment: It might be black and gold depending on the light.
Comment: We're kidding around a bit, but the net-net is that it's a generic kid's BMX, likely produced in some anonymous Chinese factory and fitted out in another with decals to suit Walmart or whoever eventually sold it.  Was never anything expensive, but it might at one time have been equipped with Batman or Princess Sofia decals and other accouterments -- whatever would catch the eye of a kid.  (Though such embellishments would be more likely on a 20 inch bike.)
Comment: Does the rear wheel coast or is it a fixed speed ?
Comment: @RoboKaren - Are you sure it's blue?  I'd tend to call it "aqua".
Comment: There is one point that makes the bike unusual, and perhaps a step up from the typical BSO -- the three-piece crank.
Comment: And the yellow-painted rear hub is also unusual, though I can't tell if that's after-market.
Answer: Its a generic BMX that has been ridden by a rider too big for it - the handlebars are leaned away from the saddle
Likely its been stripped of both brake systems - I can clearly see cable lugs under the top tube, and some kind of brake mount on the seat stay right by the tyre.
The tread pattern differs significantly between wheels, with the front being much knobblier.   I suspect one has been replaced and not the other.  Doesn't mean anything much.
Can't really tell if its been painted over or not.  There are no visible decals or badges in your photos, so its quite hard to say more.
I suggest you fit brakes as per your local law's requirements, give it some maintenance, and enjoy riding your new blue bike.
Knowing the brand is a bit like knowing the parents of a mongrel/pound dog.... Knowing won't change the dog one bit.
Comment: No decals and the general state. If you bought it, make sure it has not been stolen.
Comment: Just because it has cable lugs does not say it ever had brake cables.  (Though I guess the unused brake lever on the handlebar suggests that there was once some sort of hand brake.)
Comment: > Knowing won't change the dog one bit. --  Except for in BMX, knowing the brand will let you know what material the frame could be. It's generally good practice to avoid High-ten steel frames (within the bmx community).
Answer: It's not 24 inches. of 20-in BMX Hoffman bike that's been through a lot of changes.
I'm only 30 and I know my bikes.
There's a 20 inch not a 24.
Change the grills out for 2x 20-in rims and throw those 24-in rims out in the trash.
There's a three piece crank. That's mountain bike parts.
Mike's don't have those 20 inches only, right now.
It is not x games 20-in bike.
It's a Matt Hoffman.
Comment: Welcome. It would help if you could separate your sentencese, best using full stops, to make your statement clearer. It is really hard to understand (though I am not a native English speaker).
Comment: Hi, welcome to bicycles.  This is very difficult to follow, but you seem to be identifying it as originally a 20" Mat Hoffman bike.  Which one?  A picture showing a bike matching the frame proportions and visible details of the one in the question will go a long way to making this a better answer.
Answer: This is most likely a contract bike, made by one company for another. My best guess is that it was made for the "XGames" brand by "WeThePeople". ESPN own the XGames brand, but does not make mikes. They originally contracted with Tony Hawk to make skateboards and Mat Hoffman to make BMX bikes.
Criggie had some good points, it was spray painted (they didn't remove the headset cups or the sprocket before painting it) and it is NOT a major brand BMX. You can tell by a few key points. The forks are 1" threaded with a "Wedge down the Tube" neck rather than 1-1/8" threadless. The rear axle is 3/8" rather than 14mm. It came with pegs already on the bike, larger dropouts and the washers are missing (pegs act as the washers, hence the lack of washers once removed, and major bikes don't usually sell you bikes with pegs, they expect you to supply your own). The seatstay is pinched to fit a larger front sprocket. No welded Gyro bosses. The headset and bottom bracket are not using sealed bearings (you can see by the adjustment slots in the BB cone) and the headtube does not use an integrated bearing cup.
I can't find any pictures of this particular bike, but this is why I am pretty sure it was made for "XGames" by WeThePeople. Here is an image of a recent XGames FS20:

This is not the same year as your bike, so there are some differences: the downtube is curved, the brakes are more like V-Brakes (bosses are lower than the rims) rather then the 990s (like yours, up by the tire). Now lets focus on the similarities:
3/8" axles, seatstay/chainstay taper at the rear welds, seatstay/toptube welds at the seattube, the style of the pinch in the chainstay tube by the sprocket. Now for the parts that could have been changed, but most likely not (any why I think it is an XGames contract bike) the seatpost, seatguts, reflector, seat clamp, brake lever are all the same, and the seat on your bike says "FS20" which is not the brand of the bike but rather the brand of the parts maker. Contracted bikes will often use the same parts company even if they change frame welders.
Now let look at why I think the frame was contracted with WeThePeople:

This is a 2017 "Curse FS20" by WeThePeople. There are differences: they used a 14mm rear axle, the smaller sealed bottom bracket, smaller front sprocket so no pinch in the chainstay, integrated headset cups, welded Gyro bosses. Now for the similarities: same rear tube taper at the welds, the same bend from the bottom bracket around the tire, same tube cut shapes for the seatstay and toptube at the seattube, reinforcement gussets on the toptube and downtube at the headtube, and the brake bosses are at the same spots as on your bike. Why is this last part important? Most companies will use the same jig for their bikes, for welding.
This is just an educated guess, and since it is not made by a major bike company, there is not really any website to find for them.
And here is the crossbar on the seatstays

This is NOT a "Curse FS20" by WeThePeople, I am guessing it is from the "XGames" line, but not sure the year or model.
Comment: And the seat stays of the bike in the question are completely different from the Curse FS20 (the Curse has a cross-member just above the tyre, whihc the bike in the question doesn't). I'm honestly not sure how to evaluate this: as you say, there are many similarlities but there are also many differences.

What kind of 24 inch bmx is this?


What type are these planes that are flying in formation near Culver City, CA?

Question: My son in law took these images a few days ago in Culver City California. We would like to know what the vintage (WWII ?) planes are, and in the last image, what would cause such a contrail. The last image is a composite of several shots. (Something landing at Edwards was my guess). His guess for the aircraft are that they are all the DB Dauntless.
Comment: This is likely [Tiger Squadron](http://www.tigersquadron.com/Formation-Flying-Air-Shows-Los-Angeles-CA.html), perhaps flying for the Israel Independence Day Festival over Rancho Park in mid May, as detailed on [their Facebook page](https://www.facebook.com/TigerSquadronRPA).
Comment: low altitude contrails are done by a smoke generator see [sky writing](http://en.wikipedia.org/wiki/Skywriting)
Comment: The wings apart to rectangular to be a dauntless imho.
Answer: My (current) guess is that it may be a
Nanchang CJ-6

The Nanchang CJ-6 is an aircraft designed and built in China for use
  by the People's Liberation Army Air Force (PLAAF) as a basic trainer.

Round nose.
Sufficient number airworthy.
Rectangular wing shape.
Main gear folds inwards and the nosegear backwards which seems to fit when I zoom in your pictures.

and they do airshows:

(source: riversideca.gov)
Coincidentally, the upper-left aircraft #43 also appears in your pictures (first picture, rightmost aircraft). Another below of her below:

update: as Cardinal said above, "This is likely Tiger Squadron, perhaps flying for the Israel Independence Day Festival over Rancho Park in mid May, as detailed on their Facebook page."
Comment: @DavidDelMonte if you have decided that MikeFoxtrot's answer is correct, please mark that his is the accepted answer. This will "close" this question, helping aviation.se keep a 98%+ answered question rate.
Comment: @MrWonderful I think it's a visual thing from the angle reinforced by the aircraft banking. The aircraft above is the same as in the OP's photograph. The tail registration while difficult to make out appears to match.
Comment: The CJ-6 appears to have a fairly straight-across (perpendicular to the fuselage) leading edge, whereas the photos from the OP seem to indicate a leading edge that is more swept-back.
Answer: That looks like the Red Stars Aerobatic Team - they fly Yak-52s
http://en.wikipedia.org/wiki/Yakovlev_Yak-52
It is hard to tell from your picture, but the overall look of the team itself, the prominent red stars on one of them, and the rounded tail make me think that's who it is. I tried to find their schedule and see if they would have been in your area, but they apparently don't have a web site.
Here's a video I shot of them in 2009 - https://www.youtube.com/watch?v=0A5qYqcQsxw
OK yes... I found their site. Looks like they had an event in CA this weekend, but not very close to you, and the event was cancelled... so they might have been flying around for fun and practice.
http://flyredstar.org/calendar.php
Comment: Had a look at the Yak52 but dismissed it as @JanHudec said for the landing gear. However, the Nanchang CJ-6 was based on the Nanchang CJ-5 which itself was a license built copy of the Yak 18, which also was the predecessor to the Yak52, so the connection is certainly close.
Comment: Definitely not. The aircraft in the photographs _don't_ have rounded tail and _do_ have the main gear mostly covered which Yak52 does not.
Comment: The thing is, I wouldn't expect a team of those to be over Culver City at any time. When I see a formation like that, I think "what aerobatic teams" and I didn't really think beyond that. They are all very similar. It is very hard to identify planes from photos like these. The planes in the photo look a little long, but they could even be these... http://en.wikipedia.org/wiki/Grumman_F6F_Hellcat   which is a heck of lot more likely than a bunch of Chinese planes.
Comment: @Jasmine they are not uncommon. if i read the from the FAA's databsase correctly there appear to be at least 25 in California alone. if you open the photos in a new tab the resolution is pretty good.


Can't connect to MongoDB with cgi script

Question: This works fine from the command line, but not through the web:
#!/usr/bin/python
# -*- coding: utf-8 -*-

import cgitb
cgitb.enable()
from pymongo import Connection

print "Content-Type: text/html"     # HTML is following
print                               # blank line, end of headers
print "<TITLE>CGI script output</TITLE>"
print "Here"

connection = Connection()

The file is in my cgi-bin directory.  When I try to run it through the web, I get:
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
/var/www/cgi-bin/test2.py
9 print                               # blank line, end of headers
10 print "<TITLE>CGI script output</TITLE>"
11 print "Here"
12
13 connection = Connection()
connection undefined, Connection = <class 'pymongo.connection.Connection'>
 /usr/lib64/python2.4/site-packages/pymongo/connection.py in __init__(self=Connection(None, None), host=['localhost'], port=27017, pool_size=None, auto_start_request=None, timeout=None, slave_okay=False, network_timeout=None, document_class=<type 'dict'>, tz_aware=False, _connect=True)
303
304         if _connect:
305             self.__find_master()
306
307         if username:
self = Connection(None, None), self.__find_master = Database(Connection(None, None), u'__find_master')
/usr/lib64/python2.4/site-packages/pymongo/connection.py in __find_master(self=Connection(None, None))
507                 return node
508
509         raise AutoReconnect("could not find master/primary")
510
511     def __connect(self):
global AutoReconnect = <class pymongo.errors.AutoReconnect>

AutoReconnect: could not find master/primary
  args = ('could not find master/primary',)

MongoDB is running on localhost.
Answer: I have resolved this myself.  My script's access to the DB was being blocked by SELinux.
Try (as root):
setsebool httpd_can_network_connect
setsebool httpd_can_network_connect_db 1


how to add to cart button in drupal 8 commerce?

Question: I am using zircon theme for my commerce site need to add cart and checkout pages to my site,how to create an add to cart button in drupal8 for product display which goes to cart page.
Comment: I believe the orders and cart functionality in commerce 8 isn't finished yet. According to their latest blog post: https://drupalcommerce.org/blog/43978/commerce-20-alpha2-released
Comment: Yes, see also http://drupal.stackexchange.com/questions/190329/how-do-i-go-to-the-checkout-page-from-the-cart
Comment: Commerce for D8 is now at beta7
Answer: Wait until alpha3 is released, recreate your site, and use the core Add to Cart functionality on your product pages. Note: as we've been saying for some time, there is no alpha to alpha upgrade path, so you'll have to rebuild the site from scratch each time until we hit beta in late March.
Answer: Commerce 2 for Drupal 8 is now in Beta and we do have a cart to play with now, YAY. But adding a button for add to cart is not that clear.
I answered similar question here:
https://drupal.stackexchange.com/a/239399/6488


Which philosopher should be attributed the saying 'I know that I know nothing': Plato or Socrates?

Question: As per Wikipedia, the paraphrased quotatation is found in Plato's account of Socrates, but it is not confirmed whether Socrates really said such a thing. Is it then okay to say that Plato said 'I know that I do not know'?
Comment: For what we know, the statement reflects Socrates' approach to philosophical inquiry
Comment: Neither said it, it is a late Latin paraphrase, see [I know that I know nothing](https://en.wikipedia.org/wiki/I_know_that_I_know_nothing). But Plato in *Apology* puts a similar idea into Socrates's mouth. You can say that Plato's Socrates said it, a fictional character distinct from historical Socrates.
Comment: If you are satisfied with the answer below, please accept it.
Answer: Mauro is right.
Xenophon in his Memorabilia (Memories of Socrates) quotes Socrates as saying, with regard to the temple inscription, gnothi seauton, 'know yourself':

That much I made quite sure I knew, at any rate; since if I did not know even myself, what in the world did I know? (https://www.gutenberg.org/files/1177/1177-h/1177-h.htm).

In Plato's dialogue, The Apology of Socrates, mainly a speech rather than a dialogue, Socrates tells us that his friend, Chaerephon:

went to Delphi and boldly asked the oracle to tell him ... whether there was anyone wiser than I was, and the Pythian prophetess answered that there was no man wiser (Apol. 21A; http://classics.mit.edu/Plato/apology.html).

Puzzled by this Socrates finally decided that:

the truth is, O men of Athens, that God only is wise; and in this oracle he means to say that the wisdom of men is little or nothing; he is not speaking of Socrates, he is only using my name as an illustration, as if he said, He, of men, is the wisest, who, like Socrates, knows that his wisdom is in truth worth nothing (Apol.23A-B; http://classics.mit.edu/Plato/apology.html).

Whether Socrates said the things Xenophon and Plato attribute to him, we shall never know. Unfortunately the oracle is not on hand to help but neither asribes to him the view that 'I know that I know nothing'.
Comment: This is probably the best answer the records allow. Socrates left no writings, and I believe the only contemporary sources to compare with Plato's dialogues are Xenophon and, even less reliably,  Aristophanes. Certainly the phrase captures the gist of everything few know about Socrates, and since he was apparently quite talkative the odds are good he actually said some such thing in his sociable life.
Comment: @Nelson Alexander. Thanks for comment. The phrase certainly squares with the early Platonic dialogues in which Socrates searches for truth but never finds it. Even in a middle dialogue, the Republic, the figure represented as Socrates runs out of road and can offer only similes, allegories and myths. Thanks again - Geoff


Dropbox can't sync "write.lock" (access denied)

Question: I have my Eclipse IDE workspace stored on Dropbox, this way I can access the same environment from multiple computers. Recently Dropbox is stuck syncing the write.lock file in the Eclipse workspace's .metadata folder. Dropbox says can't sync "write.lock" (access denied). Does anyone know how to fix this? It is quite annoying because it means the Dropbox taskbar icon constantly the syncing icon... Thanks for helping!
Answer: That appears to be a temporary file created by Eclipse; it indicates that an instance of the IDE is currently operating on the workspace. Dropbox can't sync it because Eclipse is holding it open - that's the point of it being a lock.
If you aren't using any Eclipse plugins that store settings in .metadata, you can use Dropbox's Selective Sync feature to exclude that folder from synchronization. Selective Sync is in the Dropbox preferences, on the Account tab.

Uncheck the .metadata box in the Selective Sync folder tree to make your computer not try to upload it.
Comment: I don't know if the .lock file is temporary, because whenever I try to delete it, the next time I run Eclipse it gets created again. And even after closing all Eclipse sessions, Dropbox still cannot upload it! I need the .metadata folder synced, as it means I can open Eclipse on one computer and have it exactly configured like I left it when I used another computer.
Comment: @space_voyager Right, Eclipse always creates it because it's used to indicate that the workspace is in use. Nothing important is written to that file, though. At the moment, I'm working on finding a way to exclude one file. Perhaps [this other SU answer](http://superuser.com/a/757498/380318) will help you?
Comment: It doesn't help. Windows does not let me create a folder called `.lock` saying "I must type a folder name".
Comment: @space_voyager Open a command prompt and use `md`; it'll let you make a folder with a leading period. (Remove it with `rd`.)
Comment: I created it successfully and excluded both write.lock and .lock from syncing (see http://i.imgur.com/DCV4dQl.png), but still no luck - dropbox is still trying to sync the file.
Comment: @space_voyager What OS are you using? If it's a Linux, [this other answer](http://superuser.com/a/931180/380318) should do the trick. There's also [this hack](http://superuser.com/a/674143/380318) that would work for sure, but is a little painful.


How can I prevent programmers from capturing data entered by users?

Question: I'm developing a web application with a strong focus on security. What measures can be taken to prevent those who work on the application (programmers, DBAs, quality assurance staff) from capturing user entered values that should be well-protected, such as passwords, social security numbers, and so forth?
Comment: I would suggest that you post the question in: http://security.stackexchange.com/?as=1
Comment: "Prevent" is a very strong word.  You can't *prevent* bad actors from doing bad things.  What you *can* do is learn and apply fundamental security principles like "least privilege," "separation of duties" and "implicit deny," architect things in secure ways, and hire people that you can trust.  Have workable plans in place to mitigate the damage when the inevitable eventually occurs.
Comment: The technical terms for the technologies that you need: *hashing and encryption.*
Answer: This is quite simple.  Banks do it all the time.
You have three groups of people involved.  These are security groups.  With distinct authorizations.
Developers cannot assign security authorizations and cannot see production data.
Operators cannot assign security authorizations and cannot create software.
Security folks who set the authorizations and can neither create software nor operate the software.
The developers create software.  The operators install it and operate it.  The security folks assure that the two groups are kept separated.
Comment: OK, but a developer could still add something into the system that emails production data to his/her private account; or writes production data to some server where he/she will pick it up.  I think the only way around this is with a rigorous code-review regime.
Comment: There is always that level of trust that is given to employees. Someone has to have the keys to the palace, and if you can't trust that they understand the power that is given to them, then maybe we shouldn't be giving those keys to that person in the first place.
Comment: Yes, but having keys that require more than one person (like code review regime) means that you need two to go "astray" before you are compromised and that is less likely than "just one" employee going astray and abusing the key given to them. It's all a matter of balancing trust and the consequences of that trust being abused. And don't forget that people and circumstances change. A person trustwhorthy when the keys are given can have things happen in life by which (s)he becomes less trustworthy...
Comment: @EmmadKareem: Correct.  Security person sets and resets groups and passwords, but can't see data.  Only operators can see real data.  Think of data like actual money handled by actual tellers.  Programmers don't touch the money; only tellers to.  Similarly, security people don't touch money; only tellers touch money.
Comment: @EmmadKareem: DBA's are not developers. There are two groups: security and data.  Data DBA's are a special part of "operations".  They should **not** have authorization to change security; they cannot write code; they will see data, however, and must be treated like operators, not developers.
Comment: So is the security person responsible for database security not capable of running a SELECT statement?
Comment: Thanks for the explanation, I was just wondering how would one go abut setting such permissions in a DBMS...I will need to study on that.
Answer: The programmers don't have access to the production servers. But someone has to have access. There's no way around it. And there's always a chance that someone may go insane and abuse their access.
Data that is hashed/salted is theoretically secure even from the people who have full access to view it. But most data is not appropriate for hashing.


How do I charge my iPhone 6 without it being on the whole time?

Question: I've tried shutting off my iPhone 6 AFTER plugging it in to charge, and it will turn back on.  How can I make sure it stays off while charging so that it charges more quickly?
Comment: It will show the lock screen, which should nod off again within a few seconds. It should not fully wake. Please edit your question to provide further details.
Comment: Agree with @Tetsujin. Perhaps you could provide a sequence of actions to re-produce the issue.
Answer:
Plug the phone in to power
Then turn it off

If your charger is overloaded, faulty or your cable has issues, there could be an interruption of charge and the device will start up then. There's no way to prevent this necessary feature - it's a fail safe to turn on the device after replacing the battery or other system events that could cause the power to be low.
Answer: Just put it in airplane mode, it will achieve the same desired result.
Comment: This reduces the power load on the system, but it's not the same result. Not all the energy will charge the battery if you don't actually power off the device. If you only can charge for an hour, this will put measurably more energy into the cell. The benefit is less noticeable if you are already more than 50 % charges as the trickle portion of the charge curve needs time to complete and not higher current.


Is there a difference between incompleteness and unknowable?

Question: Godel proved that there are statements that are true but not provable. Unproven conjectures such "Twin Primes" might fall into such a class, as I understand. If so, does it mean that we will never know if it's true or false? If true would it only be in the sense that some infinitely large and infinitely fast computer determined so by brute force? Or might it be that the conjecture (or another conjecture) could be neither true nor false and instead forever indeterminate?
Comment: Well, I didn't downvote the question (I even answered it), but to be quite honest, the question has very little to do with theoretical computer science and is not research-level. It belongs to math.stackexchange.com.
Comment: I hate people downvoting reasonable queries without comment. What a tragedy has this site come to?
Comment: @AndrejBauer I agree that the question is not research-level, and belongs elsewhere. So why not vote to close? This seems to me to be a problem these days that questions below the level of this site are rarely closed and referred to a more appropriate place. Instead they are just downvoted into oblivion. While the downvotes are justified in many cases, overall this is not a very productive outcome for anybody.
Comment: That's true, downvotes are not for signalling that the subject is unfit. Perhaps we should have the ability to migrate questions a bit more aggresively.
Comment: Hi Jim Lewis, I suppose that it is a little problematic to say that "the conjecture (or another conjecture) could be neither true nor false". The TWIN PRIMES conjecture is a logical statement, and can be either true or false by the definition of a logical statement, not neither true nor false...  The ability to tell weather it is true or false is another question, and we may never know the answer or be able to prove either way.
Answer: Yes, there is a difference.
Incompleteness is a property of a formal system logic. Given a formal system $L$, we say that it is incomplete if there is a sentence $S$ such that $L$ does not prove $S$ and $L$ does not prove $\lnot S$.
Knowing is an activity of an agent, such as a human, or a robot which holds beliefs about its environment. To say that an agent knows a statement $S$ means that the agent correctly believes $S$ is the case.
So the first thing to make clear is that incompleteness and knowing are two very different sorts of things. It makes no sense to say that a formal system of logic "knows" that $S$ holds. And knowledge may be obtained by many different means, some of which are not related to logic. (For instance, I know that it is sunny outside at the moment through direct observation.)
There is a relation though: if an agent uses a sound formal system $F$ to prove a sentence $S$, then it will know $S$. This is what mathematicians do: they prove things so that they can correctly believe them. In that sense, your question may be understood as follows:

Given the incompleteness of formal systems, are there some mathematical facts which we will never know? What if we give ourselves infinite time to exhaustively search through all proofs?

The answer is this: for a fixed formal system $F$, such as first-order logic with Zermelo-Fraenkel set theory (which is proclaimed by many to be the "official" formal system of mathematics), there is always a sentence $S$ such that $F$ neither disproves nor proves $S$. Even if we had infinite time so that we could check all proofs of $F$, we still would not be able to prove $S$, nor would we be able to disprove $S$ using $F$. There just isn't a proof, and it doesn't matter how much time we have. Consequently, we cannot acquire knowledge of $S$ by using the formal system $F$. This does not mean that $S$ is uknowlable. It just means that $F$ is not helping us determine whether $S$ is true, but there might be another formal system $F'$ which does.
Mathematicians are not forced to use a single formal system $F$ all the time. Mathematical activity and knowing by mathematicians is not the same as a fixed formal system. For instance, mathematicians might agree to add another axiom to set theory, and thus some previously undecidable sentences will become decidable (and therefore knowable). In fact, such changes do occur in the history of mathematics, although it is difficult to track them back in time because mathematicians did not know what a formal system of logic was before the work of the modern logicians (Peano, Frege, Russell, and others).
How, why, and whether mathematicians should change the underlying rules of mathematics is a question for a different day, and a different forum.
Supplemental: Let me address the question in the comments about the Twin Primes. I am going to take the formal system of Peano arithmetic $PA$, but any other formal system would do. Recall that:

$PA$ is consistent if it does not prove a contradiction.
$PA$ is sound if, for any sentence $\phi$, if $PA$ proves $\phi$ then $\phi$ is actually true.

Here we take truth with respect to the intended model, i.e., our mathematical reality (I am not going to get into a discussion of what that might be, the OP is presuming one.) A sound formal system is consistent, but a consistent formal system need not be sound.
Another point of importance is this: truth and provability are different! Do not confuse "we cannot prove something" with "it is neither true nor false". By definition truth is always determined, i.e., a statement must have a truth value, but it need not have a proof.
Let $TP$ be the statement of the Twin Primes conjecture. Here are the possibilities, assuming Peano arithmetic is sound:

If Twin Primes conjecture is true, then there is a sound formal system which proves it, namely Peano arithmetic extended with the axiom stating $TP$.
If Twin Primes conjecture is false, then there is a sound formal system which proves it, namely Peano arithmetic extended with the axiom stating $\lnot TP$.

We can also look at the other side:

If Peano arithmetic proves $TP$ then the Twin Primes conjecture is true.
If Peano arithmetic proves $\lnot TP$ then the Twin Primes conjecture is false.
If Peano arithmetic does not prove $TP$ and does not prove $\lnot TP$, then we may extend it at will with either $TP$ or $\lnot TP$. We will obtain a consistent formal system in either case, but it might be unsound.
Comment: @AviTal: that definition of statement is really bad and I would advise you not to take it too seriously. It's an outdated and simplified notion which historically comes from the early attempts to distinguish syntax from semantics. It's a mix of both.
Comment: Is it possible that for a given statement (e.g. Twin Primes conjecture) there is no consistent formal math system that can prove the statement? If so is there really still a sense to continue to say that the statement is true or false? Is it possible that the Twin Primes conjecture, for example, could be neither true nor false?
Comment: Please see the definition of "statement": http://www.math.ucsd.edu/~benchow/Week1notes.pdf
Comment: @JimLewis: I addressed your question in the comments.


LaTeXiT indents first line

Question: I am fairly new to LaTeX and I am currently using it to insert formatted equations into Microsoft Word (Office 365 version on Mac). However, for some reason in indents the first line of a multi line equation. Is there anyway to remove this indent or does LaTeXiT assume that you only operate with one equation at a time?
Comment: this is not a multiline math display, you are marking up a two line _text_ paragraph hence the indent of the first line, which happens to have two separate inline math expressions. a two line display would be something like `\begin{align}f(x}&=0\\f(y)=1\end{align}`
Comment: Try using \noindent.
Comment: @JairoAraujo unfortunately this has the same issue
Comment: Sorry. As I'm a Linux user, I cannot test your example
Answer: I am not familiar with that program, but I read Align in your screenshot. Try to click on Align, write
f(x)&=0\\
f(y)&=1

in the code section, and compile.
On the other hand,
\noindent$f(x)=0$
\\
$f(y)=1$

in Text mode should do what you want (as long it behaves as I expect).

An answer Ryan Schaefer's question in the comment section below: Elementary, align [sic!] is a very common and useful environment for math and very useful in LaTeX (I guess that is the reason why it it is in most left/first position), secondly, I have read https://chachatelier.fr/latexit/latexit-home.php and by the functionality of the sw this is what I would expect/design as a sw engineer with some knowledge on LaTeX. I assume that the application basically compiles a LaTeX-document and returns a bitmap or vector graphic. David Carlisle's comment should work for the same reasons.
I might add that switching from Word to LaTeX might be beneficially if allowed possible, see What are good learning resources for a LaTeX beginner?. Also using that image generated by LaTeXiT might give you font inconsistencies.
Comment: +1 (especially for not having the program) :)
Comment: Can I ask what led to your conclusion on the distinction between `Text` and `Align`
Comment: @RyanSchaefer See edit.

LaTeXiT indents first line


Pool getwork "target"?

Question: In a getwork request, bitcoind sends a target corresponding to the current block's bits value. Do the major pools send the same target as one would expect from bitcoind, difficulty of "1" target, or perhaps something else?
Answer: Most pools define their target value (minimum value required to earn a "share"), as:
T = 2 ** (256 - 32) - 1
= 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff

The Bitcoin protocol defines a difficulty of 1 as a target of:
D = 0xffff * 2**208
= 0x00000000ffff0000000000000000000000000000000000000000000000000000

They are nearly equal:
T/D = 1.0000152590218967

The precise target used for earning shares could be set to a larger number, but that would increase the number of getwork requests sent to the server as shares would be easier to find.  Note that if you decrease the size of target, you would reduce the probability of finding ANY valid shares for a given block header (unless you allow changing the timestamp as well as the nonce).  As it stands, the expected number of shares found per getwork request is approximately 1 (when the target has 32 leading zero bits).
Answer: I just started up a miner connecting to slush's pool.  The getwork my miner sent was answered with this:
{"id": "1",
 "result": {"hash1": "00000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000010000",
            "data": "00000001c5993e03c08cea1b78a2190865f68698c069a8033d60e5e70000082a00000000e0884a966424aac62b4997dc0bae1c60fab2ba12887fa842f07c9cacaf24b4534f3b53931a0c290b00000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000",
            "midstate": "390b85042008bac15b6ce310d791c8612610a0c5ee441b252ee6abee70bf742a",
            "target": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000"
           },
 "error": null
}

The target it gave me is 64 hex digits long.  That's around 2^256, and as such is bigger than the maximum target of 2^(256-32)-1.  Then I realised the target is 'little-endian', meaning it's byte-by-byte backwards.  Reversing it gives:
00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff

which is exactly 2^(256-32)-1, the maximum target.
So slush's pool at least is asking me to solve blocks of difficulty 1.
I know P2Pool sets the difficulty to be higher, so that shares on the P2Pool sharechain will be found around every 10 seconds.  Currently to achieve that it's giving out work with difficulty 609.82, but it changes every few seconds based on the recent rate of finding P2Pool shares.
Edit: I just checked, and it turns out I'm wrong.  Here's a getwork from the P2Pool instance I'm running:
{"error": null,
 "jsonrpc": "2.0",
 "id": 0,
 "result": {"hash1": "00000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000010000",
            "target": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000",
            "submitold": true,
            "identifier": "15578",
            "data": "000000011e90271e3071e27e4b16142162e54a68776176deeef5fe6e000001a800000000534e460eb3798f9d4149c56dddf486610512007201745fefd7661cedbde821fa4f3b5c461a0c290b00000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000",
            "midstate": "acb6f89399060ab343bbd17e3a6cccb89c2211af189bec8da15284a1d5e87b29"
           }
}

Notice the target is the same as on slush's pool.  It represents a difficulty of 1.  So the miner thinks it's looking for shares of difficulty 1, but P2Pool rejects any share the miner submits which has a difficulty of less than 609.82, or whatever the pool's difficulty is at the time.
Comment: (nitpick) The minimum target is actually 0xFFFF00000.... The value shown above actually corresponds to difficulty 0.999985. As this target allows the same optimizations for miners as real difficulty 1, this slightly higher target is used.
Comment: Hmmm, I knew that.  I wonder why I got it wrong, twice, in my answer above!  And why don't the mining pools use difficulty 1 instead of difficulty 0.999985?
Comment: Why would they use anything but the lowest efficiently-computable difficulty?
Comment: The difficulty is a constant in either case isn't it?  How does computational efficiency enter into this?  Are you saying it's easier to use bnProofOfWorkLimit because it's already defined than to use 0xFFFF<<n and have to spend the time to figure out what n should be?
Comment: Most miner software simply checks inside its tight loop whether the first 32 bits of the hash result are zero, which implicitly corresponds to difficulty 0.999985. Afterwards, outside of the main loop, results are verified to match the actual target. If a mining pool would require full difficulty 1, they'd see 0.0015% less shares, which are computed anyway.

Pool getwork "target"?


Does the Chosen Disciple perk work outside of VATS?

Question: Will my action points regenerate after kills outside of VATS, or does this perk only work with VATS?
Answer: Although the wikia is not terribly clear on this:

Kills made by your melee weapons will restore some of your Action Points.

This guide says that you will get AP for melee kills always with this perk.

The Disciples' bonus perk is very beneficial for melee builds that utilize VATS. Any kills you make with a melee weapon will restore 'some' of your Action Points. From peeking at the game code, it would seem this gives you 25% of AP back on kill 100% of the time.

I think the reason they mention VATS in this post is because you would be able to use VATS much more frequently with the 25% AP regeneration effect.
Answer: Yes, you will regenerate AP outside of VATS if you have this perk. From the Wiki:

Kills made by your melee weapons will restore some of your Action Points.

It does not specify whether or not you need to be in VATS, but its implied that you do not.


Current Usage of Fanny

Question: We are thinking about giving our daughter the name Fanny.
We are Germans, based in Germany but we're really curious about the current usage of this word in Great Britain.
We are familiar with the vulgar meaning of the word, but wondering if this is still a sense which is often used and still offensive to others. I can only find postings from years ago on that topic. Thanks a lot for your opinion!
Answer: The closest you will get to the scientific determination of the rudeness of a word is a public survey. OFCOM, the British media regulator, has conducted research to measure the offensiveness of different words, which was reported on in 2018.
They rate "fanny" as strong: there are four categories of offensive language, mild, medium, strong, and strongest. Fanny is alongside such strong terms as twat, minge, cock, dick, bellend, and bastard, and higher than medium terms including bitch, balls, bollocks, shit, and tits. Strongest includes only 3 terms, which are left as an exercise for the reader.
So it's quite rude.
Comment: The last sentence could do with amelioration. //  I'd not all have those category _strong_ terms in the same category myself.
Comment: From that reference 'cow' and 'ginger' are considered mild (of general swears) alongside 'bugger' and 'damn'. (also for USians, OFCOM is the UK version of the FCC)
Comment: The fact that "dick" is on the list of offensive words shows a weakness of the study. It's only offensive *in context*, and out of context it lends itself to the title of a series of books aimed at young children, [Dick and Jane](https://en.wikipedia.org/wiki/Dick_and_Jane). (However, I am not sure that a series named "Shit and Jane" would have been allowed, as there's really not a polite meaning for that word.)
Comment: "A Swedish woman in London was refused a store loyalty card because her first name was Fanny – but the name does have its advantages" - - a piece in the Guardian by Fanny Johnstone (who is English) https://www.theguardian.com/commentisfree/2015/feb/19/i-love-being-fanny
Comment: There is a story, possibly true, about a cinema in Madrid (Spain) in the 1970s where the guy up the ladder putting up the red plastic letters misread the handwritten note he had been given and made the star of a film 'Cunt Eastwood'. The management were curious about the sudden influx of giggling tourists taking photos of each other in front of their entrance, and the mystery was solved when a spoilsport from the British Embassy phoned them.
Comment: "Jane Austen's Fanny" (Grammarphobia) -  https://www.grammarphobia.com/blog/2017/02/fanny.html
Answer: Fanny is typically a diminutive for Frances, although it can come from other names as well.
However, it is the easy-to-pronounce diminutives that are most likely to have vulgar meanings in other languages.
Practically, a lot of embarassment can be spared by giving a child the full name as their legal name, and using the diminutive only at home, or with family and friends. A child can drop their nickname as a part of growing up. Legal names are a different matter.
Fanny is not a rude word in Canada or the United States. The OFCOM standards mentioned in one of the other answers are mostly applicable to Great Britain, and are probably not universal even there.
https://en.m.wikipedia.org/wiki/Fanny_(name)

Current Usage of Fanny


AC Condensate not draining from newish HVAC

Question: A few years ago I replaced my entire HVAC system with one similar size to my old one. I used a local contractor that I've had a long relationship with, who I've continued a maintenance contract with. For quite a while, I had a vague feeling that condensate wasn't coming out the pipe near my backdoor that had released quite a bit of water with the previous unit. This year's it's been more humid than ever, and I made a point to check on the drain pipe at multiple times you would expect condensate - and nothing. I asked the technician about it during my last check under the contract and he said he poured water in the pipe and it comes out so the drain is fine; and when I pressed him about where the moisture was going, he replied that the blower is probably drying up all the moisture. Does this make sense? I've had loads of water issues in my crawl space that I've been working hard to address and don't want to add to it with the AC. Should I call the management for another look, or hire another contractor to check it out?
Comment: Can you take a picture showing where the condensate line is attached to the air handler?
Answer: If the drain works with water poured in it it is clear and his professional opinion sounds correct. If the water did not drain or there was water damage there would be a problem. My guess at this point is the new system is a higher efficiency unit with a better balanced evaporator so it may not produce as much water as a less efficient model. The big difference in newer units is the evaporator is not having the extremes of cold that creates more condensation due to the larger temp extremes of older units but creates the same btu's per hour by managing the Freon usually with a temperature controlled throttle valve where many older systems used a simple orifice. The throttle valve is a better way to keep the evaporator at a constant temp where the orifice has no feedback ant the evaporator temp gets colder while the compressor is running. This may be the reason you do not see the amount of water due to the tighter control.
Comment: Thanks for the feedback Ed! This is helpful. I've always trusted this contractor but needed some reassurance. It's difficult to tell if there's water damage because I have other unrelated issues I've been working hard to address in this same area to the crawlspace below.


Why does using carburetor heat increase fuel consumption?

Question: As written above, why does using carburetor heat increase fuel consumption? Because I found such information in a few SOPs for piston airplanes and I do not understand why does it happen
Comment: Why not include one of the SOPs in your question?
Comment: Those are in polish so hardly anybody will understand. There are just tables with fuel consumption with and without carb heat and those with carb heat have higher values. Maybe those tables are wrong, I don't know, I hope somebody here knows ;)
Comment: Using carb heat means hotter, less dense air is sent to the carburetor (to clear ice).  This would change the fuel/air mixture.  It would depend where you were on the "lean to rich curve".  There is a possibility, if the engine ran too hot, the fuel mixture might have to be made more rich, affecting miles per gallon efficiency.  What type of engine are we talking about here?
Comment: It is a Rotax 912
Comment: It's worth remarking that in practical terms carb heat can actually reduce fuel consumption, if it results in the fuel/air mixture being better distributed across the engine cylinders. This is something which Mike Busch has demonstrated when finding techniques to run engines lean-of-peak. The heat helps vaporize the fuel, ensuring that the liquid fuel doesn't favor one intake pipe over another.
Comment: I found an english version of this SOP , screenshot added
Answer: I can think of two reasons:

The efficiency of heat machines depends on the difference between lowest and highest temperature in the cycle, relative to the highest temperature, as formulated first by Sadi Carnot. Simply put, the efficiency cannot be larger than $$\eta_{max}≤\frac{T_{max}-T_{min}}{T_{max}}$$
where all temperatures are expressed relative to absolute zero. If the entry temperature $T_{min}$ is raised by carburetor heat, the value of $\eta$ will drop. For the nitpickers: Piston engines are best described by the Otto cycle which uses an isochoric addition of heat and is a bit more messy to describe than the ideal Carnot cycle. If you want to include Diesel engines, use the Trinkler or Seiliger cycle.
With the higher entry temperature, all temperatures in the cycle are higher and you need to lean less in order not to exceed the desired cylinder head and exhaust gas temperatures. More fuel is needed for cooling, so the richer mixture will drive up fuel consumption.
Comment: @CarlBerger A funny thought indeed. But you want to first compress, then add heat. If you look at the T-s-diagram of the Otto cycle, you want to maximize the enclosed area relative to the area between x-Axis and the diagram plus the enclosed area. Initial heat will only shift the enclosed area up and increase exhaust heat, which is wasted. Or take the the p-v-diagram: Initial heating will shift it right (lower density) while pressures stay the same. Shifting the process right reduces the enclosed area and, therefore, the work that can be extracted. Better to add this heat after compression …
Comment: I have a funny thought concerning the cycle: why can't we include the carburetor heat as part of the cycle, and keep T_amb = T_min? Ultimately, part of the heat  that we put into the carburetor will be even extracted during the expansion (at engine efficiency), wouldn't it? And if we used exhaust heat for the carburetor (which would just be wasted otherwise), wouldn't we even increase the efficiency?
Comment: yes obviously.. I guess i shouldn't write comments that late at night.
Answer: Heating the air causes the air to be less dense.
We all know that as you climb, the air becomes less dense and you have to lean the mixture for better performance and fuel economy. This also applies to Carb Heat. If you don't lean the mixture after applying Carb heat, the mixture will be richer and fuel economy will be reduced.
Comment: @Konrad If you do nothing but heat the intake air, the fuel consumption does not change, but the engine power drops.  If you were flying trimmed and level, then turned on carb heat but did nothing else, you would start to lose altitude because the engine would no longer be producing as much power as it was before (the now rich mixture being unable to burn all the fuel it could just moments ago).  If you don't want to fall out of the sky, you will increase the throttle - burning more fuel than before now to hold altitude.
Comment: @J... - That, in itself, is an answer. You should make it one instead of just a comment.
Comment: I don't know the detail of the Rotax, but if the pilot doesn't have an adjustment knob in the cockpit, it doesn't necessarily mean that the value isn't adjusted.
For unchanged mixture though, the reduced air mass flow means less power- and if you have to drive the engine to a higher powered operating point, that might be less economic.
I guess we have too many technical possibilities for different engines that make a single general answer quite difficult..
Comment: That's the point that I do not understand. Ofc hotter air is less dense, so with the same amount of fuel the mixture will be overally richer. But on Rotax 912 there isn't any manual mixture adjustment lever/knob, so why does the fuel consumption increase since we are not able to do any mixture adjustments
Comment: If there's no manual mixture adjustment then the reduction in fuel viscosity may increase the flow rate, this may be more significant than the reduction in fuel density


Apache 2.2: "Client denied by server configuration" - .htaccess password protection

Question: I am having problems trying to set up a password in .htaccess file for a subdirectory on my server. After a long time it finally works as it supposed to but after each time I open the site in a browser the error appears in Apache error.log:
[Mon May 14 13:55:33 2012] [error] [client 127.0.0.1] client denied by server configuration: C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/creativedesigner/.htaccess
Some of my httpd.conf:
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>
<Directory "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
    Allow from all
</Directory>
AccessFileName .htaccess
<FilesMatch "^.ht">
    Order deny,allow
    Deny from all
    Satisfy All
</FilesMatch>
And the .htaccess file:
AuthType Basic
AuthName "Password"
AuthUserFile "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/pass/.htpasswd"
Require valid-user
Anyway - it works - I have to use correct user name and password to be able to see the site. But I'm preparing quite big project so i don't want any errors in future and something must be wrong to get this in the log. Any ideas?
Answer: Oh my gosh - I have asked the same question last week this must be a bug in Apache then:
Apache Log says: Deny - but it works (htaccess)


What contextual links would make full-text journal articles more useful?

Question: After searching PubMed or Google Scholar researchers often arrive at a publisher's full-text article page. Assuming that you have access to the full-text access, what contextual links should be included within the article? i,e links to Brain Atlas, links to Gene Databases
Comment: I don't think there's any definitive answer to this at all, it's not more than a poll (I meant to clarify that earlier but I got sidetracked).
Comment: Thanks for asking. I've given this question an edit, but I'm still not sure whether it is a good fit for the site. It is fairly subjective and could potentially vary a lot across disciplines.
Comment: Also to clarify, are you talking only about links in the PDF/HTML of the full-text article or are you also talking about side bar links (e.g., options to export bibliographic information links to related articles, view statistics, etc.)
Comment: I'm in agreement, this feels too subjective to me. user2366, we expect questions on this site to have a definitive *correct* answer, and I'm not sure this question has one...
Comment: I think this question might be off-topic for here, and a better fit at [academia.SE](http://academia.stackexchange.com/)
Answer: This is a subjective question and what is useful would depend on from which domain of cognitive science the article originated. In general, I prefer when the PDF looks like the journal article (i.e., no formatting to indicate links).
Here is a list of things that I find useful:

Links from in text citations to the location of the full reference
Links from references to the full-text resource
Links between Table and figure references with the actual figure
Table of contents tied to sections in the article
URLs and emails that can be clicked on
Tables with exportable data
If the article includes supplementary material, links to that material that work and do not require password access.

A few extra things that might be nice perhaps in the HTML version:

Ability to export both the article reference and the references in the  article in various bibliographic formats (e.g., bibtex, Endnote, etc.)
Page view, download, and citation statistics
RSS feed options for the journal


Big images preview

Question: I am working on an application for sharing a scanner. I have a webform for all the settings, a "Scan" button, and a "Preview" button. When the user press "Scan" nothing on the interface changes. A "Save As" window pops-up. But what should happen when the user press "Preview". I was thinking about a dialog window containing the scanned preview, but the images are usually too big (1248x1640 for example)?
Comment: What do you need the Preview for? Could you just throw this button away and provide some post-scan tools like crop, rotation, greyscale transform which are applied to scanned image?
Comment: As I have a webform for the settings, the user needs to see what settings work for the current image. There should be a preview button, as I'm not providing any post-scan image manipulation because it's too much work and I'm trying to keep this project simpler.
Comment: Then you can just scale big image, as it's just a rough view. Browsers do images scaling rather good.
Comment: But I want to stay in the application. Is it gonna be a good approach to load the image in an iframe, which is in a modal dialog window?
Answer: You could try the following idea. Click on zoom control or preview picture opens bigger image.
Comment: Thank you very much! Дякую! :) When "click" happens on "Preview" button, a dialog window opens with a slider (html5 range element) and the image above it. You can zoom and pan the image in it's container similar to the example you gave me. However I can't upvote your answer, because I don't have enough reputation.

Big images preview


How to directly evaluate path integral for harmonic oscillator by brute force method?

Question: It is easy to evaluate the green's function using path integral approach by evaluating classical action and using functional calculus method. Is it possible to evaluate path integral for harmonic oscillator directly by evaluating the integral for every time slice up to the last fixed time slice? It cumbersome yet I think it is possible.
Comment: You may want to see [this](https://www.amazon.com/Field-Theory-Integral-Approach-Scientific/dp/9812568476/ref=sr_1_3?keywords=ashok+das+field+theory&qid=1579580201&sr=8-3).
Answer:
Concerning the harmonic oscillator, it is well-known that
after a Wick rotation
$$ t^E ~\equiv~ i  t^M$$
to Euclidean time, then the Feynman propagator/kernel/amplitude is
$$ K(x_2,t^E_2;x_1,t^E_1)~=~ \sqrt{\frac{m\omega}{2\pi\hbar \sinh(\omega\Delta t^E_{21}) }}\exp\left\{-\frac{1}{\hbar}S^E(x_2,t^E_2;x_1,t^E_1)\right\},\tag{1}$$
where
$$ S^E(x_2,t^E_2;x_1,t^E_1)~=~\frac{m\omega}{2}\left((x_2^2+x_1^2)\coth(\omega\Delta t^E_{21})-\frac{2x_2x_1}{\sinh(\omega\Delta t^E_{21})}\right) \tag{2}$$
is the Euclidean Dirichlet on-shell action.
There are many ways to establish eq. (1) by direct/brute force path integration. E.g.:

The most pedestrian/elementary method is perhaps to insert a finite number $N$ of completeness relations into the overlap $\langle x_2,t^E_2;x_1,t^E_1 \rangle$, thereby breaking it into $N+1$ overlaps of equal time steps. Next derive a recursion relation in $N$, and take the continuum limit $N\to \infty$, see e.g. Refs. 4 & 5.
Evaluate a functional determinant, see e.g. Ref. 2 and this related Phys.SE post. Alternatively, use the Gelfand-Yaglom formula.
For $\omega\Delta t^E_{21}\ll 1$, one may use perturbative WKB methods.
If the Feynman propagator/kernel/amplitude $K(x_2,t^E_2;x_1,t^E_1)$ is known for the free particle, there is an ingenious trick to derive $K(x_2,t^E_2;x_1,t^E_1)$ for the harmonic oscillator, cf. Ref. 3.

Once eq. (1) is a found, perhaps via handwaving arguments, there is a rigorous way to check it: Perform a single Gaussian integration over $x_2$ to check the path integral property
$$K(x_3,t_3^E;x_1,t_1^E)~=~\int_{\mathbb{R}} \! dx_2~ K(x_3,t_3^E;x_2,t_2^E)~K(x_2,t_2^E;x_1,t_1^E), \tag{3}$$
which is the signature property for a sum over histories. Eq.(3) follows directly from eqs. (1)-(2), the Gaussian integration formula, and the  addition formulas for $\coth$ & $\sinh$.
In particular, if eq. (1) was originally only established for small times, $\omega\Delta t^E_{21}\ll 1$, then repeated application of eq. (3) can be used to establish eq. (1) for large times, in the very spirit of the path integration.

References:

R.P. Feynman & A.R. Hibbs, Quantum Mechanics and Path Integrals, 1965; eqs. (3.59)-(3.60).
J. Polchinski, String Theory Vol. 1, 1998, Appendix A.
L. Moriconi, An Elementary Derivation of the Harmonic Oscillator Propagator, Am. J. Phys. 72 (2004) 1258, arXiv:physics/0402069. (Hat tip: OP.)
S.M. Cohen, Path Integral for the Quantum Harmonic Oscillator Using Elementary Methods, Am. J. Phys. 66 (1998) 537.
K. Hira, Eur. J. Phys. 34 (2013) 777.
Comment: Notes for later: Landau problem. 2D point particle in a magnetic field. Feynman & Hibbs, problem 3-10; Kleinert, subsection 2.23.3, p. 197. $\quad L~=~\frac{m}{2}(\dot{x}^2+\dot{y}^2)- U~\sim~\frac{1}{2}\begin{pmatrix}x & y \end{pmatrix}\begin{pmatrix} -m d_t^2 & Bd_t \cr -Bd_t&  -m d_t^2  \end{pmatrix}\begin{pmatrix}x \cr y \end{pmatrix}$; $\quad -U~=~q(A_x \dot{x}+A_y \dot{y})~=~\frac{B}{2}(x \dot{y}-y \dot{x})$; $\quad B:=qB_z$; Position coordinates $x$ and $y$ do not commute, so it is inconsistent to require Dirichlet BC for both, cf. HUP. Let us instead impose periodic BC.
Comment: Notes for later: $\quad \omega~=~\frac{2\pi n}{T}$; $\quad n\in \mathbb{N}$; $\quad \det\begin{pmatrix} m \omega^2-\lambda & iB\omega \cr -iB\omega&  m \omega^2-\lambda   \end{pmatrix}~=~0$; $\quad \lambda_{\pm}~=~ m \omega^2\pm B\omega$; $\quad \begin{pmatrix}  -m d_t^2 -\lambda & Bd_t \cr -Bd_t&  -m d_t^2 -\lambda   \end{pmatrix}\begin{pmatrix}x \cr y \end{pmatrix}~=~\begin{pmatrix}0 \cr 0 \end{pmatrix}$; $\quad \begin{pmatrix}x_{\pm} \cr y_{\pm} \end{pmatrix}~=~\begin{pmatrix}\cos/\sin\omega t \cr \sin/\cos\omega t \end{pmatrix}$; Non-negative eigenvalues if $B$ is small enough.
Comment: Notes for later: $\quad \det^{\prime}~=~\prod_{n\in\mathbb{N}} (m^2\omega^4-B^2\omega^2)~=~\left[\prod_{n\in\mathbb{N}}n\right]^2 \left[\prod_{n\in\mathbb{N}}m^2\omega_1^4\right]\left[\prod_{n\in\mathbb{N}} \left(1-\left(\frac{B}{m\omega_1 n}\right)^2\right)\right]=\frac{T^2}{m}{\rm sinc}\frac{BT}{2m}$ cf. [zeta function regularization](https://physics.stackexchange.com/a/403895/2451).
Comment: Notes for later:  Propagator in same position: $\quad K(x,t^E_2;x,t^E_1)~=~\sqrt{\frac{m\omega}{2\pi\hbar \sinh(\omega\Delta t^E_{21}) }}\exp\left\{ -\frac{m\omega x^2}{\hbar}\tanh\frac{\omega\Delta t^E_{21}}{2}\right\}$; Path integral: $\quad Z~=~\int_{\mathbb{R}}\!dx~K(x,t^E_2;x,t^E_1)~=~\left(2\sinh\frac{\omega\Delta t^E_{21}}{2}\right)^{-1}~=~\sum_{n\in\mathbb{N}_0}e^{-(n+1/2)\omega\Delta t^E_{21}}$;
Comment: Notes for later: What happens if we add a source term $Jx$ to the Lagrangian? Lagrangian $\quad L_M \sim -\frac{m}{2}x\left(\frac{d^2}{dt_M^2}+\omega^2\right)x+Jx.$ $\quad L_E \sim \frac{m}{2}x\left(-\frac{d^2}{dt_E^2}+\omega^2\right)x-Jx = \frac{m}{2}(x-G_E J)\left(-\frac{d^2}{dt_E^2}+\omega^2\right)(x-G_E J)-\frac{1}{2}JG_E J.$ Greens function $\quad G_M(t_M)=-{\rm sgn}(t_M)\frac{\sin(\omega t_M)}{2m\omega}.$ $\quad G_E(t_M)=-{\rm sgn}(t_E)\frac{\sinh(\omega t_E)}{2m\omega}.$
Comment: Notes for later: $\quad \langle x_2,t^E_2|x_1,t^E_1\rangle_J = \langle x_2-G_E(t^E_2)J,t^E_2|x_1-G_E(t^E_1)J,t^E_1\rangle_0~\exp\left(\frac{1}{2\hbar}\iint JG_EJ\right).$ Compare with M.S. Swanson, Section 3.2 eqs. (3.19)-(3.21); and Feynman & Hibbs, problem 3-11 eq. (3-66).
Answer: The path integral in quantum mechanics may be defined as,
$$\int_{-\infty}^\infty \dots \int_{-\infty}^\infty \exp \left \{\frac{i}{\hbar}\Delta t \sum_i L \left(x_i,\frac{x_{i+1}-x_i}{\Delta t}, i \right) \right\} \, \mathrm dx_0 \dots \mathrm dx_N$$
where as the OP has noted, one 'slices' time into $N+1$ segments and the idea is that the propagator is given by the formal limit as $N \to \infty$. Based on this paper, it seems that convergence has been established by Fujikawa in the norm operator topology, in $\mathcal{B}(L^2(\mathbb R^d))$ providing the potential is smooth with at most quadratic growth (e.g. a harmonic oscillator).
This has been extended to show convergence remains, providing second space derivatives exist in $H^{d+1}(\mathbb R^d)$. These results show we can expect to indeed recover the original propagator in the continuum limit.
However, for any finite $N$, we cannot expect to do anything but approximate the propagator; we can of course carry out the integration finitely many times simply. In fact, this is what is originally done to notice the pattern that emerges, which enables taking the $N\to\infty$ limit.


Video in UIWebView full screen in iPhone

Question: I am showing a youtube video link in UIWebview. When I tap on video it starts playing in iPhone Media pLayer. When I tap on full screen mode in media player it stretches the video in AspectFill mode. Is it possible to change media player mode to AspectFit.
Comment: also visit this link  :-http://stackoverflow.com/questions/5977330/play-video-by-default-in-full-screen
Answer: The MPMoviePlayerViewController  class implements a simple view controller for displaying full-screen movies. Unlike using an MPMoviePlayerController object on its own to present a movie immediately, you can incorporate a movie player view controller wherever you would normally use a view controller. For example, you can present it using a tab bar or navigation bar-based interface, taking advantage of the transitions offered by those interfaces.
Comment: I dont have instance of MPMoviePlayerController, it bydefault open from webview.


Where to find dev documentation for multiple fieldtypes

Question: I have looked at the docs for 2.6, but am unable to find an explanation for how to set up multiple fieldtypes in a single package. Can anyone enlighten - I really need this ability.
Answer: Any ft files in the root of your package directory (system/expressionengine/third_party/your_package) will be recognized as part of the package. See P&T's Field Pack for an example.
Comment: Thanks Rob - I actually looked at P&T's Field Pack for inspiration, but there is some magic in there that made me think there must be a "how to" somewhere since this was only made possible in 2.6. It would still be helpful to know what made it possible in 2.6 when it was supposedly not possible before.The way I read Peter Lewis' reply, his suggestion is independent of whatever happened in version 2.6.
Comment: A lot of EE development unfortunately often comes down to just reading the code to see how it works, so that's probably what P&T did. I'm glad you asked this question though, I was wondering about how this works too.
Answer: There is no documentation on this. Think of a fieldtype not as a single input or textfield, but as a single piece of data.  So you could build multiple fieldtypes as separate files and folders (and completely different add-ons) or there's a couple of other ways to approach it: either storing the data in channel_data table as delimited or serialized data (for the multiple fields), or building another table that stores the values separately in different columns.
Your single fieldtype class can simply output 2 input boxes in the view (so appearing as two field(types)s):
<code><input type="text" name="my_field[value1]" id="cart-tax-rate" value="<?= $existingData['my_value1']; ?>" />
<input type="text" name="my_field[value2]" id="cart-tax-rate" value="<?= $existingData['my_value2']; ?>" />
</code>
Then your fieldype method to save the data would either serialize it, or delimiter it in some way.
Alternatively, you take the data submitted and store it in your own table using the reference of the entry ID.
Your field type will also need to pull this data on display too (or format it if you chose the first option.
Any data stored in the channel_data table can also be used for searching, so if you do hold the data in your own table, you might want to consider dropping key pieces of data into the native channel_data column for your fieldtype for search purposes.
Comment: Thanks Peter - very helpful. A pity I can't mark both your and Rob's as accepted answers, because I can certainly use all the approaches in different situations


RD Gateway Manager cannot connect to local server

Question: I am logged in onto this Windows 2012 R2 VM with Remote Desktop, I launched the Remote Desktop Gateway Manager, I right-clicked on the RD Gateway Manager node in the left tree, I selected Connect to RD Gateway Server, I left the Local server selection and I clicked OK. I get the following message:
"The RD Gateway Manager snap-in console cannot connect to the server "SERVER" because it is not a RD Gateway server."
Any ideas on what might cause this? Does a running anti-virus have any effect? There is no error event log.
As a side note, the real reason I want to get to this dialog is to turn off the inactivity session timeout which kills my session after I leave work. But that's another issue. Changing the local policy didn't work - the VM belongs to a domain. I am curious about this for now.
Thank you
Answer: Lets check several things.

Make sure that the RD Gateway role is installed on your RDS server. To do this open your Server Manager > Remote Desktop Services (left tree) and in the Deployment Servers section, make sure you have the RD Gateway role installed and setup under Deployment Overview OR go through Manage > Remove Roles and Features and see if the RD Gateway role is checked. If it is not or you have trouble getting to this area, install/reinstall your RDS Services.
Open Services and make sure Remote Desktop Gateway is running. If not, try to start it.
Still in Services, make sure Windows Internal Database is running. If not, try to start it.
Still in Services, make sure Remote Desktop Management is running, if not, try to start it.

If you have any issues with starting the Services mentioned, check Event Viewer under Windows Logs > System and post any errors that you get related to these services.
Reinstall/Install
Open Server Manager > Manage > Add Roles and Features. Click on Nexton Before you Begin > Check Remote Desktop Services Installation and Next > Select your Server under RD Connection Broker and leave Standard deployment checked, Next > Select the type of session you want to use (VM or Session) - Session: Remote users connect to the RDS server directly; VM: Remote users connect to a Virtual Machine isolating the users from the server in case the server has sensitive data. I'm going to use Session for this example... - Review Roles and Services, Next > Specify RD Connection Broker server and add your RDS server to the Pool, Next > Specify RD Web Access server and add your RDS server to the Pool and Check Install the RD Web Access role on the RD Connection Broker server, Next > Specify RD Session Host server and add your RDS server to the Pool, Next > Confirm Selections, if everything looks good then proceed installing. Check Restart the destination server automatically if required if you want to or restart your server yourself. If you need a visual guide, you can take a look here.
Once the roles are done installing, open Server Manager once more and go back to Remote Desktop Services in the left tree. If everything loads right, you can continue configuring your RD Gateway which is pretty straight forward. Now you can check back into RD Gateway Manager and see if you can connect.
Hope this helps and let us know if you run into more issues!
Comment: I previously installed the Remote Desktop Services but I haven't been able to remote desktop anymore, so I uninstalled them remotely using powershell, then I was able to RD again. Does it make sense?


how many pixels is a meter in Box2D?

Question: Question is simple so, no codes! If someone knows Box2D and SDL2, then, please tell me how to wrap SDL_Rect with b2body. Ofcourse, it requires to know the conversion of metre to pixel and vice versa. This is because Box2D measures distance in metres. Can you give me a simple expression or function to convert metres(of Box2D) to pixels or pixels to metres(of Box2D)?
Comment: I'm pretty sure it's up to you to invent a conversion factor based on your needs. There is no predefined concept of pixels-to-meters, it's up to your game world to determine this.
Comment: Pixels are only relevant when you are drawing things on the screen. Box2D does not care about them at all. Define your physics objects so that the most common body is around 1 unit in size. Then scale everything as necessary to draw it.
Comment: Yeah, whatever conversion you want will work. I think box2D recommended something like a 20px per meter conversion, but literally anything is valid. It's just that some will make sense, and others won't.
Comment: Is there any 'Default' value of how many pixels is a meter. If there isn't, then how can a meter be defined without such aspect?
Comment: Thanks @iforce2d! I got your words as well as your tutorials!
Answer:
Can you give me a simple expression or function to convert metres(of Box2D) to pixels or pixels to metres(of Box2D)?

Unfortunately, this isn't as simple as it sounds, for us. Because, if your game is on worms, then your game world would be in millimetres while if it's like Space Invaders then it would be in kilometres? So it's up to the game designer to decide this scaling factor. Without knowing about the intricacies of the game, deducing this factor would just be a wild guess at best.
From Box2D's faq:

How do I convert pixels to meters?
Suppose you have a sprite for a character that is 100x100 pixels. You decide to use a scaling factor that is 0.01. This will make the character physics box 1m x 1m. So go make a physics box that is 1x1. Now suppose the character starts out at pixel coordinate (345,679). So position the physics box at (3.45,6.79). Now simulate the physics world. Suppose the character physics box moves to (2.31,4.98), so move your character sprite to pixel coordinates (231,498). Now the only tricky part is choosing a scaling factor. This really depends on your game. You should try to get your moving objects in the range 0.1 - 10 meters, with 1 meter being the sweet spot.

Here the scaling factor is what you set; your decision on how many pixels would constitute one unit of your game world.
It is usually recommended that you do all the calculations in the game world units and finally, as a last step (render), do the conversion to pixels; likewise before bringing in data from outside (say an image/sprite, which is in pixels) to the world space, do the reverse conversion only once and then deal in world units in the rest of the code. See this article by Erin Catto, Box2D's author, on this issue. An excerpt:

You should consider using MKS units in your game code and just convert to pixels when you render. This will simplify your game logic and reduce the chance for errors since the rendering conversion can be isolated to a small amount of code.

This paragraph appears in the manual too.
Comment: Different devices have different DPI. Thus if you have an image that's 4 pixels in a row, on a 4 DPI device you'll see the image spanning 1" in length, while on a 2 DPI device you'll see it 2" long. Thus it's up to you to do the necessary scaling (or give different images) for a given device based on its DPI. By that statement, what I meant was, when you render an image, either render directly if you've the data in pixel units, else you need to make the conversion if the data is in metres. If you're doing the conversion, then do it only once. This is what the article also recommends.
Comment: On my PC, I found it to be 2 pixels for every 1 meter (Just found it out by hit and trial method). Would it be different for other devices? You also said that at the point of render, one should convert all meters to pixels for the things that are going to be rendered. Is that statement, right?
Answer: 2 pixels a meter?  This is a pretty big game world. Ignore DPI.  This is completely confusing the issue IMO.  Simplest : You model in real world coordinates (box2d does on meters) and you map,  in libgdx terminology,  via a viewport at rendering.  If you make your game world too small there may be problems with vertices collisions however.
Comment: Thanks for answering! Actually, I am quite satisfied with what iforce2d said. Pixels and metres cannot be compared as 1 metre is for 2 pixels. In my structure, its independent of this factor. Scaling only affects the performance of things which can also be 'scaled' by using the aspect ratio. But if scaling is done by considering only one of the dimensions (usually vertical), the only thing that needs to be done, is to scale the whole rendering image that fits for the same vertical dimension. I am not good at explaining things. Also, I don't want to use libgdx! I use SDL2 with Box2D...

how many pixels is a meter in Box2D?


Parsing UDP packets from offline pcap file with Perl script

Question: I'm hoping someone can help me with the following issue.  I wrote a Perl script to parse all the UDP packets from an offline Pcap file and then write all the UDP data out to a file using Net::Pcap and NetPacket. It works fine on most of the pcap files.  I currently have a Pcap file where there are 4 extra bytes (Null/Loopback, Family: IP (2)) before the IP Header.  This is causing my script to check the protocol type using the wrong byte. I have looked all over and tried to offset the byte, but can't figure it out.  Is there some way to check for a null link type while in the loop(), remove the extra bytes and save it back to a pcap file.  I tried a number of ways, but each time it gets me only so far until I hit another problem.  I have seen some examples where a filter is set in the loop method, but that is only of live captures.  Any suggestions?
Wireshark image
perl script:
use Net::Pcap qw(:functions);
use NetPacket::Ethernet qw(:types);
use NetPacket::IP qw(:protos);
use NetPacket::UDP;
use NetPacket::TCP;

$pcap = Net::Pcap::open_offline($_[0], \$err) or die "Can't read '$_[0]': $err\n";
Net::Pcap::loop($pcap, $maxpkts, \&process_packet, '');
Net::Pcap::close($pcap);

sub process_packet {
($user_data, $header, $packet) = @_;
my $ip = NetPacket::IP -> decode($packet);
# extract UDP packets from pcap file
if ($ip -> {proto} == IP_PROTO_UDP) {
    my $udp = NetPacket::UDP -> decode($ip -> {data});
    if (($udp -> {len} == 62) && ($udp -> {src_port} == 16800 || $udp -> {src_port} == 16700)) {
        $seconds = $header -> {tv_sec};
        $milliseconds = $header -> {tv_usec} / 1000000;
        $newtime = $seconds + $milliseconds;
        $count++;
        if ($count > 1) {
            $delta = $newtime - $oldtime;
        }
        print $pcap_tempfile $udp->{data};
        print "Packet $count: ", "DELTA ",  "\n";
        printf ".%06d", $header -> {tv_usec};
        $oldtime = $newtime;
    }
} else {

}

}
Answer: I think you might want to strip the Ethernet info before decoding IP, for example:
my $ip = NetPacket::IP->decode(NetPacket::Ethernet::strip($packet));


Viewing and analysing JSON log files

Question: I have a few JSON-based log files (all in the same format) that I would like to view and analyse in a consolidated way.
I.e., first I'd like to view the entries from all files at once, sorted by their timestamp (or an arbitrary other criterion, such as category, id, ... whatever).
Next, I'd like to be able to filter all those entries, including full-text search.
Last but not least, it would be interesting to analyse the logs automatically. Things such as: Event X always happens within 5 seconds after event Y (but the software shall automatically detect this, and point out anomalies).
Is there any software for this that you can recommend? Ideally, it should be a web-application, but a desktop app for OS X would also be fine.
Answer: Upload your files to loggly, or push them to logstash. Both provide a rich query language.

Viewing and analysing JSON log files


How much overhead will webmin/virtualmin add to my centos5 drupal webserver?

Question: I would like the site to be as fast as possible, are these programs worth installing? How much overhead will they add to my server and how, if at all, will it effect page load times?
Thanks!
Comment: This question appears to be off-topic because it is about [`working with a service provider's management interface, such as cPanel`](http://serverfault.com/help/on-topic).
Answer: This is kind of an old question, but I know a lot about the subject (I'm one of the developers on both Webmin and Virtualmin), so I thought I'd chime in:
Webmin uses about 10-12MB of memory on a 32 bit system, and about 50% more than that on a 64 bit system (this cost is paid for all software, but particularly for software written in dynamic languages like Perl, Python, PHP, and Ruby). CPU usage for one user is negligible and can be pretty much ignored. If you enable resource data collection (which I think currently only happens if the Webmin server is being managed by Cloudmin), it'll have a cronjob that eats a bit of memory and CPU every few minutes, but should also be pretty minimal.
Virtualmin is another story, and answering the question is more complex. In its default configuration, on a system with more than 512MB of RAM, Virtualmin will use about 100MB (more on a 64 bit system), as it will cache a number of libraries and data structures for performance. Because Virtualmin abstracts dozens of services (Apache, BIND, Postfix, MySQL, monitoring, resource usage, stats, users, groups, applications, etc.) into a single "virtual server" and strays from Webmin's model of only ever editing one configuration file at a time, generating a lot of its pages is much more resource intensive...thus the caching. This is configurable, and there is complete documentation on tuning Virtualmin for low memory systems in the Virtualmin.com documentation, including turning off caching and making Virtualmin take the same ~10MB as Webmin. In recent versions of Webmin, the performance difference is actually quite small if the system is not used by more than one user.
But, it's hard to accurately gauge memory or resource usage in a system running many services. Shared libraries may mean that memory usage of a specific application could be much lower than it appears.
Anyway, we run Drupal for Virtualmin.com, and obviously we also run Webmin, Virtualmin, and Cloudmin on the same system. I worry about performance quite a lot these days, as our system is under pretty significant load most weekdays, but Webmin is never where I look for tuning opportunities. There's always something more pressing and more demanding of resources when I dig down to see what is slowing us down.
So, I'd advise you to not try to guess at what might be hindering performance, and instead look at the usage data, and find the actual resource users and try to alleviate those issues. (Virtualmin can actually help there, though I don't think Virtualmin GPL has the resource monitoring and charting yet).
Hope this helps. If you you do have problems with Webmin or Virtualmin, we're always happy to help. But I doubt your Drupal performance issues have anything to do with Webmin or Virtualmin.
Answer: If you're interested in optimising Drupal, and indeed the rest of the stack, then you really need commandline access and to understand what you're changing and not just a gui.  Webmin won't add much overhead per se but it will restrict you and won't encourage you to think outside the box.
If this is a server running one or two Drupal sites then you should seriously consider Pantheon if page load times and number of supported concurrent users are a major issue.  It doesn't handle several Drupal sites running on the same box, but then if you're really serious about optimisation then that shouldn't bother you too much.
Answer: webmin only uses resources of the server (cpu and memory) when you call one of the pages. If you rarely use it to make configuration changes, the overhead in general should be able to be neglected. I believe the same is true for virtualmin.
Comment: That's not entirely true because it is constantly running in the background, but it shouldn't cause much load whilst not being used.


Gvim doesn't show up in the nautilus context menu for .c and .h files

Question: Most of the time I can browse the file system with the file browser, right-click on a file and top item in the menu "Open with Gvim", but when I right-click on a .c or .h file, it says "Open with (some inferior editor)".  I mouse over to the "Open With" submenu, and Gvim doesn't appear in there, either.  Even when I go into "Other Application" and browse through the programs, it doesn't show up.   What gives?
Comment: It shows up for me in the "Open With" menu. Do you have `vim-gtk` or `vim-gnome` installed? Have you done anything to customize or change the package contents? Do you have a custom launcher for gvim in `~/.local/share/applications`?
Comment: I have vim-gnome installed.  I don't think I've done anything to change or customize the package, just my .vimrc and .vim folder.  Yes!  I made a custom launcher that looks like:[Desktop Entry]
Version=1.0
Name=Gvim
Comment=The best text editor
Exec=/usr/bin/gvim --remote-tab-silent
Icon=/usr/share/app-install/icons/vim.svg
Terminal=false
Type=Application
Categories=Utility;Application;
Answer: In your reply in the comments, you said you have created a custom launcher for GVim. In your custom desktop launcher, you neglected to include the MimeType keyword. The .desktop file is not only used to add applications to the desktop environment menu, but also to register applications with the MIME types that they can handle.
So to register GVim as a text editor with your desktop environment, your custom gvim.desktop file should contain at least the following:
[Desktop Entry]
Version=1.0
Name=GVim
Comment=Edit text files
Exec=gvim --remote-tab-silent %F
Icon=vim
Terminal=false
Type=Application
Categories=Utility;TextEditor;
MimeType=text/plain


Is bus travel in with expired photo ID possible in the US?

Question: Trying to get a friend to Oregon. His ID is expired but does have a photo of him. Is it still possible for him to pick up a bus ticket using this ID?
Comment: Did you contact the bus company and ask it?
Comment: Is this Greyhound or another bus company?
Comment: If you're asking possible, it is very very possible. I have done things with an expired ID because the checkers didn't bother with the date. If the question however is that is it valid for picking up, no it is not.
Answer: Although the question didn't specifically mention Greyhound, this is Greyhound's policy and I assume should be similar for other bus transport organizations in this time of increased vigilance due to terrorism.
Greyhound Official Response from their Facebook account:

A Valid State Issued ID may range from a passport to a driver's
  license. An expired ID may not be accepted. If you are to purchase
  a Will Call Ticket, you can create a password for the traveler to
  use as ID. A nonrefundable gift ticket fee is applied to each Will
  Call transaction where the credit card holder purchasing tickets is
  not traveling on that trip. However, printed at home tickets along
  with valid photo ID will be required at point of origin.

How can I have "will call" Greyhound tickets picked up without a photo ID?
Comment: It seems unlikely that terrorism is the issue, since AFAICT you can avoid showing any ID by using the password option, or simply buying your ticket on site with cash.  More likely it's just to avoid having your ticket stolen by someone else who knows you bought it.


What command should I run after making changes to /etc/passwd file

Question: I have made some changes to /etc/passwd file ,now I wanted to see if the effect of changes taken place or not .What command should I run for that.
For example after making change to /etc/ssh/ssh_config file ,I run /etc/init.d/sshd command.
Answer: To verify the passwd and corresponding shadow file, use pwck.  To verify the group and corresponding gshadow file, use grpck.  See the manpages for the details of the actions they perform.
Hand-editting of /etc/passwd is best done (if at all) with vipw and vipw -s for the shadow file.  For the /etc/group and /etc/gshadow use vigr and vigr -s, respectively.  Using these tools provide not only a lock to prevent multiple, concurrent user updates but also offer validity checking.
In general, modifications to the password and group files are best made using the standard user(add|mod|del) and group(add|mod|del) tools.
Answer: There is no such command to apply changes from /etc/passwd file.
If user which details you've changed is logged in, it should just relogin to apply the changes. If not, they will be immediately available after login.
This is because login reads details from passwd file during login and keeps it in memory until logout.
Comment: "…no such command…" *on Linux*. Many other *ixes do have such commands. The `passed` file is either compiled down to a binary form that's faster to process, or is kept only for compatibility and the data has to be translated into the OS's native password DB form.
Answer: I had success with the update-passwd command after I manually edited the /etc/passwd file on Debian-based systems (e.g. Ubuntu). I know this is NOT the intended use of this command, but it works for this purpose, too. See its man page for more deatails: http://manpages.ubuntu.com/manpages/precise/man8/update-passwd.8.html
On Red Hat / CentOS based systems I did not find an equivalent command, on those systems I had to do a system reboot to make the changes take effect.
As somebody already mentioned, it is best not to edit the /etc/passwd file manually. Instead I use useradd / userdel / usermod commands whenever possible. The only valid reason for editing the /etc/passwd and /etc/group files IMO is when I need to copy over a lot of accounts from another system. After adding e.g. a 100 accounts this way, I usually do a full system reboot.
Also, when you manually edit /etc/passwd and/or /etc/groups files you must not forget to edit the appropriate shadow files as well.
Answer: I dont think there is such command as it's not necessary in the first place
Also it's not advisable to edit that file directly, instead use the appropriate commands like useradd and passwd
If you are not convinced then just reboot after editing that file and all the changes will be effective
Answer: You should not modify /etc/passwd manually; use usermod instead
For example:
If you want to change the user home directory, use this command:
usermod --home /path/to/home/dir username

Comment: It's sometimes necessary to edit the file by hand, but then `vipw` should be used.
Comment: Got it @Kusalananda