Is it feasible to use depleted oil wells for geothermal production?

Question: There is an oil field outside my hometown. I wonder if it is feasible to use the same oil wells for geothermal production after oil production rate drops below profitable point.
Comment: I agree.  The question should really be "Is it possible to use depleted oil wells?" or maybe even "Is it feasible?"  The question, as is, is asking both of those questions along with the question of "Is it economical?"  The phrase "a good idea" does invite opinions, but in this community, I think we'll be alright with it.
Comment: This question could be construed as being opinion based, perhaps the question could be about the feasibility of such a venture
Comment: Why don't you edit the question accordingly to make it less "opinion-based"?
Comment: I have edited the opinion-based-ness out of the question... the answer is still very valid
Answer: In most cases, probably not.
Oil could be considered a metamorphic mineral, formed by "gentle" heating. That is gently on a geological scale - still enough to burn your hands!
Geothermal systems work most efficiently with a large temperature difference (Third Law of Thermodynamics). As soon as the temperatures increase enough to be interesting from a geothermal perspective, you are quickly losing ("overcooking") the oil on a geological timescale.
Therefore most oil fields have had the heat applied in the past and it has since been removed.
However this does not discount the situation where an oil field is still technically "being made" and the hydrocarbons are still being heated, and we just happened to drill it at just the right time. Hence the "in most cases": You might find the odd field where it is practical.
An old field, especially gas ones, could be used for carbon sequestration though. The field has stored methane for 10s if not 100s million years, why not the heavier CO2 instead?
Comment: This is assuming the requirement is for electricity production. If you want to exploit temperatures suitable for district heating, or other direct thermal uses, then ... maybe. I suppose the wells would need workovers (different completion, etc), and possibly need to be made wider.
Comment: I think even heating, the same generally applies. However, it might be more practical for a heat pump arrangement. The fracking would have increased permeability - increasing the "available" fluid around the base of the well. This is speculation on my part - I don't know if anyone has looked in detail at using fracked wells for heat pumps - there might be a different show-stopper.
Comment: Don't know much about it, but I thought heat pumps were a closed loop, where fluids have no direct interaction with the ground.
Comment: Don't know much either. Yes the pump itself will be closed, but the sink will want certain thermal characteristics - high thermal capacity and conductivity. It seems higher permeability might help that?
Comment: https://gdr.openei.org/submissions/233 heat pump info.
Answer: Geothermal reservoirs are very different from hydrocarbon reservoirs. A geothermal reservoir is made of highly fractured igneous/metamorphic rocks which have low intrinsic permeability. Fluids get heated as they flow through fractures to temperatures well above the boiling point of water. The reason they flow is because of thermal gradients which causes convection.
Oil/gas reservoirs are contained in sedimentary rocks which have much higher permeabilities and relatively lower temperatures. Also hydrocardon reservoirs in most cases are confined. In theory you can utilize some of the heat in the depleted reservoir by injecting cold water and utilizing the hot water as done in an enhanced geothermal system or EGS. But it wont be efficient as the reservoir will loose heat quickly. And since the fluids extracted will still contain some hydrocarbons you have the additional headache of disposing them properly.
Note: I am talking about geothermal reservoirs of the kind you see in Western US (e.g., The Geysers), Iceland, Philippines, etc.
Answer: Do you know the (TVD) true vertical depth of these wells.  Are you certain the wells are tapped into an oil formation.  Oil wells deplete in the production sense but the mess still remains as well over time oil will seep back into the fractured zone. The clean up and maintenance of equipment would be great. There may also be the presence of other toxic gases such as h2s. Think of a oil spill on land or ocean and the coast of cleaning it up. In my opinion I be very impractical and coastly. In most cases impossible because of the differences in   formations
Case studies strictly geothermal
Geothermal Well References


Trigonometric Substitution

Question:
I am having trouble with this problem even though everything I did seemed right to me since we went over a similar one in my class. I used the method of setting up a triangle, my hypotenuse is $\sqrt{54+9x^2}$ and my sides are $\sqrt{54}$ and $3x$. I got $\tan(t)=3x/\sqrt{54}$ so
$$x=\sqrt{54} \tan(t) \frac{1}{3}$$
which left
$$\sec(t) = \frac{\sqrt{54+9x^2}}{\frac{\sqrt{54}}{3}}$$
and then
$$\frac{\sqrt{54}}{3} \sec(t) = \sqrt{54+9x^2}.$$
This left me with a simplified $6 \int \sec^3(t) \, dt$. After using the reduction formula my answer was
$$3 \tan(t) \sec(t) +3 \ln |\sec(t) + \tan(t)| +C$$
and then I plugged back in with my $x$ values. If anyone can help it would be greatly appreciated!
Comment: Hint: Factor out $\sqrt{9} = 3$ out of the radicand.  Then, simplify, using trigonometric substitution, for $\sqrt{9}\cdot \sqrt{6 + x^2}$
Comment: Thank you, but this still gives me 6 integral sec^3(t) it just got me there more easily. So helpful, but I still cannot seem to get it. Thanks again!
Comment: Thank you so much! I must have made an arithmetic error somewhere, I kept getting 6 and not 9. I cannot find how I got 6 if you have any ideas on where I would have made this error, I'd be very happy and thankful! Thanks again for your help.
Answer: Sorry, I misunderstood your question the first time round.
First, I'm getting
$$9 \sec \theta \tan \theta + 9 \ln | \sec \theta + \tan \theta | + C $$
as my intermediate answer.  From there, you need to take out all the thetas and put in $x$.  From what you wrote, I'm assuming you see how we get $\tan \theta = x / \sqrt{6}$ and $\sec \theta = \sqrt{(x^2 + 6) / 6}$. (If not, let me know.)  Therefore, we rewrite the above expression as
$$
\\ 9 \cdot \frac{\sqrt{x^2 + 6}}{\sqrt{6}} \cdot \frac{x}{\sqrt{6}} + 9 \ln \left| \frac{\sqrt{x^2 + 6}}{\sqrt{6}} + \frac{x}{\sqrt{6}} \right| + C = \frac{3}{2}x\sqrt{x^2 + 6} + 9 \ln \left| \frac{\sqrt{x^2 + 6} + x}{\sqrt{6}} \right| + C \
$$
A lot of times with these kinds of integrals the trick is with the $\ln$. Remember that $\ln A / B = \ln A - \ln B$; this lets us simplify the expression like so:
$$\frac{3}{2}x\sqrt{x^2 + 6} + 9 \ln \left| \sqrt{x^2 + 6} + x \right| + C$$
Doing this always seems weird to me, but $-9 \ln \sqrt{6}$ is a constant, after all...

Trigonometric Substitution


Preservation questions on topic?

Question: I have a question about how to best preserve an object which is of some historical value - is that on topic here?
Comment: An upvote for asking before posting.
Comment: What kind of object is it? Maybe Chemistry group would be appropriate.
Comment: They appear to be photographic litho print plates.  I'm just having a hard time finding a suitable group on SE to ask...
Comment: @JamesSnell I was going to suggest Photography.SE, but then I noticed you've already tried the site. Not sure your question is on topic there, but hey, it's not closed yet.
Comment: If it's of genealogical value, it might be appropriate on [genealogy.se]
Comment: It's not as it goes, although I might pay them a visit with a question I have... :)
Answer: No that question is not really on topic here. Taken from the Help Center:

What topics can I ask about here?
History Stack Exchange is for historians and history buffs. If you have a question about:

Historical events Cultures and historical practices
Famous people
Ancient Languages
Factual current political history questions

Then you are in the right place.
It is not about:

Genealogy
Asking for reference material
Questions answered by a simple Google search or to be found in a Wikipedia page
Predicting the future based on historical trends
Mythology
Conspiracy Theories or Pseudo-science

Please look around to see if your question has been asked before. It's also OK to ask and answer your own question.

However, all hope is not lost. As the Help Center continues:

If your question is not specifically on-topic for History Stack Exchange, it may be on topic for another Stack Exchange site. If no site currently exists that will accept your question, you may commit to or propose a new site at Area51, the place where new Stack Exchange communities are democratically created.
Comment: Thanks, I didn't see any links to the FAQ from the homepage so I thought best to ask in meta first.
Comment: It's actually called the help center now. :) That's probably the source of confusion.

Preservation questions on topic?


Why Model database in SQL Server is in FULL recovery mode

Question: Why Model database in SQL Server is in FULL recovery mode and other system databases are in simple recovery mode?
Comment: There is no hard and fast rule to keep Model in full recovery you can keep it in simple recovery. Recovery model of database is always according to RPO and RTO.
Answer:
Why is the model database in SQL Server in FULL recovery mode and other system databases are in SIMPLE recovery mode?

I think you are asking why the model database is different from the other system databases.
New user databases are created with the same recovery model as the model database. The default recovery model for the model database depends on the edition of SQL Server you have installed.
From Choosing the Recovery Model for a Database:

The simple recovery model is generally appropriate for a test or development database. However, for a production database, the best choice is typically the full recovery model, optionally, supplemented by the bulk-logged recovery model. However, the simple recovery model is sometimes appropriate for a small production database, especially if it is mostly or completely read-only, or for a data warehouse.

Following this logic, editions targeted at test and development environments (SQL Server Express and LocalDB) set the recovery model of the model database to SIMPLE. Other editions set the recovery model of the model database to FULL.
Answer: The master and msdb databases are good to have in simple mode because they generally don't change frequently enough to warrant having them in the full recovery model.
Restoring master is a very significant exercise, and restoring a full database backup is as far as you ever want to go. msdb contains quite a bit of useful information, but generally, regular database backups are enough.
The important thing with these databases is to back them up whenever something significant has changed, and to also have scripts / deployment packages to recreate the necessary information (logins, SSIS packages, agent jobs, etc). You definitely don't need them to be in the full recovery model.
The model database, though, is used to create new user databases, and these are generally good to have in the full recovery model on production boxes. When you create a database, I'm sure you explicitly set every option, so it's less important what setting model has, right? ;)
Answer:
Why Model database in SQL Server is in FULL recovery mode ?

This is because model acts as "Model" for any newly created database. So depending on your environment and your business requirements, if a user database needs "point-in-time" recovery, then a full recovery mode will provide that (this assumes that you are regularly taking full and transaction log backups).
If your business does not require "point-in-time" recovery then you can change the recovery mode of MODEL to simple. Make sure to still take full backups (and test them regularly to see if you are able to restore or not).
Note that the databases restored using backup/restore method or detach/attach method, will have their original recovery mode.

other system databases are in simple recovery mode?

Master and tempdb are always in simple recovery mode. You cannot change the recovery mode.
For msdb

If you want to use the backup and restore history information in msdb when you recover user databases, we recommend that you use the full recovery model for msdb. Additionally, consider placing the msdb transaction log on fault tolerant storage.

read up more on : Recovery Models for System Databases
Comment: technically what you just posted in above comment can be added to your answer , as of now it seems like master database "cannot" be in simple recovery you emphasized on always u also wrote you cannot change recovery model
Comment: @Shanky it can be changed .. but whats the point ? Please refer to the link that I mentioned `For backwards compatibility with earlier versions of Microsoft SQL Server, the recovery model of master can be set to FULL or BULK_LOGGED. However, BACKUP LOG is not supported for master. Therefore, even if the recovery model of master is changed to full or bulk-logged, the database continues to operate as if it were using the simple recovery model.`
Comment: You can change recovery model of master database to full, please correct it.
Comment: Also, downvoters .. I would like to know the reason for downvote .. so that I can improve my answer.
Answer: The recovery model for new databases is taken from the Model database.
After the creation of the new database, you can change the recovery model to simple or Bulk-Logged.
Comment: @shanky you are nit-picking terms here for no purpose that I can see. This answer states "new databases", in no way do I see any reference to tempdb or other system databases.
Comment: Tempdb does not takes its recovery model from model database as such its always in simple recovery but again logging is minimal
Comment: @shawn I did not down voted the answer neither I was nit picking I just wanted  to add that fact from my side a normal comment I agree may be its not directly related


Tables locked(database locked) in MYSQL

Question: We are using MYSQL INNODB,After inserted one record in table,Locked database operations resulted in proxy and application threads to increase that ultimately caused the proxy server to not accept connections.I would like to know the root cause for this tables locking?
Comment: Don't use `autocommit = OFF`; one tends to forget to `COMMIT`.
Comment: Thanks  for your info Rick James,but the insertion was success but after refreshing that page server got down and came to know that corresponding table got locked.then we start kill the processes even though servers not up,after rebooting the RDS ,servers got up.as per your answer if commit is the issue insertions wont be succeeded i think,so please help me to find the root cause.
Comment: we used defaultAutoCommit - true or false: default
        auto-commit state of the connections created by this pool.
        Default: true
Comment: true == ON == 1; false == off = 0.  (OK, my guess was not on target.)
Answer: In my personal opinion debugging table locks in MySQL can be a pain in the *ss sometimes.
Some queries that may give you some insights are:
Get a list of the locked tables
SHOW OPEN TABLES WHERE In_Use > 0;

Get a list of all processes using MySQL resources with corresponding queries
SHOW FULL PROCESSLIST;

Get specific information about the InnoDB storage engine including deadlocks
SHOW ENGINE INNODB STATUS;

Comment: we did all above mentioned steps and finally reboot the RDS after that servers up. but i would like to know the root cause for this ,why tables locked ?i tried a lot to find this but no luck yet

Tables locked(database locked) in MYSQL


What is the private beta?

Question: There is that badge, called the Beta, and it says actively participated in the private beta. Is the private beta different from the beta?
Answer: The private beta was for 7 days. Private betas are limited to those who committed to the Area 51 proposal for the site. Here was the proposal for English:
http://area51.stackexchange.com/proposals/1269/english-language-usage
The public beta is open to anyone on the internet, and it lasts from day 8 - n where n is "met the threshold to become a public site". Public betas can go on indefinitely, as long as the site is producing pages that make the internet better and not worse.
The only way to get the private beta badge is to commit to an Area 51 proposal, help the proposal reach the threshold for beta, and participate during the initial 7 day private beta period.
Answer: The phases that a proposal on Area 51 pass through are the following:

Definition; in this phase, user define which questions are on-topic and off-topic. Once there are 60 followers, and there are 5 on-topic and 5 off-topic questions (which means questions that have a score of 20 for being on-topic or off-topic), the proposal goes to the next phase.
Commitment; in this phase, users needs to commit to the proposal, which means they will ask a minimum number of questions when the proposal will pass to the next step. The exact number of users required to pass to the next phase depends from their reputation, and from how much they are active in other SE sites.
Private beta; who committed to the site can start using it by asking questions, or answering to questions.
Public beta; in this phase, all users can ask questions, including who didn't committed to the proposal.

There is a difference between a site in private beta, and public beta: the reputation required for some privileges is very low, during a private beta; once the site passes to public beta, the required reputation is increased, and it will be increased again when the site goes past the public beta.
To make a comparison, I will report the reputation required on Drupal Answers, which is still in public beta, with the reputation required for the same privileges in English Language and Usage, which is not in beta anymore.

Privilege            Drupal Answers   English Language and Usage
----------------------------------------------------------------
Trusted user                   4000                        20000
Access to moderator tools      2000                        10000
Create tag synonym             1250                         2500
Cast close and reopen votes     500                         3000

The badge you are referring to is gained when you partecipate to the private beta phase, which means you committed to the proposal.

What is the private beta?


What should physics majors work on during semester breaks?

Question: First and second year students are unlikely to get selected for major internships (right?). Given this, what can students do after freshman and sophomore years that will be useful later on. I thought of learning MATLAB, but not sure if this is a good idea or if there are better options.
Comment: The grammar aside, this seems like a fair question to me, not sure why the downvotes (unless it's a duplicate, in which case the link would be helpful). The answer is likely to be similar for most STEM majors, so it's not really a physics question.
Comment: @cag51 The reason is that there are tons of things that one can do over 2-3 months that can be useful later on, from selling ice cream (yes, this can be useful to future researchers too) to experiment with electronics at home, studying a programming language, studying a new subject etc.
Comment: @MassimoOrtolano Thanks for explaining. Advice on identifying and down-selecting from a large number of options seems appropriate to me, but I can see that it's a judgment call.
Answer: The summer after sophomore year should be late enough to start doing research. There are lots of questions / tutorials about how to start research; best to just talk to your professors and/or apply to research programs such as the REU. This is also a good time to start studying for your physics GRE.
For the summer after freshman year, it's probably too early to do the above (though it's worth asking your professors about research options). I recommend working on soft skills -- writing, people skills, presentation skills, and programming all come to mind.
Comment: "For the summer after freshman year, it's probably too early"  I disagree, I've had high school students perform meaningful research in my lab.  But they had good soft skills and could program.
Comment: Sure, there are exceptional students and tractable projects; it's definitely worth trying -- will update my answer. But in most cases, this will be a long shot (hence the "probably").
Answer: Programming sounds like a perfect summer project that could be somewhat self-directed.  You could tie this in with numerical methods.
Check the offerings at your local community college.
You could also focus on community outreach.  You might be able to latch onto an existing program in the target area, or volunteer at an observatory or science museum.  Or you could create a hands-on program at your public library as a volunteer.
Another possibility would be to volunteer at a recycling facility that safely dismantles dead electronics, or that teaches basic computer use and repair skills to teens and adults.
You could design and teach a self-contained enrichment course at a senior citizens center.
Depending on where you live, you might be able to volunteer to assist with the high school physics classes (there are often one to three sections -- so this would be part-time).
You could study a new foreign language.
Those are just a couple ideas to get you started thinking.
Don't forget to check for REU opportunities.
Answer: The summer project I did, which later turned out to be the most useful, was sitting down and learn C++ from scratch, using Stroustrup's own introductory book. Learning a programming language like it was intended, and not like a tool to use for a specific thing (like what is taught in most courses) has over and over again proven valuable.
I suppose one would maybe rather learn Python today, but once you know how to write code, you can swap one language for another with only minimal pain. This is often not the case if you have only learned to use the functionality needed for a given course.
Answer: Students can work -- as interns, or something else -- during semester breaks, so employment is one thing that students can do. They could also seek to improve skills that aren't taught as part of their degree, e.g., writing skills, business skills, ...
Comment: Maybe search harder.
Comment: but most internships require that you are studying in the final year of your UG course , esspecially with physics and research labs ! How do you find useful employment related/useful to your degree
Comment: Some internships do not include such requirements.
Comment: The ones i came across had such requirements , what else can one work on other than internships ?
Comment: Employment period is a good thing - lifeguarding, retail, construction, etc. At the least you get paid, learn that getting a degree would be a good thing, and still have time to fiddle with stuff in the evenings.
Comment: there is a risk of losing touch with studies after getting employed for 2-3 months in lifeguarding, retail, construction, etc

Anyways , I'll keep searching for internships then , what if i ask a professor ?


Which sorting algorithm does bigquery ORDER BY clause uses?

Question: Does it use bubble sort/merge sort.. type of algorithms? Is there any documentation/information available around the background execution of these type of statements?
Answer: Not sure why you're being downvoted, since I don't think this is described anywhere. Within a single partition, BigQuery uses introsort, with a some tricks depending on the types and number of columns in the ORDER BY clause. For example, if you have an INT64 column named x and you run a query of this form:
SELECT x
FROM dataset.table
ORDER BY x

BigQuery will load all of the x values into a vector, then sort and return them. It's less straightforward if you have multiple columns in the select list or ORDER BY clause, though.
Comment: @ElliottBrossard: I suspect it's getting down voted because it's quite broad and not specially related to programming/SQL. The sorting algorithm is completely abstracted away from users, with no way to control it programmatically. I agree it's interesting to know how BigQuery does its sort, but maybe it's a question more suited to stackexchange or Quora? Just my 2 cent.
Comment: Thanks Elliott, Is there any additional information available around these?
Comment: Around what, specifically?
Comment: Execution algorithms for different kinds of SQL statements
Comment: Very cool information! I for one think the question is welcome, knowing the complexity of sorting algorithms is quite important for deciding how much data we'd be willing to use. I still wonder though if clustering a table on a given column would affect the sorting as well. For what I understood it seems to work sort of like an index, maybe there's optimizations to further diminish expectation of worst case scenario complexity in this case.


Sign out of all devices iCloud

Question: I have someone cyber-stalking me who has somehow learned my iCloud password. I've changed it since, but they are still signed in to the "Find My iPhone" app and are able to make noises and alerts and possibly lock or erase my phone. How do I force a sign out of that app? On icloud.com, under the settings menu, I see the option "Sign out of all browsers currently signed in to iCloud.com", however I know from the notification email that they are accessing the phone via the iOS app. Thanks for any help
Answer: This should kick them out of all connections regardless of what they are using to connect.  Most (if not all)  iOS apps that need to use some sort of internet connection for functionality talk to a webserver using various methods of data exchange, but at the end of the day it's http/https and there is a session registered with the server. Delete that session and connection is cut.
Comment: Thanks Jay. I think it did work, I haven't had any issues since changing the password and clicking that link.

Sign out of all devices iCloud


How does guaranteed copy elision work in list-initialization in C++1z?

Question: There is a paragraph about guaranteed copy elision in c++ draft n4606 [dcl.init] 17.6:

If the destination type is a (possibly cv-qualified) class type:

If the initializer expression is a prvalue and the cv-unqualified version of the source type is the same class as the class of the destination, the initializer expression is used to initialize the destination object. [ Example: T x = T(T(T())); calls the T default constructor to initialize x. — end example ]
[...]

There is also a Q&A talks about how it works.
To myself understanding, the rule I quoted guarantees that no ctors should get involved when initializer expression is a prvalue and the cv-unqualified version of the source type is the same class as the class of the destination. So that no needs to check the existence of copy or move ctor, which makes following codes to be legal in C++17:
struct A {
    A() {}
    A(A const &) = delete;
    A(A &&) = delete;
};
A f() { return A(); } // it's illegal in C++14, and suppose to be legal in C++17

However, what drives me crazy is I can't find similar rules in list-initialization section in c++ draft n4606. What I found is ([dcl.init.list] 3.6)

[...]

Otherwise, if T is a class type, constructors are considered. The applicable constructors are enumerated and the best one is chosen through overload resolution (13.3, 22.214.171.124). If a narrowing conversion (see below) is required to convert any of the arguments, the program is ill-formed.
  [...]

Since list-initialization has higher priority than the first rule I quoted, we should consider the rule in list-initialized section when the initializer is a initializer-list. As we can see, constructors are considered when list-initialize a class type T. So, continued to the previous example, will
A ff() { return {A()}; }

be legal in C++17? And can someone find where the standard draft specify how does guaranteed copy elision work in list-initialization?
Comment: Guaranteed copy elision will work with the list initialization scenario only for aggregates, because of the special rule for aggregates initialized with an object of the same type in C++17.. But the remaining cases seem not to be covered by guaranteed copy elision. But remember that you can simply drop the braces and it will work. I see no reason to put braces here.
Comment: Note that not even non-guaranteed copy elision will work here (afaics.. this is not an initialization, but a specific application of overload resolution and a call of a constructor.. so it should not be covered by the elision rules unless explicitly stated), so it's not an issue introduced by C++17.
Comment: I posted question to std discussion: https://groups.google.com/a/isocpp.org/forum/#!topic/std-discussion/3EvAt9v4dYE
Answer: Guaranteed elision works by redefining prvalue expressions to mean "will initialize an object". They don't construct temporaries anymore; temporaries are instead constructed by certain uses of prvalue expressions.
Please note the frequent use of the word "expression" above. I point that out because of one very important fact: a braced-init-list is not an expression. The standard is very clear about this. It is not an expression, and only expressions can be prvalues.
Indeed, consider the section of the standard on elision:

This elision of copy/move operations, called copy elision, is permitted in the following circumstances:

in a return statement in a function with a class return type, when the expression is the name of a non-volatile automatic object...
...
when a temporary class object that has not been bound to a reference (12.2) would be copied/moved to a class object with the same cv-unqualified type

These all involve expressions (temporary class objects are expressions). Braced-init-lists aren't expressions.
As such, if you issue return {anything};, the construction of the return value from anything will not be elided, regardless of what anything is. According to the standard, of course; compilers may differ due to bugs.
Now that being said, if you have a prvalue expression of the same type as the return value, you are highly unlikely to want to type return {prvalue}; instead of just return prvalue;. And if the expression was of a different type, then it doesn't qualify for elision anyway.
Comment: @Carousel: I'm not sure how much more clearly I can say this. Elision is based on *expressions*. Braced-init-lists are not expressions. Therefore, elision does not apply to them.
Comment: BTW is this not a contradiction in the wording? "a prvalue that is used to compute the value of an operand of an operator or that has type (possibly cv-qualified) void has no result object. [ Note: Except when the prvalue is the operand of a decltype-specifier, a prvalue of class or array type always has a result object".
Comment: Well, I just didn't see any proper usage of guaranteed copy elision in list-initialization by writing something like `return {prvalue};`, but I'm not sure about that. It seems that there is no need to guarantee copy elision in list-initialization, and that's why the standard draft doesn't specify it?
Comment: @NicolBolas well, they are not expressions, just like the `(foo)` in `T t(foo)` is not an expression and the `= foo` in `T t = foo`. However, `foo` is one, just like `prvalue` is one within `{prvalue}`. So saying up-front "initializer-lists are not expressions, therefore there is no copy elision in list-initialization" doesn't seem sound to me. In fact, some forms of it permit copy elision as I have shown in my comment above.


Can a zipped malware execute?

Question: I have a malicious file zipped in .gz which was not opened. However, when I tried to delete the folder containing the file, I wasn't able to due to running processes. Can a zipped malware execute itself in Windows?
Comment: More likely your AV is quarantining the file?
Comment: Try lsof to see which process is using the file
Comment: @Chubby, dont think my AV scans within zipped file
Answer: Unless you have some program that is able to run compressed programs from archive, no it can't.
You inability to suppress the file is more likely due to the fact that the file itself is being used or access restricted by some program (e.g. antivirus quarantine).
Answer: Normally a program cannot execute itself, but must be launched from something else(*). That something else is normally:

a command line shell (command.exe, /bin/sh (or bash, zsh, etc.) )
a GUI explorer (Windows explorer, gnome file manager, etc.)

Those can only start programs in a standard executable format.
But a program can also be started by another program that starts it as a child subprocess. Here almost everything is possible, because it depends how that other program was designed. Anyway, on common operating system (at least Windows and Unix or Unix-like), the system can only execute an uncompressed file, so in that case, the launcher program should first unzip the file in a temporary one and then execute the temporary. That means that the zipped file should not be kept open, because the system does not use it directly.
TL/DR: A zipped file could probably be executed via a specialized laucher, but even in that case, it is very unlikely that it would be kept open all its execution time: it should be kept open only for being uncompressed.

(*) beware, the launcher could be a normal program such as a mail reader or a browser, through an exploitable vulnerability
Comment: @George An attachement is included in the mail body, and AFAIK all desktop mail readers always download and store the full mail including all attachements as a whole.
Comment: You mentioned launcher and mail reader - does outlook thick-client pre-download attachments and store in local machine without user opening the attachment?
Comment: Thanks. Do you know if the attachment is wrapped? Because if the mail gateway doesnt block executables, and mail client downloads them, then it's really dangerous.

Can a zipped malware execute?


Why are SVMs hard to fit?

Question: I often hear the following complaint from people: "SVMs work really well WHEN they actually work." By "work" I mean that the algorithm will actually finish running. Are SVMs difficult to fit in practice versus other models, or are these people making a (I assume common) mistake while attempting to use SVMs?
Comment: The SVM fitting problem in the dual form is a convex quadratic programming problem. Optimization is not my area of expertise, but this suggests to me that the fitting procedure should always terminate correctly. I think the quotation probably means that
"When the SVM's predictions add value to the problem that we want to solve, it adds *considerable* value."
Answer: In the theory, to insure the convergence, your problem must be convex. Otherwise you can't know if the algorithm will find a solution or not.
Moreover SVMs' complexity are O(n^2) so not very scalable with large datasets.
Comment: The optimisation problem for an SVM with a Mercer kernel will be convex.
Answer: I suspect the problem is to do with the hyper-parameter settings (the regularization parameter, $C$, and any kernel parameters).  You can end up with essentially all of the data being support vectors, at which point the optimisation procedure takes a long time because there are many "active" parameters.  For small to medium size problems (a few thousand training patterns) I tend to use least-squares support vector machines, as the fitting procedure only requires solving a single set of linear equations (or an eigen-decomposition of the kernel matrix if you want to tune the regularisation parameter as well).
Getting good generalisation performance from an SVM depends on choosing a suitable kernel and careful tuning of the hyper-parameters (grid search minimising cross-validation error is a good method).
Comment: Generally the best thing to do is to try several methods and see what works best using cross-validation.  Most rules of thumb for selecting methods tend to be to uncertain to be of much use, and at the end of the day a lot depends on the skill of the operator in applying a particular method (especially neural nets).  I find kernel machines pretty useful, mostly because they are easy to use and performance generally just depends on choosing the hyper-parameters carefully using cross-validation.  I also find bagging to be a useful "belt-and-braces" approach to avoiding overfitting.
Comment: @Dikran Marsupial: what do you think about this ? http://stats.stackexchange.com/questions/168051/what-is-the-relationship-between-a-kernel-and-projection-to-a-higher-dimensional/168082#168082
Comment: Thank you for the response. How do you identify when it is appropriate to use an SVM over another method (random forest, neural net, boosted trees etc.)? I have always struggled with this.
 Generally, my review of the literature has lead to me to the following:
1) Compare methods
2) Random forests tend to be better for classification problems as opposed to regression problems
3) Neural Nets can be applied to virtually any type of problem (training time can be an issue)
4) Boosted trees can be applied to most problems and perform well if the base learner is weak
5) Try ensembles (weak learners)

Why are SVMs hard to fit?


Is it possible to display the assertion results in the View Results Tree listener itself in Jmeter?

Question: Is there anyway we can display the assertion results in the View Results Tree listener itself? Also, the Assertion Results listener displays only failed assertions, is there a simple way to display both the failed as well as the passed assertions preferably in a verbose manner?
Answer: View Results Tree Listener displays failed assertions:

If you're doing some functional testing with low number of virtual users (threads) and  need to see verbose assertion results you need to choose a more advanced assertion, i.e. Beanshell Assertion or JSR223 Assertion which have full control of response data, headers, messages, sample labels, log file, etc. so you will be able to precisely do what you need using JMeter API in Beanshell or Groovy language
If you're running a load test which assumes immense load - I would strongly recommend to:

Forget about running JMeter in GUI mode
Disable all the listeners, especially View Results Tree
Leave only those assertions which are absolutely required.

Otherwise overhead caused by listeners memory consumption and IO to write all the things down on JMeter side can ruin your load test and results won't be relevant. See 9 Easy Solutions for a JMeter Load Test "Out of Memory" Failure guide for more detailed explanation of the above points and few more JMeter tuning tweaks.


Can you deal non-lethal sneak attack damage with natural weapons?

Question: Can you deal non-lethal sneak attack damage with natural weapons?
Answer: No, unless your natural weapon normally deals nonlethal damage.

With a sap (blackjack) or an unarmed strike, a rogue can make a sneak attack that deals nonlethal damage instead of lethal damage. She cannot use a weapon that deals lethal damage to deal nonlethal damage in a sneak attack, not even with the usual -4 penalty.

(emphasis mine)
Natural weapon is not an unarmed strike and deals lethal damage (If it is not some special natural weapon that normally deals nonlethal damage).
Answer: Yes.  But it needs a feat.
Subduing Strike, a feat from the Book of Exalted Deeds (pg 46) allows you to do nonlethal damage with any melee weapon, including Sneak Attack.
See Do natural attacks count as melee weapons? for further details on natural weapons as melee weapon.
If you are a Monk, the Monk's Unarmed Strike class feature, allows for nonlethal damage explicitly at no penalty, so you can use Sneak Attack freely.
Comment: @Simon No, this is the right place for Scrollreader's post. A question can have new answers even if it already has an accepted answer. (Where else could it go, anyway?)
Comment: Please include this as something other then an answer, since the question has already been answered. Thanks for the tip on the feat btw! :)


Drawing Gloves from a drawer -- Finding Probability

Question:

Probability of drawing white glove on first attempt P(B1) = 1/5. For finding white glove at 2nd attempt means fist one was not white and hence was discarded and now 4 are left. Therefore probability of finding white is now 1/4. Hence total probability P(B2) = 1/5 + 1/4 = 1/9 but answer is 1/5, I wonder why.
Answer: Obviously $P(B_1)= \frac{1}{5}$. Now $$P(B_2)\equiv P( \mathrm{pick\,white\,glove\,second,\,after\,red/blue\, glove\, first}),$$ that is the joint probability of two (independent)events. You find that by multiplying the probabilities of each. $$P(\mathrm{red/blue\, glove\, first}) = \frac{4}{5}
$$
and
$$P(\mathrm{pick\,white\,glove\,second}) = \frac{1}{4}
$$
so $$
P(B_2)= \frac{1}{4} \times\frac{4}{5} = \frac{1}{5}
$$
If you go on the same way you find that the pattern always involves the numerator of one probability fraction cancelling the denominator of the other, yielding the same answer.
Comment: wow, what a simple way of explaining. Went right into my head :)  . Can you also tell me how to learn to think about Probability than just digesting formulas and axioms.
Comment: For most of us, thinking in terms of probability is not something we do every day so it is easy to become confused. The best way of learning is to work through lots of examples. Eventually it will come naturally to you.
Comment: I guess Schaum's Series will come in handy (https://amzn.to/2PmI99e) then. I understand all the theoretical concepts ok. I think finding how to use them to solve book problems is completely another skill and then applying them to real life problems is a skill of another dimension.


process remind to user on exact date and time in django

Question: So I have notification system in place.For example when sending a task to user, user get a notification within my system. Right now I have only "instant" notifications. so when I send a task to someone, a notification is created in the db, and via web-socket the user is notified with the data of the notification.
With the Reminder I have the problem, that the notification I want to send here is not necessarily "instant". I want to set the date to next Monday on 9 am. so User should receive the notification on Monday 9 am.
Question: Is there an extension in django (or onboard methods) where I can execute stuff delayed? For example, send notification with the following data on Monday 9 am.
Answer: Celery can be used to schedule and defer tasks.
Here's and example of how to schedule for a specific time. https://docs.celeryq.dev/en/latest/userguide/calling.html#eta-and-countdown
Comment: Note that, If you are using rabbitmq as broker, you won't be able to run tasks with countdown or eta greater than 15 minutes from now. https://stackoverflow.com/questions/67907336/celery-task-with-a-long-eta-and-rabbitmq
Comment: how can I considering in Django application?


Can a TLS HMAC be used after the fact to verify the authenticity of a message?

Question: If I were to capture a TLS session (and shared secrets) between myself and a web site operated by another party, could I later use the HMAC (or something else?) to verify to a third-party the authenticity of the downloaded data, i.e. prove that I did not alter it?
Comment: Thank you to those who pointed me to the duplicate questions.  I'm confident now that TLS alone cannot provide assurance to a third party that a session occurred as any party might claim after the fact.
Answer: Note that your description is missing an important party: that to whom you wish to prove you did not alter the message.  The question really is, can that party trust you not to produce a message you didn't exchange with the other party in the TLS session.
The answer is no, because you have saved the key, and thus you can generate valid tags for any messages as you like, which you might not have sent to the other end of the TLS connection.


Direct power off pc without formal shutdown procedure

Question: Consider this, Desktop pc has SSD drive and no program running on top of OS (or running program whose data I don't need to save). If I just switch off the power button rather than properly shut downing the pc (Say it is just for fun), what problem it may arise?
Answer: Any data not yet written to disk will be lost.
No program or service will properly shut down leaving all sorts of temporary files, pid files and the lot all over your system.  Which may interfere with proper startup of some services on the next boot.
I also suspect you'll be prompted to perform a file system check next time you boot.
Off course if it's just for fun and you don't care about the health of the system I'd say try it and report back here what you learn.
Comment: OK I am using windows 7. Till now I have tried this 20+ times, no file system checkup on boot, programs also loading properly. I think at least can hope for no hardware problem. If software is corrupted it is almost a re-install without any extra cost?!


Catagorized hierarchy menu for PAGES!

Question: Yes, I am a noob at all this so please excuse my ignorance! So, for the past couple of days, I've been searching for a drop down page menu widget, but I would like to have the pages separated into "labeled" catagories. I don't have pages that require any hierarchy, so I don't have or want a parent page to catagorize by. Basically, I want to be able to enter a label/title for the group that will show on the menu and when you click or hover on the label, the pages designated to that label will drop down. I noticed you can catagorize posts and links, but not pages. Does such a widget exist??
Answer: Such a widget does not exist.
You say you don't want to use parents, but that is my advise.
Then just make a menu for it.
If you know how you could make it yourself.
A plus of this would be that you get the 'category name' of the parent in your permalink.
An other idea would be to create a custom post type and enable categories there.
It would be better organized.
Still the menu would be best coded yourself using wp_query
Comment: Awesome sauce... looks like wp_query would be a good solution. I have a repository of resource pages and need a better way to organize them, and it looks like this will give me more control and options. Thanks for the help!

Catagorized hierarchy menu for PAGES!


Adding an ADC, what happens to input impedance

Question: quick question. What happens (in general) to my entry impedance when I add an ADC into my circuit? Is this independent of the rest of my circuit? If no, this is my circuit
Comment: @hilmar definitely not "nothing" happens. Something happens but how much and is it significant, it depends on ADC type and sampling rate, and of course components Rs, R and C too. Unless that information is available, the question cannot be answered. Hester please add more information.
Comment: In addition to Justme's comment - ADC inputs vary *very widely* depending on the device so the answer currently is that *something* will change but we simply cannot know by how much.
Answer: The ADC is affected by the impedance, not usually the other way around.
Most cheap ADCs will have a sampling capacitor on their input. This connects to the outside world for a short period of time, charges up, then disconnects and the conversion begins inside this device.
Every time the ADC takes a sample, it has to charge up this capacitor for enough time constants that the difference in voltage with what you're measuring is ideally less than 1 step of the output. As such when there is more and more "impedance" between the ADC and the "to be measured" voltage, you start losing meaningful resolution in your output.
Most ADCs in their datasheet will quote what the maximum input impedance can be for a given sampling speed, with the general rule being lowering the ADC clock speed by half will allow for more impedance because the sampling switch is open for longer. But if you get too slow, the sampling caps leakage may start affecting the measurements.
Below is a schematic of what is usually inside an actual microcontroller ADC:

Image source: Open Music Labs - ATmega ADC tutorial
Comment: I will add that if the source DC impedances Rs and R are too high for the ADC , the capacitor C has to provide low enough AC impedance to take one single sample reliably. If the ADC samples too often, the C does not have time to charge fully, so continuously sampling gulps of current is equivalent  to continuous DC load.
Answer: Do you mean  - does the impedance that the source sees changes due too the connection of the ADC?
Usually, an ADC has a high input impedance - several mega ohms.
So, in that case, if the input impedance of the ADC is much higher than the output impedance of the circuit (without the ADC), the connection of the ADC will merely affect the total impedance that the source will see.


Gitlab pull push not working

Question: OVERVIEW
I am using Gitlab server locally in ubuntu 13.10 and I got following output in these command
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production

System information
System:     Ubuntu 13.10
Current User:   git
Using RVM:  no
Ruby Version:   2.0.0p247
Gem Version:    2.0.3
Bundler Version:1.5.3
Rake Version:   10.1.0

GitLab information
Version:    6.0.2
Revision:   10b0b8f
Directory:  /home/git/gitlab
DB Adapter: mysql2
URL:        http://192.168.0.104
HTTP Clone URL: http://192.168.0.104/some-project.git
SSH Clone URL:  firstname.lastname@example.com:some-project.git
Using LDAP: no
Using Omniauth: no

GitLab Shell
Version:    1.7.0
Repositories:   /home/git/repositories/
Hooks:      /home/git/gitlab-shell/hooks/
Git:        /usr/bin/git
xxx@xxx:/home/git/gitlab$ cd /home/git/

Now I sucessfully logged into the server with firstname.lastname@example.com and create member and project. Then when I clone to the new project called testgitlab
 by git clone http://192.168.0.104/sss/testgitlab.git
I could clone the project.
PROBLEM

1. When I try to commit the project I could do that. After commiting the project when I try to pull the Project git pull origin master then following error occurs:
:~/Desktop/testgitlab$ git pull origin master
Username for 'http://192.168.0.104': sss
Password for 'http://firstname.lastname@example.com':
fatal: Couldn't find remote ref master
Unexpected end of command stream

2. After I get unsucessful in pulling the project I tried to push the project:
    ~/Desktop/testgitlab$ git push origin master
Username for 'http://192.168.0.104': sss
Password for 'http://email@example.com':
Counting objects: 3, done.
Writing objects: 100% (3/3), 220 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find json-1.7.7 in any of the sources (Bundler::GemNotFound)
remote:     from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/spec_set.rb:85:in `map!'
remote:     from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/spec_set.rb:85:in `materialize'
remote:     from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/definition.rb:133:in `specs'
remote:     from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/definition.rb:178:in `specs_for'
remote:     from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/definition.rb:167:in `requested_specs'
remote:     from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/environment.rb:18:in `requested_specs'
remote:     from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/runtime.rb:13:in `setup'
remote:     from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler.rb:119:in `setup'
remote:     from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/setup.rb:17:in `<top (required)>'
remote:     from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
remote:     from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
remote: error: hook declined to update refs/heads/master
To http://192.168.0.104/username/testgitlab.git
 ! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'http://192.168.0.104/sss/testgitlab.git'

When checking the gitlab status
    sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
Checking Environment ...

Git configured for git user? ... yes
Has python2? ... yes
python2 is supported version? ... yes

Checking Environment ... Finished

Checking GitLab Shell ...

GitLab Shell version >= 1.7.0 ? ... OK (1.7.0)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
post-receive hook up-to-date? ... yes
post-receive hooks in repos are links: ...
Administrator / sesh ... repository is empty
sss / TestGitlab ... repository is empty

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes

Checking Sidekiq ... Finished

Checking GitLab ...

Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
Projects have satellites? ...
Administrator / sesh ... can't create, repository is empty
sss / TestGitlab ... can't create, repository is empty
Redis version >= 2.0.0? ... yes
Your git bin path is "/usr/bin/git"
Git version >= 1.7.10 ? ... yes (1.8.3)

Checking GitLab ... Finished

I cannot figure out what I am missing ....
Help me out .
Thank you in advace !!!
Answer: I had a problem related to the issue 3384 that @Jonathan is referring to.
I solved it allowing the git user to login (modifying the /etc/passwd to set the shell to bash for the git user).
See my answer here: GitLab 7-0 stable not able to push or clone
Answer: An issue on github indicates, that it might have something to do with the unicorn/nginx/gitlab-shell configuration. Make sure to double check all the configs:
https://github.com/gitlabhq/gitlabhq/issues/3384

Gitlab pull push not working


How do I transfer funds from MY OWN card to MY OWN personal bank account?

Question: Would anyone please be so kind to explain me how (where) could I transfer funds from my own debit and/or credit (particularly debit) card issued by X bank (USA) to my own personal checking bank account owned in Y bank (USA)? I would like to particularly emphasize that I am NOT asking for suggestions to use alternative options such as wires, ach, ewallets, cash deposit. I had to emphasize this so someone wouldn't tell me to just log in and do some internal transfer between own accounts. On both, card and bank account is my own name. Balance Transfer won't work because it is between card only. Cash advance (ATM) won't be solution either. What else could I do? I am asking only for my own assets but unfortunately in two different banks.
Comment: Could you clarify why all the normal, proscribed, officially supported options won't work for you? ACH and wire exist explicitly for bank to bank transfers, but there are no funds "on/in" debit (unless prepaid) or credit cards, but rather act as a tool to transfer using intermediary banks (credit processors) and aren't free. It is hard to know what to suggest without knowing why the normal methods are off the table. Affordability? Bank won't let you? Convenience? Can't write a check to yourself from an associated checking account? Etc.
Comment: ACH isn't an "alternative option". It's *the* option for transferring between checking accounts at different banks.
Comment: @BrianH that and "I am asking only for my own assets" strike me as the kinds of questions that immigrant or foreign scammers ask when trying to develop as scam.
Comment: Is your Bank X debit card prepaid?
Answer: This answer is predicated upon your Bank X Debit Card not being prepaid.

Would anyone please be so kind to explain me how (where) could I transfer funds from my own debit

Since a debit card is directly tied to a bank account, it doesn't make sense to transfer money from a DC to a bank account.

and/or credit (particularly debit) card issued by X bank (USA) to my own personal checking bank account owned in Y bank (USA)?

That would be a cash advance.  Cash advances are Very Expensive.

I would like to particularly emphasize that I am NOT asking for suggestions to use alternative options such as wires, ach

Why not?

Cash advance (ATM) won't be solution either.

But that's what getting money from your credit card is.
The bottom line is that your question indicates some deeply fundamental misunderstandings about the US banking system.
Answer: Bank cards are like keys to a house. They grant access to the stuff inside but don't themselves contain that stuff.
When you deposit money at a bank, the bank takes your money and credits it to your account. You can then access those funds via various 'keys' - cards, internet banking, passbooks, etc.
When you have an account at another bank, that's like having stuff in another house. Bringing your old key to the new house isn't the same thing as bringing the furniture along.
tl;dr: It doesn't make sense to talk about transfer of funds from one bank to another without the funds going from one account to another.
Answer: A debit card, which is linked to a bank account, is just one of the ways to make a payment from that bank account.
However, the card can only be used to make a payment to someone who has a merchant account which allows reception of card payments. A merchant account is for businesses, and the holder of the merchant account will have to pay a commission on each payment they receive (in addition to setup and monthly costs, in most cases).
The funds you can use with your debit card are actually in the bank account. So the real good solution to make a payment from one bank account to another is to make a bank transfer/wire/ACH from one account to the other. Depending on the bank(s), the type of account, the type of transfer, this may be free or incur a fee, though the fee is usually small nowadays if there is one.
An alternative is to use your debit card to withdraw money from your bank account using an ATM (subject to any fees levied by the ATM and/or the bank for such a withdrawal) and then deposit the money into the other bank account (possibly subject to fees as well).
Yet another alternative is to use a good old-fashioned check, if you still have a check book. Yet again, there may be fees on either side.
If your are talking about a different type of card such as a prepaid card, then it may be possible you can't access the funds via other means than using the card, though you should probably double check, many prepaid cards actually provide alternatives. If you can indeed only use the card to access the funds, then alternatives include:

withdrawing the money at an ATM, if the card allows it, which would probably incur fees
it may be possible to add the card to a Paypal account or other similar payment services provider and use it to fund a payment to your account (though this may be restricted to sending money to someone else rather than withdrawing to your own account). There will probably be fees to be paid as well.
You can open a Transferwise Borderless account, and add funds using the card. There are fees for that, though (0.75% from a debit card, 3.4% from a credit card), and then more fees to send the money to the destination bank account.

The same applies for a credit card, though you usually don't have a positive balance on a credit card, and this would most definitely be a cash advance, which is subject to yet more fees (and interest).
Answer: You could use PayPal, register there your IBANs [PANs] and transfers from IBAN1 [PAN1] to PayPal (PayPal top-up) and then from PayPal to IBAN2 [PAN2] (Transfer).
If you use cards I think you have to transfer at least 100$ (here is 100€) to have the transaction for free.
But if yours are debit card (that are linked to a plain old bank account) why you don't just do a money transfer between "underlaying" accounts, most banks offer those for free.
NOTE: it works if accounts are different, if your card is linked to the same IBAN you want to transfer to it does not make sense because card are "taking money" from the same pool you want to splash money into.


Indicator Applet Icons Spacing Too Large

Question: I'm using Gnome Classic , Ubuntu 11.04.  The icon spacing for the indicator applet icons is just too large. Is it me or has this  happened to someone else? Has anyone found a fix?
Back in 10.10, a ppa , ppa:m0sia i think, had packages that corrected this design sore. There are no packages there for Natty atm.
Answer: Unfortunately, GConf doesn't have any entries for indicator applet spacing and currently m0sia's PPA - as you've noticed - is only for Maverick.
You could tick yourself off at the 100 Papercuts bug as affected.
Maybe, like Rocko (Post #4), you could agree with him and suggest to use GConf entries?
Fingers crossed that they at least enable a gconf-editor setting for applet spacing in Ubuntu Oneiric Ocelot.
Also, if you're keen... you can try out this guide to compiling your own indicator-applet with a fix for spacing.
Be warned though, the same person who posted the how to, also noted:

For other themes, where the patch only represents an improvement for Indicator Applet and not a fix, the portion of the space/gap that is NOT eliminated, is necessary to retain good readability for Indicator Applet Application Menu.
Comment: I follow the guide mentioned above and indeed that it turn out also reducing indicator-appmenu that make it hard to read and almost overlapping, then I try to reinstall deb package of indicator-applet-appmenu, indicator-application & indicator-appmenu and solved my expectation, now I have indicator-applet-complete with reduce spacing and also readable indicator-appmenu on the left as before applying the patch above, thank you for providing the patch


Does the Advanced Class Guide exist in German?

Question: As said in the title, does the Advanced Class Guide for Pathfinder exist in German? If not, do the contents exist in German? As in the classes and especially feats?
Comment: I know it's kind of a short question, and probably the answer is "no", (I think I would have found it via google easiely if it existed), so I am mainly asking for the second part of the question.
Answer: Official Release: September 2015
The German version of Pathfinder is created and published by Ulisses Spiele (who are also the current creators of The Dark Eye). A list of all German Pathfinder Rulebooks published by them can be found on their website.
Ausbauregeln VI: Klassen, the German version of the Advanced Class Guide is scheduled for release in september.
Apart from the official release, there is also the German PRD (which is linked to by Ulisses). As far as I can tell, it contains the official Ulisses translated content (which they put under OGL to prevent ugly copyright issues). At this moment there are no references to the ACG at the moment.

That being said, with the ACG being mostly OGL content, fan-based translations are legal and might exist somewhere in the internet, such as alternative PRDs (which I don't know of). Though to be honest, I wouldn't expect anyone to put in the effort of translating the whole book (without pay), when the official translation is already being worked on.


What is Aunt Muriel's maiden name?

Question: We know Ron Weasley had a great-aunt named Muriel. However, this was on his mother's side, so they wouldn't share a name. If Muriel is related to Molly on her father's side, she could be Muriel Prewett, but we don't know if she is. Is anything known on the topic?
Answer: We don't know:

Her surname is unknown. It may be Prewett, but only if she is related to Molly on her father's side.
- Muriel - Harry Potter Wikia

There's also no reference to her surname on Pottermore.

Surname possibly Prewett? As Molly's aunt, Muriel could be either the sister or the sister-in-law of Molly's parents. Even if Muriel is a connection through Molly's father, a Prewett, that doesn't necessarily mean that Muriel's adult surname was Prewett. The only thing that is certain is that Muriel is not a Weasley.
- Auntie Muriel - HP-Lexicon

Heres another quote that enforces the fact that we can't be sure of her Surname

Ron's Auntie Muriel (no mention whether she's a Weasley or a Prewett, though her opinions suggest she is a Prewett) is an aged, outspoken, eccentric relative of the Weasley family.
- Auntie Muriel - Wikibooks.org

What is Aunt Muriel's maiden name?


Can 'Agile' be applied to Healthcare IT teams?

Question: Can Agile be employed in a field like Healthcare IT, where so much of patient care depends on the quality and timely delivery of systems?
Comment: There is an interesting [article](http://drdobbs.com/architecture-and-design/228300298) on Dr.Dobbs site about GE's Imaging Solutions unit experience with transition to Agile methodologies.
Answer: Yes, agile development absolutely has a role in Healthcare IT development. No one, not the end-user, not the patient and certainly not the development team is well served by a poorly done development process. Considering some of the principles that underly the Agile manifesto (list shamelessly ripped from Wikipedia with my commentary):

Customer satisfaction by rapid delivery of useful software. When isn't this an objective?
Welcome changing requirements, even late in development. Healthcare IT integrates into a field that, while absolutely inundated with technology, isn't particularly IT focused. The potential for a system being designed to "get it right" right off the bat is pretty low.
Working software is delivered frequently (weeks rather than months). As an end-user of some of this stuff, god would I love this. Rapid, working changes are invaluable, and what turns Healthcare IT from "that thing we need to do" to "that thing that changes the way I do my job".
Working software is the principal measure of progress. Makes sense in most applications, so there's really no reason it wouldn't span to HIT.
Sustainable development, able to maintain a constant pace. You see this all over healthcare, from infection surveillance to HIT to facilities. Healthcare isn't a boom-or-bust cycle, its a constant drumbeat.
Close, daily co-operation between business people and developers. Most HIT isn't a developer tool. It's a tool made by developers. Contact with the client is, and should be, key. It's also much easier to get a system adopted if it works and integrates into the clients workflow, rather than needing to be tacked on, patched, etc.
Face-to-face conversation is the best form of communication (co-location). From my interaction with clinicians, it's way easier to get stuff done in person, preferably with pads of paper, than any other way.
Projects are built around motivated individuals, who should be trusted. This is something that will make your life better - so yeah, it should be adopted ;)
Continuous attention to technical excellence and good design. This is again one of those "everyone should do this, so of course you should" thing. But consider the complexity of HIT systems, and the myriad ways they end up being used, day-in, day-out. A shoddy system isn't going to cut it.
Simplicity. It should work out of the box. It should work well, all the time, and in the way it's supposed to. People are idiots. Healthcare workers are people. Therefore...you know the rest. Simplicity helps.
Self-organizing teams. This one might be a little more of a stretch for HIT. Honestly, I'm not confident enough to say one way or the other whether self-organization in this setting is good or not.
Regular adaptation to changing circumstances. HIT is an active, growing industry with complex, changing regulatory burdens. Being able to adapt seems like a decent idea.
Comment: "Customer satisfaction by rapid delivery of useful software.": Rapid delivery? When you are producing some mission-critical software like e.g. a biopsy software you care more about **correctness** than rapid delivery. And you cannot wait for the customer's feedback to correct certain problems, like "Hey, we took a few biopsies from the wrong body position, the customer is not satisfied, let's go fix it during the next sprint."
Comment: @Giorgio Nobody said the software shouldn't be as correct as its domain requires. The "rapid delivery" part of agile is supposed to be about incremental delivery of features, not incremental fixing of bugs. If the software does more than just biopsy reports, should the client have to wait until every feature is implemented before he can check that the biopsy feature actually does what they wanted? Of course, when correctness is a priority you'll have to be more rigorous about separation of concerns and testing for regressions.
Comment: If you wait until the end of a project to deliver "any" software, I don't think your objective is very rapid. Only by having a loose definition can you apply it to everyone.
Answer: The discussions surrounding the use of Agile Medical Device Software Development in a FDA regulated setting have been around for awhile and are relevant to this question. Here are some reasons why:

The Waterfall vs. Iterative development pros and cons are essentially the same and would need to be considered for any Health IT project.
The FDA mandated quality systems (see General Principles of Software Validation; Final Guidance for Industry and FDA Staff) for medical device software development used is the industry gold standard. It should be noted that these regulations do not dictate any particular development methodology. In any case, the quality of Health IT software would be vastly improved if these best practices were followed by all.
Most Heath IT software development does not
currently operate under these FDA regulatory standards. As the
barriers for medical device interoperability continue to fall, in
particular for mobile platforms, this is likely going to
change -- see FDA Addresses Mobile Medical Apps.
Also, if you are developing commercial Health IT software you have to ask yourself if you are creating a medical device data system (MDDS): Is My Product a MDDS?
Answer: The short answer is "Yes". A longer but more accurate answer is "If you take it seriously."
There are a few themes to keep in mind, which I like to separate into concerns related to (a) patient safety & product quality, and (b) industry regulation.
On the safety and quality side, keep in mind that making safe software is difficult.  A few good programmers with some domain knowledge can crank out incredibly useful software that's pretty safe. If they are part of the deployment in a local clinical setting, and can keep responding and adjusting to events during deployment and use of the software, the software might provide value, saving or improving lives with only a few injuries or deaths relate to use errors or software bugs.  But the software will require the programmers to be there, all the time, responding, co-evolving the software as the use of the software evolves.  This is not a scalable process and when the programmers die or get bored the system can easily become very hazardous very quickly. In order to improve these outcomes and make safe software, there are important development process steps that need to be taken while the software is developed.  A good "out of the box" introduction to these can be found in the international standard for development of medical device software, ISO/IEC 62304. The main concept is safety risk management at all stages - during use case analysis and story development, requirements elucidation, system and architectural design, implementation, unit and integration testing. Being agile won't make any of this work go away, or be less difficult, but by focusing on value creation and eliminating work (such as unneeded features, or excessive verification test/fix cycles) that does not create value, agile development can allow a team to integrate this work into development, resulting in safer software developed in the same time. The iterative development practices commonly used by agile teams are very well suited to getting the safety risk management work done, evolving throughout the life of the project rather than being an afterthought. And after the software is operational, feedback from the users and any events even potentially leading to injury need to be considered, individually, and in aggregate, to keep the software safe to use. Agile can help here if it provides a fast-track, safe process for incorporating changes without breaking other parts of the system - which in turn once again requires a good architecture and well-understood design interactions that were created when the software was developed.
The second concern is regulatory.  In an ideal world, safety regulations would apply to all products that could be sufficiently dangerous, and a vendor would be able to comply by doing some simple things once they started to cross the line.  In practice, global regulations are complex and fast-moving in this industry, meaning that one day you can be developing a small iPhone app that shows some medical data, and the next you are expected to comply with ISO and FDA standards for "quality management system", or QMS.  That can be scary for companies that have not had a formal QMS in the past. And agile can exacerbate this because you might start out with a product concept, and through evolutionary development enter unwittingly into a regulated intended use (such as displaying clinical diagnosis data to a user). It's October 2011; my advice to any company contemplating marketing a product that has "health", "medical", "healthcare" in the category name is that they should have a plan for when the product they make becomes regulated by one or more medical device regulators worldwide.  Here again agile can help, because the agile practices generally produce (or easily could produce) compliant outputs to satisfy regulatory customers both for pre-market clearance submissions (like FDA 510k), certification (like ISO 13485), and post-market operations.  Test-first development fits right into medical software. Continuous integration, automated unit testing, and SCRUM sprint metadata can provide complete objective evidence that risk management and proper verification are done not just as an afterthought but baked in to the development process. In most cases I think agile produces more artifacts than "waterfall", perhaps not in the same form.  But conversion of the outputs into something satisfying regulators is a relatively small problem to solve.
So in summary... yes Virginia, there is agile for healthcare IT (and other medical device) software development.  Like all things agile, it takes dedication to process, business support, and courage.
Comment: Good overview Dave, but I have to take issue with your "relatively small problem to solve" comment. Agile does produce pretty good verification artifacts whether it's TDD or BDD. There are considerable gaps that need to be filled though. Risk analysis, design documentation and reviews, traceability to requirements, and validation are all still necessary FDA regulatory components. In my experience, doing these tasks properly always consume significant resources.
Comment: That's why I say "relatively" - as in smaller (by far) than attempting to impose a waterfall process flow to develop a device for the same intended use which will attain the same quality level. Making safe software requires activities such as risk management, independent of agile or non-agile execution methodologies.
Answer: Yes, one of the premises of agile development is customer involvement.  This is critical in healthcare IT systems and processes.  Healthcare IT departments will make better decisions if a customer representative is involved and giving input about how the decisions will affect patient care.
Comment: This answer, and several others implies that there is one "customer" to a Health IT system. But this is clearly not true. The patient, the provider and the payer at a minimum are customers.
Comment: By Customer I mean a non-IT person who interacts with the system as a user.  Customer here would mean **Anyone** who uses the system created by the IT department.
Answer: I think it is possible, but the industry needs a huge paradigm shift. I'm in my second year as a health care developer, and trust and self organizing are not anywhere apparent. Healthcare would greatly benefit from formally adopting agile, since it's mostly chaos anyway, with iterative development called "thrash" and late changing requirements because, well, big design upfront doesn't work anyway.
Answer: I do understand your question. A good example of Agile development is building a website for someone. Usually a customer doesn't know exactly what he/she wants, so there's a lot of interaction with the customer.
Healthcare IT might seem like a very predefined field in the computer science; with it's strict standards (DICOM, HL7) it seems like there's only one way to implement them, but there's also a lot of preferences and decision making.
In my opinion, whatever product you're making, you're not able to determine ALL the requirements ahead of time, so an agile software development method works very nicely.
Answer: As noted, the answer is yes.
When applying Agile to regulated or high risk areas you must define "Done" at each iteration such that regulatory compliance and other risk mitigation strategies are included. For instance, this may require QA documentation, requirements traceability, security audit and other actions to be completed on every iteration.
There's good art and practice, for instance, for application of Agile approaches to FDA regulated environments.
Answer: The short answer:  Yes.  There is a good blog about Agile in High-Assurance Environments that gives some tips.
However, there are some compromises that need to be made.  Consider the Agile Manifesto:

Individuals and interactions over processes and tools
Working software over comprehensive documentation
Customer collaboration over contract negotiation
Responding to change over following a plan

The regulatory bodies value the left-hand side as much as agile teams do, but they require more emphasis on the right-hand side than a typical agile team would do.  The FDA, for instance, requires that you validate your processes and tools, asks for fairly comprehensive design and test documentation, and definitely requires a good deal of planning.
On the flip side, many agile principles fit very well into the healthcare world, including:

TDD and Pair Programming - increase quality
Tight Customer Feedback Loops - early validation is great
Iterative Planning - regulatory bodies are all about planning
Answer: Some disciplines are already agile in nature.  Nursing, for example, relies on a an 'assessment-evaluation-planning-intervention' cycles that depends on multiple iterations of diagnosis/prognosis to incrementally achieve final outcomes.
However, it would be a fatal conflation to try to suggest that health care services provided in such a manner are specifically suited to an essentially single-instance application of Agile software development toward a software tool or system for use in said service delivery.
Comment: +1 for comparing Agile software development to nursing. Bravo!
Answer: AAMI is actively working on a Technical Information Report entitled:
AAMI TIR SW1, Guidance on the use of agile practices in the development of medical device software.
I've heard that it may be published in 2012.
It discusses the alignment of the principles of the Agile Manifesto (see EpiGrads answer) with the regulatory requirements, typical processes and other product practicalities associated with medical device software.


Data Driven Pages with a small section of grid

Question: I'm trying to make map book with data driven pages. Never a problem when it just a grid specified for the complete extent.
But now i am using a grid that covers more than the area i want to print.
i was wondering if it is possible to specify wich pages to print, or to use in the layout.
Comment: Couldn't you just create a new .shp or feature class, from a selection of the complete grid, of the pages you want to print and use that as your DDP index layer? It seems like a simple fix, but maybe I'm misunderstanding the question.
Comment: Have you tried selecting the grid features you want exported/printed, and then running your export or print using DDP?  In the  dialog box there is an option to only use the selected index features.  Alternately you could create a selection layer in your TOC from your grid, and then use that as your index layer.
Comment: The way to do this is to put a definition query on the DDP layer to only show the pages you want.  Then, refresh your DDP and run again.
Answer: Create a definition query on your DDP layer to only show the pages you want.

Refresh your Data Driven Pages.

Run your DDP again.  This will only print the pages that you specify.


Principal of conservation of angular momentum in uniformly moving body

Question: Consider a point mass object moving along a straight line with constant velocity. As the velocity is constant so is its linear momentum. If we measure the angular momentum of the body with respect to an origin O, then we realize that the angular momentum of the body will change as the body moves because angular momentum $\textbf{L}=\textbf{r}\times\textbf{P}$ and $\textbf{r}$ varies from one point to other. But according to equation
                         $$\frac{d\textbf{L}}{dt}=\textbf{r}\times \frac{d\textbf{P}}{dt}=\textbf{r}\times\textbf{F}$$
This would be equal to zero since $\textbf{P}$ is a constant or because there is no force acting on a uniformly moving body. How is this possible if $\textbf{L}$ is different at different points with respect to the origin
Comment: Why is there X and x?
Comment: @XcoderX  X or x indicates cross multiplication between two vectors
Comment: Hmm then since r and p are constant throughout what...
Comment: P is a constant with respect to any point in a fixed frame of reference since the object is in uniform motion. But r which is the position vector of the object  with respect to origin O changes as the object is moving. So the angular momentum of the body about O should also change with time
Comment: You might want to properly typeset your question as per https://physics.meta.stackexchange.com/questions/804/is-there-a-standard-place-to-point-people-to-learn-how-to-typeset-their-equation?noredirect=1&lq=1
Answer: This is the same Rod's answer but let me take a more graphical approach:

The angular momentum when the particle is at position (1) is just:
$$L = rmv$$
because at this point the direction of motion is at right angles to the line joining the object to the reference point. So far so good.
Now consider the point (2). The angular momentum at this point is:
$$ \mathbf L = \mathbf d \times m\mathbf v $$
Considering just the magnitude and using the definition of the cross product we get:
$$ L = d\,mv\,\sin\theta = \frac{r}{\sin\theta} mv\,\sin\theta = rmv $$
So we find the magnitude of the angular momentum is constant. And the direction is constant because it's normal to the diagram in both cases. So even though it looks as if the angular momentum should be changing in fact it is constant.
Answer: The formula $\vec{L}=\vec{r}\times\vec{p}$ superficially looks as though angular momentum of a coasting body does change with time. But the change of $\vec{r}$ is parallel to the momentum, so $\vec{L}$ is in fact constant. In symbols, applying the Leibniz rule:
$$\mathrm{d}_t \vec{L} = (\mathrm{d}_t \vec{r}) \times \vec{p} + \vec{r}\times \mathrm{d}_t\,\vec{p}$$
but $\vec{p}$ is constant, by assumption, so the second term vanishes. Also $\mathrm{d}_t \vec{r}=\vec{v}$, the velocity, which is parallel to the momentum, so the first term vanishes as well.


Multiple delete in Microsoft Outlook Web Access

Question: How can I delete multiple or all inbox messages in the Microsoft Outlook Web Access 2003?
Answer: Did you try logging into your OWA with some other browser than Internet Explorer or Firefox ?
Opera for instance is not fully supported which can actually be a good thing since you don't get all that fancy Outlook imitation. The interface is much simpler and functionalities are much more available. You should then get a "check all" and be able to delete with increased speed.
Else, best solution would still probably to be able to configure and connect an Outlook client to your OWA...
Comment: The best way is to connect Outlook client.
Answer: If using OWA 2007 (I do not have 2003 installed to test) there should just be some checkboxes that you can tick to affect multiple items, then just click delete.

(OWA 2007 on Firefox)
If you are using OWA 2003 or 2007 in Internet Explorer, I believe that you can hold down shift to highlight multiple items in order or control to select multiple items that are separate to each other.
Comment: It's OWA 2003 and shift does not work. I need to delte about 8000 messages.
Comment: Odd. Ctrl-click and Shift-click work as expected for me using OWA on Exchange 2003
Answer: Shift-click does work — but only if you don't scroll too far.
I find I can get about two screenfuls of scrolling for each chunk added to the selection.
If you go too far by mistake, it's not a problem, just scroll back up a little closer and try again.  You can scroll back to the top to verify the selection is still intact without losing what you've done.  It's possible that zooming out (cmd--) helps, but only a little bit, even if you zoom a lot.  (It seemed like I could pick up maybe 10 more items per click.)
None of the other solutions here or in a near-duplicate question worked for me, though my case was slightly different (selecting in order to move, rather than delete messages).   I tried using Opera, Shift-click or Cmd-Shift-click to select the whole range at once, or most frustratingly Cmd-A.


How to format the locked usb flash drive using GParted?

Question: I couldn't format/delete my USB flash drive using GParted and it is locked too.
When right click on it, the format and delete options are grayed out.
 Please help me.
Comment: If there are still problems to format the USB drive, after you have unmounted all partitions on the drive, you can use the following link to analyze, and I hope, solve the problem, [Can't format my usb drive. I have already tried with mkdosfs and gparted](https://askubuntu.com/questions/144852/cant-format-my-usb-drive-i-have-already-tried-with-mkdosfs-and-gparted/933035#933035)
Answer: First unmount the USB, Type in Terminal:
sudo umount /dev/YOUR_USB

Where YOUR_USB is the Filesystem, to get it Type in Terminal:
df

Or
df /path/to/your/usb

After the umount you should be able to format the USB using GParted.
Here is an example:
$ df /media/bg/120GB/
Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/sdb1      115247656 22539168  86831140  21% /media/bg/120GB

$ sudo umount /dev/sdb1

Answer: In addition to Benny's suggestion of how to unmount the partition, you can also unmount from within GParted.
Assuming that you did not boot from the USB drive, you can unmount the USB partition in GParted using the Partition -> Unmount menu option.  After the partition is unmounted then you should be able to format it.


Is there always a direction in which the directional derivative of a function is zero?

Question: Simple question like the title asked, Is there always a direction in which the directional derivative of a function is zero? At origin, wouldn't directional derivative always be 0?
Comment: Hello and welcome to math.stackexchange! Nice question. The answer is  YES, as soon as there is more than one independent variable and the function is differentiable. Any direction that is perpendicular to the gradient will do. But this has nothing to do with the origin
Comment: Could you give me some examples? Thanks.
Comment: Let $f(x,y)$ then $\nabla_v f(0) = v_x \frac{\partial f}{\partial x}(0)+ v_y\frac{\partial f}{\partial y}(0) $ and so $v_x = -\frac{\partial f}{\partial y}(0) ,v_y = \frac{\partial f}{\partial x}(0) $ is a direction such that $\nabla_v f(0) =0$
Comment: @user3613025, what are you asking for examples of? Examples of directional derivatives of differentiable functions? Examples of perpendicular functions? etc.
Answer: Nice functions?: Yes
If a function $f$ is nice enough that it is differentiable at a point $\mathbf{x}$, the directional derivative in the direction of $\mathbf{v}$ (at least if $\mathbf{v}$ is a unit vector), is given by the dot product of the gradient and $\mathbf{v}$: $\nabla_{\mathbf{v}}f(\mathbf{x})=\nabla f(\mathbf{x})\bullet \mathbf{v}$. If you are working in at least two dimensions, you can do as Hans Engler suggested and take $\mathbf{v}$ in a direction perpendicular to $\nabla f(\mathbf{x})$ to force $\nabla f(\mathbf{x})\bullet \mathbf{v}=0$.
So for differentiable functions, the answer is yes.
All functions?: No
However, in general, the answer is no.
Example
Consider the function $$f\left(x,y\right)=\begin{cases}\dfrac{xy^{2}}{x^{2}+y^{4}}+x+y & \text{ where defined }\\0 & \text{ at }(0,0)\end{cases}$$
This function is not differentiable at $(0,0)$, but all directional derivatives exist at that point. It turns out that none of those directions give a directional derivative of $0$.
Argument
The derivative in the direction of $\langle\pm1,0\rangle$ is $\displaystyle{\lim_{h\to0}}\dfrac{f(\pm h,0)-f(0,0)}{h}=\displaystyle{\lim_{h\to0}}\dfrac{\pm h}{h}=\pm 1$.
Now consider all other directions, unit vectors $\left\langle a,b\right\rangle$, where $a\ne0$. The directional derivative is ${\displaystyle \lim_{h\to0}}\dfrac{f\left(h\left\langle a,b\right\rangle \right)-f\left(0,0\right)}{h}={\displaystyle \lim_{h\to0}}\dfrac{ab^{2}}{a^{2}+h^{2}b^{4}}+a+b=\dfrac{b^{2}}{a}+a+b=\dfrac{a^2+ab+b^2}{a}$. If $ab=0$ then since $a\ne0$ we have $b=0$, so this directional derivative is $a=\pm1$. If $ab>0$ then $a^2+ab+b^2>0$ and if $ab<0$ then $a^2+ab+b^2=(a+b)^2-ab>0$. In all cases, the directional derivative can't be $0$.
Pictures
To get a sense for this visually, the graph of $f$ is
The parabolic crease is why it's not continuous or differentiable at $(0,0)$.
You can see slices of it at various angles to investigate the directional derivatives:


Inserting and deleting UITableViewCell at the same time not working

Question: I'm having quite a bit of pain inserting and deleting UITableViewCells from the same UITableView!
I don't normally post code, but I thought this was the best way of showing where I'm having the problem:

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 5;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    if (iSelectedSection == section) return 5;
    return 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    //NSLog(@"drawing row:%d section:%d", [indexPath row], [indexPath section]);

    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
    }

    if (iSelectedSection == [indexPath section]) {
        cell.textColor = [UIColor redColor];
    } else {
        cell.textColor = [UIColor blackColor];
    }

    cell.text = [NSString stringWithFormat:@"Section: %d Row: %d", [indexPath section], [indexPath row]];

    // Set up the cell
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // Navigation logic -- create and push a new view controller

    if ([indexPath row] == 0) {

        NSMutableArray *rowsToRemove = [NSMutableArray array];
        NSMutableArray *rowsToAdd = [NSMutableArray array];

        for(int i=0; i<5; i++) {

            //NSLog(@"Adding row:%d section:%d ", i, [indexPath section]);
            //NSLog(@"Removing row:%d section:%d ", i, iSelectedSection);

            [rowsToAdd addObject:[NSIndexPath indexPathForRow:i inSection:[indexPath section]]];
            [rowsToRemove addObject:[NSIndexPath indexPathForRow:i inSection:iSelectedSection]];

        }

        iSelectedSection = [indexPath section];

        [tableView beginUpdates];
        [tableView deleteRowsAtIndexPaths:rowsToRemove withRowAnimation:YES];
        [tableView insertRowsAtIndexPaths:rowsToAdd withRowAnimation:YES];
        [tableView endUpdates];

    }
}

This code creates 5 sections, the 1st (indexed from 0) with 5 rows. When you select a section - it removes the rows from the section you had previously selected and adds rows to the section you just selected.
Pictorally, when I load up the app, I have something like this:
http://www.freeimagehosting.net/uploads/1b9f2d57e7.png http://www.freeimagehosting.net/uploads/1b9f2d57e7.png
Image here: http://www.freeimagehosting.net/uploads/1b9f2d57e7.png
After selecting a table row 0 of section 2, I then delete the rows of section 1 (which is selected by default) and add the rows of section 2. But I get this:
http://www.freeimagehosting.net/uploads/6d5d904e84.png http://www.freeimagehosting.net/uploads/6d5d904e84.png
Image here: http://www.freeimagehosting.net/uploads/6d5d904e84.png
...which isn't what I expect to happen! It seems like the first row of section 2 somehow remains - even though it definitly gets deleted.
If I just do a [tableView reloadData], everything appears as normal... but I obviously forefit the nice animations.
I'd really appreciate it if someone could shine some light here! It's driving me a little crazy!
Thanks again,
Nick.
Answer: Struggled to get this to work. Here's my code to add a row to my tableView:
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
[tableView beginUpdates];
[dataSource insertObject:[artistField text] atIndex:0];
[tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationTop];
[tableView endUpdates];

Answer: I don't remember where I read this but I believe you shouldn't perform table row updates (insertions and deletions) from inside one of the table view delegate functions. I think a better alternative would be to do a performSelectorOnMainThread passing along the necessary information needed to perform the updates as an object. Something like:
- (void)tableView:(UITableView *)tableView
  didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // ....
    [self performSelectorOnMainThread: @selector(insertRows:)
                           withObject: someObjectOrNil]; // double check args
}

- (void) insertRows: (NSObject*)someObjectOrNil {
    [tableView beginUpdates];
    // update logic
    [tableView endUpdates];

    // don't call reloadData here, but ensure that data returned from the
    // table view delegate functions are in sync
}

Answer: I seem to remember that numberOfRowsInSection: will get called when you call deleteRows or insertRow, you need to be really careful that the reality numberOfRowsInSection cliams matches your changes. In this case you may want to try moving the iSelectedSection = [indexPath section]; line to after the endUpdates.
Answer: In the code you posted, your loop index runs from 0 to 4, which suggests that it would delete all of the rows in section 1, and then add five new rows to section 2. Since each section already has a row 0, this would add a second instance of section 2, row 0 to the table.
I would suggest having your loop run from 1 to 4:
for (int i=1; i<5; i++)
{
    // ...
}
Comment: Hey eJames, thanks for your comment - a really valid point!! I thought for a minute it might solve my problem - but I still have the same trouble. I think there actually might be a iPhone but when you try and remove items from one section and adding them to another section at the same time...
Answer: FYI: This bug seems to have been fixed completely with the 2.2 iPhone update.
Thanks Apple!
Nick.


How to activate/deactivate synapse with super key shortcut in Ubuntu 16.04?

Question: I want to activate/deactivate synapse with Super key shortcut in Ubuntu 16.04, I tried old solutions in this site but I still can't change the shortcut.
Comment: Possible duplicate of [Can I change Synapse shortcut to Super/Windows key alone?](https://askubuntu.com/questions/174838/can-i-change-synapse-shortcut-to-super-windows-key-alone)
Comment: https://askubuntu.com/a/511236/925128
Answer: There is no "simple" solution. To assign an action to just pressing the Super key requires a specific tool, ksuperkey.
The utility ksuperkey lets you assign any action to pressing and releasing the Super key alone (and other keys if you wish). It will not interfere with uses of the Super key as a modifier for other keys.
The tool ksuperkey is on Github. It is not available in the Ubuntu repositories. Probably, as I did, you will need to compile the utility yourself according to the instructions on the Github page. Do not be afraid: it is an easy compile.
Edit 2019-06-05: A software repository for ksuperkey is available for easier installation: https://launchpad.net/~mehanik/+archive/ubuntu/ksuperkey /Edit
Once loaded, the tool intercepts pressing and releasing Super and remaps that by default to Alt+F1, in many desktops a hotkey for the menuing system. Using command line options, that mapping can be changed.
Thus, create a script that does what you want, in this case toggling synapse. Assign it the hotkey Alt+F1. ksuperkey, which you preferably have autostarted when you log in, will call this hotkey when you press and release kbd>Super.
If you want to preserve the current binding of Alt+F1, then assign another shortcut of your choice to your script. In that case, you will need to autostart ksuperkey with appropriate command line options to remap to the hotkey you have chosen. Help on the command line options is available on the Github page.