Is ORM still the "Vietnam of Computer Science"?

Question: I read this post last night, and I noticed it was from 2006.  I could go either way on the ORM, database thing, but I was just wondering if everything bad Jeff said about ORM still applies even now considering the post is from 2006.
Comment: Vietnam was the last reference point for the US when the article was written in 2004. Nowadays isn't it safe to say, "Iraq of Computer Science?" Or is that still uncool for another twenty years?
Comment: @Daniel: yes, too soon.  Vietnam is still the preferred metaphor for "intractable quagmire."
Comment: I will say "Afganistan" of CS. It provides more colorful comparison.
Comment: As of 9/28/2022, the original post by Ted Neward can no longer be found. However, the Internet Archive has recorded it for posterity. https://web.archive.org/web/20220823105749/http://blogs.tedneward.com/post/the-vietnam-of-computer-science/
Answer: It's still true.
Even more than OO software, the database suffers if it isn't treated precisely the way intended. And it wasn't intended that you should interpose some abstraction layer in front of it.
I think of impermeable abstraction layers as trying to build a Lego castle with all the pieces closed up into a pillowcase. SQL is damn hard to do correctly. It doesn't share many patterns with procedural programming, and best practices for one can be the opposite for the other. You need to be able to grok every single item in a SQL statement, and have a pretty good idea what it's intended to do, and what it in fact does.
Lots of people seem to think that, like horseshoes, close is good enough - if the right answer pops out, that implies you're nearly there. In SQL, that's simply not true.
RoR and the ActiveRecord pattern have deservedly earned a reputation as dbms resource hogs for this reason. Optimized ActiveRecord design is more often than not suboptimal SQL design, because it encourages SQL statement decomposition.
Comment: actually, SQL is dead easy to do.. if you know what you're doing. That can be said about every other technology though, so if you think its hard, you should not try to force it using an ORM, you just need to make friends with a DBA (who'll think procedural coding is impossibly hard :) )
Comment: There is rarely worse debugging and maintenance issues than having to look through some joker's chained-together lambda expressions which include joining, grouping, etc. When compared to debugging a stored procedure or even parameterized query it is a complete nightmare.
Comment: Yea - you're not a "developer" unless you know SQL
Comment: "SQL is damn hard to do correctly. It doesn't share many patterns with procedural programming": erm, isn't that the point of ORM? i.e. for procedural programmers who, for whatever reason, want to avoid getting involved with SQL? I'd hope the tradeoffs are known and deemed to be acceptable.
Comment: I know SQL, and yeah I don't really think it's that hard...(although it was hard to learn...once you've got it, it isn't that bad)
Comment: One of the most popular (.NET) ORMs suffers from SELECT N+1 straight out of the box
Answer: Yes.
Object-oriented is still object-oriented and Relational is still Set-oriented.  Nothing has changed in these two paradigms in the past two years to make them work better together.
In many people's eyes, SQL is ugly, complex, and confusing.  But trying to make an object-oriented interface to perform the same functionality is always uglier, more complex, and  has a steeper learning curve.
In all programming, there is a tradeoff between flexibility and assumptions.  Frameworks (such as Rails) try to solve the problem by being "opinionated."  That is, they limit flexibility of either the relational or the object-oriented aspects of the problem, making assumptions about how data is structured, and what operations you can do with it.  Naturally, simplifying the problem space makes the solution simpler as well.
In addition, it's frustrating to discover that an ORM framework is incomplete, so some ordinary operations in SQL have no solution in a given ORM.  This is also a consequence of "opinionated" frameworks.
Comment: According to ohloh.net, Hibernate consists of over 800,000 lines of Java and XML code (not counting comments, or other Hibernate-related tools).  Is this overhead really necessary, considering it's just as hard to use as SQL and doesn't really solve the problem any better?
Comment: "Naturally, simplifying the problem space makes the solution simpler as well."
- Bill Karwin

Gee Bill, thanks, I take comfort in that statement. :)
Comment: But wait a minute, doesn't a framework like Hibernate, support a record-set type thing (i.e. Projection Queries?)

And probably the reply I'm going to get at this point is, what's the point of using a framework when you have a projection-query that operates just like SQL considering the overhead.
Answer: A lot of web 2.0 companies are working on key-value stores. And all these companies have to go through the same painfull process of making it work.
If ORM is the "vietnam of computer science" then building your own key-value store is probably the "Iraq of computer science" :-)
Answer: I can only speak for my experience. I use DAL and DTO's, and I am still capable of performing pretty complex queries (joins and all), and also I am able to resort to SP's or custom SQL whenever I need. It made my life easier, my code consistent and my deadlines more attainable.
Comment: Just because you can do it, doesn't mean you should. You've ended up learning a whole nother paradigm, adding to the complexity, without replacing the other two.
Comment: I wouldn't try to imply that it can't be done - it obviously has been done. But painstakingly profiling a database is IMHO best done in the database; and thread-safety simply doesn't come up. BTW, I upvoted you. Your model is much more viable than ORMs, IMHO.
Comment: @le dorfier: My 8+ years of many successful projects using this approach is really the only validation I need, I was just trying to offer a different perspective. I don't believe I added complexity, but reasonable people can disagree.
Comment: Yes, and I think RoR is a useful framework. I wish it could have the isam it was designed for, instead of being mismatched with RDBMSs. Then you *could* use it for optimized persistence, for a net complexity gain. (Sometimes complexity is worth it; but it doesn't help to pretend it's not there.)
Comment: I wouldn't use RoR, or even Hibernate, they simply don't scale. Believe me, I painstakingly profiled, made it thread safe, and I can run heavy processes with it - without manually writing a single line of SQL.
Comment: @le dorfier: yes, by profiling I meant really looking the time it took to run the generated queries in the database itself, studying the execution plans, using parameters, etc. The multithreaded part is to allow many threads on client code to connect and run without interfering with each other.
Answer: I think starting from the assumption that Jeff's conclusions are correct is not necessarily good; having maintained stored procedure code as well as JDBC-based data layers, I can say that these caused maintenance problems galore, mostly related to the inability to understand what was going on at a higher level.
A database is necessarily low-level; it stores numbers and strings essentially.  Business logic is high-level.  This is why we have abstraction.
Personally, I think the Rails/ActiveRecord way is the best solution to having an object/domain model but also being able to take advantage of a relational database.
So: don't throw out ORM, but don't default to it either.  It's a tool that solves certain problems.  To ignore it would be ignorant and to always use it would be arrogant.
Answer: Jeffs article links through to Ted Newards article.  If you are into the details then you need to look there:

original - http://blogs.tedneward.com/post/the-vietnam-of-computer-science/
followup - http://blogs.tedneward.com/post/thoughts-on-vietnam-commentary/

Of Ted's original points I have it as:

1 was wrong (Identity)
2 of them solved (Partial objects and N + 1)
2 are debatable (Dual schema / shared schema).

Disclaimer: I'm the author of Ebean ORM so I'll reference that for the various 'solutions' to the issues raised.
Ted's original points (distilled because it's really wordy):
1. Partial Object problem.
Always solvable. Ebean ORM made partial objects fundemental to it's query language and all internals. JPQL didn't make this a priority to it's more a problem there unfortunately.

Refer: http://ebean-orm.github.io/docs/query/partialobjects

2. N + 1 (Ted's Load time paradox)
Always solvable. Should have been written as 1 + N / batchSize but it is more interesting than that (per path, need to take into account SQL paging, avoid sql cartesian product). Some ORM's make a right mess of this unfortunately and that brings ORM in general into disrepute. Some ORM's are ok until you hit a level of complexity (like OneToMany inside OneToMany inside OneToMany).

Refer: http://ebean-orm.github.io/docs/query/nplus1

Just to up the ante here ORM's can profile the object graph use and automatically optimise the query (only fetching what is needed, defining fetch paths to optimise for N + 1 etc).

Refer: http://ebean-orm.github.io/docs/query/autotune

This automatic ORM query optimisation idea came out of the University of Texas (using Hibernate). It was included as part of Ebean ORM in 2008 so it's been around for a while now.

Refer: https://en.wikipedia.org/wiki/AutoFetch

3. Identity
Ted cracks on about a mismatch on identity and concurrency. This point is misplaced as ORMs (well, all the ones I know) go about this aspect in exactly the same manor as the prior client/server tools and specifically ORM's are providing a SNAPSHOT view of part of the database to the application. There was never a problem here but ORM implementations could get themselves into strife with an over reliance on hashCode()/equals() for example.
4. Dual schema problem
This is debatable. If the organisation allows then the ORM can provide a DIFF/SQL script to the schema and that is run by FlywayDB/Liquibase etc. If organisations don't allow that this might still be an issue to some extent.
5. DB Refactoring / Shared schema
This is debatable. DB design/normalisation folks would argue that the DB design should get to 4NF and that means any refactoring should solely be additive (denormalisation, adding columns/tables) and not breaking changes. People who don't believe in normalisation will be going nuts worried about shared schema.
Answer: I think it does.
I think the last sentence is the most interesting of all: "I tend to err on the side of the database-as-model camp, because I think objects are overrated."  Java, C++, and C# are certainly the dominant languages, but functional programming is making a comeback with F#, Scala, etc.
Comment: Comeback - they've never been a dominant model before, so 'breakthrough' might be correct :D
Answer: This isn't my area of expertise, but I worked in Rails for about a year and I think ActiveRecord solved most of the DB Mapping problem.  I realize it has a few issues, but I think it did a fantastic job.
I don't think his post took into account the possibility of the framework itself (in this case AcitveRecord/Rails) defining the database AND the Object Model, which--as far as I can tell--makes the problem go away.
Since this is the opposite of the first two responses (basically that the post is outdated) I feel like I'm probably not understanding something; If that's the case please correct me instead of just voting me down because I think there is an important point I'm missing.
Comment: It doesn't make the problem go away, it gives the illusion the problem is solved but creating horrible performance and design limitations compared to using the full features of a database and SQL.

Pure object databases (which is essentially what you are talking about) never caught on.
Comment: ActiveRecord (the pattern, not the Rails implementation) is fine if you use it in the circumstances for which it's designed.  But there are a bunch of other data access patterns in Martin Fowler's PoEAA book, which seem to be ignored by Rails!
Comment: ++ Kendal.  The design of ActiveRecord naturally leads to terrible performance bottlenecks (the downside of wonderfully easy-to-use abstraction layers).
Comment: Interesting points, thank you.  Performance is often critical in database & web apps.  I'm not sure that an ActiveRecord type of implementation HAS to sacrifice performance, but from reports rails implementation problems, I'm guessing currently it's not too good.
Comment: Yeah, hold on... I doubt active record is the problem so much as Rails. Ruby itself is known to be slow (1.9 helps a lot) and Rails is also slow.
Comment: One of the neat advantages to any platform like this is that the platform can improve from under you.  There is nothing in the conceptual design of ActiveRecord that REQUIRES slowness, I'm pretty sure it's just the implementation--same with Ruby, it happens to be like 100x slower than c/java, but it's getting better.  I believe JRuby is now significantly faster than Ruby...  And also, performance doesn't matter in every environment.  Finally, it does perform better than you guys are implying.  http://www.genetree.com/ is in Ruby on Rails (I helped write it) and it's public & pretty quick.
Comment: 'Pure object databases (which is essentially what you are talking about) never caught on' - mostly because of the already massive investment in RDBMSes.
Answer: IMHO, Monadic approaches like Scala's Slick and Quill largely bypass the aforementioned quagmire, offering more robust solutions to many of Ted's problems (also JOOQ deserves to be mentioned). While they're not perfect, they definitely kill the N+1 and Partial Object problems, mostly kill the Identity problem, and partially kill the Dual Schema problem. Forget about clumsy and verbose CriteriaBuilder queries (anyone read "Execution in the Kingdom of Nouns???"), Scala's monadic for-comprehensions give you a simple DSL in which to write criteria-queries:
case class Person(id: Int, name: String, age: Int)
case class Contact(personId: Int, phone: String)

val query = for {
    p <- query[Person] if(p.id == 999)
    c <- query[Contact] if(c.personId == p.id)
  } yield {
    (p.name, c.phone)
  }

This kind of syntax stays sane, even for more complex queries e.g. Ted's is-acceptable-spouse query:
case class Person(name:String, spouse:Option[PersonId]) {
    isThisAnAccpetableSpouse(person:Person) {...}
}

val query = for {
    p1 <- people
    p2 <- people if (
        p1.spouse.isEmpty && p2.spouse.isEmpty
        && p1.isThisAnAccpetableSpouse(p2)
        && p1.isThisAnAccpetableSpouse(p1))
} yield (p1, p2)

All of this get's compiled into a single SELECT query and run against the database. Inserts, Updates, and Deletes are similar.
Comment: These are better called FRMs instead of ORMs. Functional Programming doesn't have the same paradigm disparity that Object Oriented Programming does... In fact, the Relational Paradigm is a subset of the Functional Paradigm. Hence why FRMs completely avoid the problems of ORMs. Honestly, the only true ORMs that are halfway decent use Function mechanics to realize some modicum of parity.
Answer: Disclosure: I'm the author of RDO.Net.
Yes. I believe existing ORMs are going in the wrong direction - they're trying to map relational data into arbitrary objects which IMHO is simply not possible. In the OO world, the arbitrary object is not serialization/deserialization friendly, because every object has an object reference (the address) that is local to the current process. It's OK when you're dealing with a single object, you will get into trouble when you're facing a complex object graph.
Hopefully this problem can be solved using a different approach, as in RDO.Net: instead of mapping relational data into arbitrary objects, we map the schema of the data as rich metadata (Model that contains columns, primary/foreign keys, validations, etc.), and expose concrete Db, DbTable, DbQuery and DataSet for data access. When performing database CRUD operations, you construct the SQL Abstract Syntax Tree (AST) explicitly using strongly typed OO language, as demonstrated in the following sample C# code, which creates a query and returns a DataSet for hierarchical data:
public async Task<DataSet<SalesOrderInfo>> GetSalesOrderInfoAsync(_Int32 salesOrderID, CancellationToken ct = default(CancellationToken))
{
    var result = CreateQuery((DbQueryBuilder builder, SalesOrderInfo _) =>
    {
        builder.From(SalesOrderHeader, out var o)
            .LeftJoin(Customer, o.FK_Customer, out var c)
            .LeftJoin(Address, o.FK_ShipToAddress, out var shipTo)
            .LeftJoin(Address, o.FK_BillToAddress, out var billTo)
            .AutoSelect()
            .AutoSelect(c, _.Customer)
            .AutoSelect(shipTo, _.ShipToAddress)
            .AutoSelect(billTo, _.BillToAddress)
            .Where(o.SalesOrderID == salesOrderID);
    });

    await result.CreateChildAsync(_ => _.SalesOrderDetails, (DbQueryBuilder builder, SalesOrderInfoDetail _) =>
    {
        builder.From(SalesOrderDetail, out var d)
            .LeftJoin(Product, d.FK_Product, out var p)
            .AutoSelect()
            .AutoSelect(p, _.Product)
            .OrderBy(d.SalesOrderDetailID);
    }, ct);

    return await result.ToDataSetAsync(ct);
}


How can I hide my texts when my screen is locked?

Question: I had that option before and the recent update messed all my settings up:( now I can't hide my texts. I don't want people at work seeing my texts. I have my phone locked but everyone still can read them. I also don't have the option hide preview which was there before!
Answer: In iOS 5, go to Settings > Notifications > Messages. Turn off 'View in Lock Screen'. It makes it so that iMessage/text message notifications don't show up on the lock screen.
Comment: I believe it actually says "Show Preview". So it should be Settings > Notification Center > Messages > Uncheck Show Preview


Can the coding strand for an RNA act as the template for another?

Question: Can the same strand of DNA act as a sense strand and an antisense strand at two different occasions of transcription and result in two different proteins?
Comment: Welcome to SE Biology. Please finish the [Tour] to learn more about how this site works. Could you clarify please. Are you only interested in total or partial usage of both strands for synthesizing proteins (partial being just overlap between the ends of ORFs with the opposite directionality, which is quite common in bacteria). And do you require that the two proteins to use the same reading frame (which I suspect would lead to frequent stop codons) or different ones? (And thanks for using sense and anti-sense, my own preferred terms.)
Answer: Yes, the DNA strand that is usually the sense strand, coding for the mRNA and protein sequence can also become the antisense strand if transcription happens in the reverse direction. This phenomenon called antisense transcription is a relatively recent discovery has been discovered to be quite pervasive in all types of organisms by sequencing all the transcripts in the cell, a method called transcriptomics.
Although the antisense transcript is usually a short non-coding RNA which plays regulatory roles influencing the stability of the sense transcript by it's complementary binding, in rare cases it can form a protein if it has the required site to initiate translation (ribosome bidding site) and the codons to make a protein.
Source - Pelechano, Vicent, and Lars M. Steinmetz. "Gene regulation by antisense transcription." Nature Reviews Genetics 14.12 (2013): 880-893.
Wikipedia - Antisense RNA
These old papers from 1994 talk about antisense proteins -
Do "antisense proteins" exist? J protein chem, 1994
Antisense overlapping open reading frames in genes from bacteria to humans Nucleic acids research, 1994


Eigenvalue physical meaning

Question: What is the physical significance of eigenvalues or eigenvectors?? Please try to explain in very simple language
simple  harmonic oscillator , potential  well
could  you  support  your answer by  examples
many  thanks.
Comment: That is *very* broad. Eigenvectors *of what*? Quantum mechanical operators, classical differential operator, inertia tensor...? The list of things that can have eigenvectors is quite long.
Answer: An eigenvector is simply a vector that is unaffected (to within a scalar value) by a transformation. Formally, an eigenvector is any vector $x$ such that for an operator $\Omega$, $\Omega x = \lambda x$ for some scalar constant $\lambda$. All operators of dimension $n$ have exactly $n$ eigenvectors/eigenvalues (though these are only all distinct if $\Omega$ is diagonalizable).
Eigenvectors (or really, eigen-things, as physics seems to love to slap the term "eigen" in front of any word it wants) show up everywhere. Generalizing the idea of an eigenvector to any thing that is affected only up to a scalar value by some operator, here are a few examples:

In math, the set of exponential functions (e.g. $n^x$) are the eigenfunctions of the differentiation operator, and $e^x$ is the eigenfunction with eigenvalue 1. You can use eigenvector/value completeness in the differentiation operator to prove Euler's identity, that $e^{i \theta} = \cos\theta + i \sin \theta$, and to prove that $e^x$ corresponds to its Taylor series.
In quantum mechanics, an "eigenstate" of an operator is a state that will yield a certain value when the operator is measured. The eigenvalues of each eigenstate correspond to the allowable values of the quantity being measured. For example, the energy eigenstates of an electron in a hydrogen atom (a simple harmonic oscillator), corresponding to energies of $E_n = -Ry/n^2$ will always give their corresponding energies if their energies are measured. However, a state composed of a linear combination of eigenstates, such as $\left| \psi \right>=\frac{1}{\sqrt{2}}\left|0\right>+\frac{1}{\sqrt{2}}\left|1\right>$ will give energies of either $E_0$ or $E_1$ with equal probabilities. In general, a state $\left| \psi \right>$ composed of a linear combination of eigenfunctions $\psi_n$ of any observable variable (energy, spin, momentum, etc.) given by
$$\left|\psi\right>=\sum_{n=0}^{N} a_n \left|\psi_n\right>$$
will always yield a measured value that is an eigenvalue of the observable, with the probability of each value being given by $a_n^2$.
Also in quantum mechanics, two observables generate an uncertainty principle if they do not commute - meaning that their matrix representations are not simultaneously diagonalizable, so they don't share a set of eigenvectors/eigenvalues. The most common example for this is the Heisenberg uncertainty principle, given by $\sigma x \cdot \sigma p \ge \frac{\hbar}{2}$, since $x$ and $p$ do not commute and thus do not share a set of common eigenstates. However, there are an infinite number of these corresponding uncertainty principles, each corresponding to some set of incompatible physical quantities.
Google's PageRank algorithm generates transition probabilities between webpages by looking at the number of links from each page to each other page, and makes a giant "matrix" from these values. The resulting eigenvectors and eigenvalues of this "operator" provide a very reliable metric for ranking pages by relevance and quality of content.
The first generations of airplanes were prone to disintegrate mid-flight due to a phenomenon called "flutter", which is when turbulence from air passing over the plane drives the plane at its natural resonance frequencies (the "eigenfrequencies", or vibrational modes, of the object). Modeling the aircraft and computing the eigenfrequencies allows engineers to modify the design accordingly, which usually involves using slightly different materials with nearly relatively prime resonant frequencies in key parts of the aircraft.

There are many other applications, but these are just a few that come to mind. Many problems across disciplines are actually eigenvalue problems in disguise.
Comment: If they commute is it necessary that they can be known simultaneously? I mean couldn't the standard deviation of the one be non-zero while the other be zero and still satisfy the uncertainty principle?
Answer: The meaning of eigenvalue and eigenvector (or eigenstate if you want) depends on what operator and what observables you are considering.
If the operator is now a Hamiltonian, the eigenvalue you get will be the energy of the system and the eigenvector tell you its "state".
So for the SHO system, the eigenvalue of the Hamiltonian is $(n+1/2)hf=E$ and $n$ depends on the system's quantum state. And the eigenvector in SHO is just the eigenstate, and in most case I think you can consider the linear combination of the vector as a wavefunction. That is, the eigenvector gives out about what its state, and usually will include some probability in its coefficient since we usually get more than one eigenvector.
And for the potential well, I take the infinite potential well for example:
If the operator is observable A now, the eigenvalue you get will be the possible outcome of A, and the eigenvector is the state corresponding to the outcome. While if you use Hamiltonian $H$ in the above case, you will get $E=(n\pi\hbar)^2/2ma^2$.
For all of the above case, I didn't use position or momentum for examples since you will find out these types of operator has no eigenfunction in Hilbert space if you didn't give it some kind of restrictions. And always note the wavedunction should live in Hilbert space.
And how to overcome the problems are another story, while I think the Hamiltonian is enough for you to understand the meaning of eigenvalue and eigenvector.

Eigenvalue physical meaning


Is It Okay To Use the Content of Scholars Or Hadith To Earn Money on Youtube?

Question: Is it okay to earn money by uploading the content of scholars like Molana Tariq Jameel Bayan or Noman Khan etc on Youtube Or Can I record a Hadith in my Voice by reading it from a book and earn from it through Youtube? And I believe that the Content of Scholars is not Copyright like on different Apps it's Available?
Comment: Please don't vandalize your own posts especially if somebody spent efforts to answer it!
Comment: Please don't ask questions related to Fiqh on this site as this is not a Fatwa site, anyone can answer here. Mostly, questions related to Qur'an and Hadith are welcome. For Fatwas from credible scholars take a look at https://islamqa.com
Answer: This is more like a juridicial issue. To keep it safe, I'd say send an e-mail to one of them in which you ask their permission to use their content.
But there are 4 main things to take into consideration when taking their content which is written in the Copyright Law of the USA and I think Youtube follows it too:
(1) the purpose and character of the use, including whether such use is of a
commercial nature or is for nonprofit educational purposes;
(2) the nature of the copyrighted work;
(3) the amount and substantiality of the portion used in relation to the copyrighted
work as a whole; and
(4) the effect of the use upon the potential market for or value of the copyrighted
work
Source:
https://www.copyright.gov/title17/title17.pdf
Comment: So you just cite a hadith. Why wouldn't it be allowed? You educate your audience. That's permissible and even encouraged both in Islam and western countried and Youtube's policy is fine with it.
Comment: Please accept the answer if it helped you.
Comment: Well on the first question I'd say yes of course you can make money with it.
Comment: Well I'd suggest as I said in my answer. You should send them an e-mail first in which you ask their permission to do so to avoid unnecessary conflicts.
Comment: But just look for answers yourself in hadith in works from Al Buchaari and Muslim for example.
Comment: Most people you mentioned took their knowledge from them.


Can Apple Butter be substituted for Apple Sauce in baking?

Question: Can Apple Butter be substituted for Apple Sauce (unavailable) in baking muffins?
Answer: You start with apples, cook them a bit and you have apple sauce.  Cook that sauce very slowly but for a long time and you get apple butter.
While I think the substitution would generally work, it most likely will be  sweeter. Sweeter because there's less water in apple butter vs. apple sauce thus concentrating the sugars.  Also the brown to dark brown color of apple butter is caramelization of the apple sugar.  That caramelization has to change the taste of your muffins.
Give it a try and see what happens.  Then make another batch with less sugar and see how they turn out.  If your recipe uses brown sugar try changing some or all for white sugar using the apple butter as a kind of substitute.  I suspect somewhere in those tests you'll find a batch that's great!
Answer: Without having tried it, but knowing and loving both apple butter and apple sauce, I would say yes, but you should understand that apple butter has been oxidized longer than Apple sauce and it may produce a more bitter product.
Comment: These is also the amount of moisture to take into consideration - usually apple butter is much thicker (like a jam or paste) while applesauce is kind of watery.
Comment: Apple butter also features quite a bit more sugar. It may be a workable replacement but you'd have to account for the added sweetness.
Comment: @Escoce Your answer would be even better if you edited some of those likely adjustments into it.
Comment: @djmadscribbler maybe...you are correct, but I think the moisture tied up in Apple fiber is not as bound to that fiber as other media. I think a tablespoon of applesauce and a tablespoon of Apple butter will yield approximate amounts of water. The dry components of Apple in general is very low.
Comment: As with anything, when you substitute and ingredient, there are almost always adjustments to be made.
Answer: I think it would be a fine substitution for making muffins because the sugar and moisture differences probably wouldn't be enough to throw off such a forgiving baked good. The flavor might be a bit different, but that could be good. I would not swap it in a more delicate pastry, but they probably wouldn't be made with applesauce anyway.
Answer: Late to the party here, but I would suggest that it could work IF you recognize that apple butter (at least the homemade kind) has been cooked longer to concentrate it and remove some of the moisture. In addition, it will have been sweetened more than applesauce (especially if the recipe calls for unsweetened applesauuce) and will also have added spices.
So...
If you substitute, take these adjustments into account: reduce the amount of spices in the recipe (you can taste your apple butter to check on what spices predominate in yours), cut the sugar by about a fourth or a third, and, if the batter seems very thick, add a teaspoon or so of water or whatever liquid is in your recipe.


How do I rename multiple files?

Question: I have several files in the same folder that have one element in common in the names.  How do I rename the files so that the common element in the names is deleted?
Comment: Use one of the text listing commands and copy/paste the text to your question.  This will make it easier for us to text the text against the commands provided. you can get a text listing with commands such as `ls` or better `ls -1`.
Comment: If you google "ubuntu bulk rename", you'll find many other related questions.
Answer: You could use rename
rename -n 's/\(U\)//' *.bin

This will delete the "(U)" part of the file name from all .bin files.
If you are happy with changes that rename will make then take out the "-n" option which is No Action, that only shows what files would have been renamed.
Answer: The way I always do it: Thunar bulk rename.
Install Thunar:
sudo apt install thunar

Now open bulk rename (if you're using basic 16.04 version, just go to dash home and type bulk: you'll get it.)
Options are pretty obvious from there.
I know, I know, some geek will tell me I should have done it from the command line.  And that's doable too, but you'd need to be a bit more specific on exactly what you want to get a specific command.

How do I rename multiple files?


In ST:TNG's "The Survivors" why wasn't Kevin Uxbridge able to stop the Husnock attack?

Question: Kevin's moral code prevented taking deadly action. However, a being of such power as him surely could have taken actions that would have ended the attack without killing or injuring any Husnock. As an "immortal being of disguises and false surroundings" he probably could have made it appear to the Husnock that the entire planet was no longer there, or other appropriate illusion to cause them to stop the attack and leave.
Answer: This was explicitly addressed in the episode; The relevant conversation:

CRUSHER: You had the power to stop them but you didn't?
  KEVIN: I refused to for the same reason I refused to stop the Enterprise. I will not kill.
  PICARD: So you let the colonists fight a hopeless battle.
  KEVIN: I tried to fool the Husnock as I tried to fool you. It only made them angrier. More cruel.

(Emphasis by me)
As you can see, he tried to use his abilities to prevent the genocide, but the Husnock didn't buy his tricks (just as Picard didn't). So it appears he's not very good at deception on such a large scale.
Comment: @Morgan: It's a difference to have a general moral standard to do no harm and to have a knee jerk reaction triggered by a traumatic event. In a second of rage over the death of his wife, he wiped them out, yes. But he could still have refused to kill when thinking rationally.
Comment: @Morgan While he's possibly closer to Q than to humans, but there's at least a couple of key powers that he doesn't have that the Q do. He's clearly unable to properly bring people back from the dead. Otherwise he could just restore the whole Husnock race and his dead wife, something the Q could likely do. He was only able to bring back an illusion of his dead wife that ceased to be when he stopped maintaining it. And he clearly doesn't have the ability to time travel as the Q can. You can't find more because all we know about them is in that one episode.
Comment: That explanation by Kevin is a bit suspect to me. It's possible that he's deceiving Crusher for some unknown reason. Considering that he committed genocide of the entire Husnock race, it's obvious that he would kill.
Comment: I hear what you're saying @bitmask but it's been my understanding that those with general moral standards don't commit genocide and kill "all Husnock, everywhere". It forces me to wonder if he's done such a thing before when he 'got mad'. His power seems to potentially approach 'Q' levels. Would like to get some back-story on that race but can't find much beyond; 'They're an extragalactic species made of pure energy, self-described as "immortal beings of disguises and false surroundings" and have the ability to create and destroy on an epic scale.'  http://en.memory-alpha.org/wiki/Douwd


How do you manage multiple currencies in Ledger CLI?

Question: I've been using Ledger CLI for years. It works fine, but I'm sure I use only the tiniest fraction of its power. Every now and then, during the holidays, for example, I try to learn a little more about it. I was recently exploring the tools for displaying balances. I noticed a bit of weirdness and I tracked it down to a series of transactions from a few years ago like these:
02/13 Some Hotel in Prague
    Assets:Reimbursements:Employer            7560.00 CZK
    Liabilities:CreditCard                   $-332.18

02/13 Some Restaurant in Prague
    Assets:Reimbursements:Employer             632.00 CZK
    Liabilities:CreditCard                    $-27.71

These are business expenses from a trip to Prague. I've put in both the CZK and USD currency amounts so that the credit card will balance properly.
Now I get my expense reimbursement:
02/28 Employer
    Assets:Checking                          $2359.91
    Income:Salary                           $-2000.00
    Assets:Reimbursements:Employer           $-359.91

That's fine, as far as it goes, but when I look at the balances, there's a large outstanding CZK figure because that's not accounted for, I guess. Fiddling with trying to put the CZK amounts in the reimbursement lead to different errors about unbalanced remainders. (In the real case this is taken from, there are also transactions in GBP as it happens.)
Should I be doing something else in the ledger to make this balance properly across currencies? I suppose I could just put in the expenses in USD and mark the CZK amounts in a comment, but it seems cleaner to record the actual expense amount from the bill.
Answer: Here's the way to balance those, I believe:
02/13 Some Hotel in Prague
    Assets:Reimbursements:Employer            7560.00 CZK
    Liabilities:CreditCard                   $-332.18
    Equity:Conversion                        -7560.00 CZK
    Equity:Conversion                        $ 332.18

More discussion


Driving a boot selection pin with a GPIO pin

Question: I am trying to make a very small change to a circuit to allow for boot mode selection using two boot pins. The component I am trying to control is the STM32F411. One of the pins can be floating in regular boot mode, and driven to ground in the other, therefore I am planning to just simply have it be connected to ground permanently since this will allow for both boot modes to be entered. The other pin varies between high and low for the two boot modes, and is currently being driven low with a pull down resistor (I'm trying to change this). Now here is my question: my limited knowledge of electronics would suggest that it is possible to drive this second pin using a GPIO output from another device, say for example a Raspberry PI. The low level voltage needed is <= 0.43V and the high level voltage is >= 1.261V, therefore if you have a GPIO with a high level voltage of 3.3V, and a low level voltage of 0, it should be able to control the boot pin. Is my thinking correct? Do I need any other components to make this work? I would like the pin to be driven low by default at boot, suggesting it's not as simple as connecting the two pins together and using software to control the output of the pin. Thank you
Comment: Welcome to EE.SE!  You will have a better chance of getting an answer if you 1.) break your wall of text into separate paragraphs and 2.) provided a schematic of a circuit you have in mind.
Comment: @SolveEtCoagula07 Thanks :) I'll keep that in mind for future questions.
Comment: Actually, you don't even need to wait for future questions; there's an edit button!
Answer: Your thinking is correct. If you want the pin to be driven low by default then add a pulldown resistor from the pin to ground, something from 5k\$\Omega\$ and 10k\$\Omega\$. It's often the case that a processor's I/O pins wake up in input mode. I don't know if that's true for the Raspberry Pi, but if it is then the pulldown resistor will give you the default low value you want. The value of the resistor needs to be high enough that the Pi's I/O pin can easily overdrive it.
Comment: Awesome thanks! If the default state of the pin is input, would I still need to add the resistor?
Comment: If the default state of the pin that is **driving** the STM32 is input then you most certainly need the pulldown....you don't want the state of the STM32 pin to be undefined when the system wakes up. If you are not sure that the Raspberry Pi will be driving the correct value to the STM32 at the instant when power comes up, add a pulldown resistor.


XDM display manager builds but does not run

Question: I'm trying to modify the X display manager (xdm) source code in order to use it for a special purpose. However when I build and install it, it does not run and I end up getting the non-X login prompt. It does not print anything to the logs either. Is there anything special that I need to do to get it working?
Answer: The display manager that runs by default on Raspbian is lightdm, and it is started by init.  For wheezy's SysV style init, this is via /etc/init.d/lightdm, which is linked into the various /etc/rc[N].d directories.  To undo that, use sudo update-rc.d disable lightdm 2 3 4 5.  Raspbian jessie switched to systemd for init, and I'm not sure what the name of the lightdm service is there, but you could find it with systemctl list-units | grep -i lightdm.  If it's not there, it might be using a backward compatible mechanism, so look in the rc.d directories and try the update-rc.d method.
To start xdm, you'll have to add your own init script/service.  At least for testing purposes though, you can probably stick it in the end of /etc/rc.local.


React Native error: Raw " " must be wrapped in an explicit  Component

Question:
Hi, I am having this error in react native and cannot figure out what is causing it. Help would be greatly appreciated.
Thank you
Answer: The issue is whitespace. Using tabs however does not count as whitespace. Try removing the space between the tag and the comment in lines 32 and 37.
<View> {/*green*/}

should be either
<View>{/*green*/}

or
<View>
    {/*green*/}

Comment: Worked! Thanks for the detailed explanation!
Answer: I encountered a similar error when checking whether to render a component in the following manner:
{somevariable && <Text>abcd</Text>}

Whenever somevariable was 0, that somevariable would be interpreted as something that was supposed to be rendered and thus 0 is an invalid React Element.  To resolve this, I made sure that the first expression always evaluated to a boolean.
{!!somevariable && <Text>abcd</Text>}

Comment: Do you know why this happens?
Answer: You need to remove whitespace between tag. Take a look at each or put show whitespace in webstorm Preferences | Editor | General | Appearance
Comment: Worked! Thanks alot!!
Answer: I also encounter this error, but in my case I accidentally modified / auto formatted some .js files and messed up the JSX. And I cannot easily trace the source of the JSX component I messed up. The way I solved my problem surprisingly is to delete the node_module folder and reinstall all the node packages by npm install at the root folder of your project.
Answer: I have already solved the problem, the answer is need to add a space:
 <View style={{width:40, height:40, backgroundColor:"green", margin:5}}>
                    <Text style={{fontSize:18}}>格子{this.state.size1}</Text>
                </View>

not
格子{this.state.size1}
Answer: On latest releases, you can try the following,
getting stack traces


How to remove list-help header from transactional emails

Question: Setting send classification transactional generates an email that includes list-help header that links subscription center page. I do not want this header in my email. How can I remove it?
Answer: I noticed this as well.
tl;dr:
It cannot be removed.
This was introduced in this release: https://help.salesforce.com/s/articleView?id=sf.mc_rn_january_2021_es_one_click_unsub1.htm&type=5
...where Salesforce introduced the http header, not just the reply based header for list-unsubscribe. They state it is for commercial emails.
Contrary to what the release notes say, this WAS implemented also in Transactional emails, which results in having an unsubcription header where it "does not belong" (after all, transactional emails cannot be unsubscribed from).
The linked documentation in the above release note states the opposite (it IS in transactional emails) and discusses that this cannot be changed:
https://help.salesforce.com/s/articleView?id=sf.mc_es_one_click_header_unsubscribe.htm&type=5

NOTE Because Request for Comments (RFC) 8058 regulations for one-click unsubscribe require acceptance of POST requests, our List-Unsubscribe headers can't be disabled or altered. Directing one-click unsubscribes to landing pages deviates from RFC 8058 regulations and isn't supported.

...and describes a "fig leaf" (my interpretation) explanation why this would be useful:

List-Help Header for Transactional Emails

Marketing Cloud includes the List-Help header in transactional classification emails. If the subscriber can't determine who is sending the email and why from the body of an email, they can use the link in the List-Help header. The List-Help header allows the subscriber to view the Subscription Center page, which includes details about the sender and their sending policies.


What is Venus's core made of?

Question: As we all know Venus's surface is so hot that it can probably melt lead.
What would be in it's in core?
Is it in the liquid or solid state?
What would be it's temperature?
How many cores does it have?
Comment: Did you do any prior research? The Wikipedia article and many other search results rather clearly state that little certain information is known about Venus internal structure.
Comment: Although you say the wikipedia article wasn't helpful, you have accepted an answer which is based on it.  I googled your title and found several other relevant sites.  If you want the latest information, your best bet is probably the NASA  website, or SkyAndTelescope, space.com, UniverseToday or AstronomyNow.
Comment: yea, i actually was searching on internet about venus core .
din't find any required information there.
wanted to know if there is any new update or additional information i can get here.
Comment: can i have any particular web links ?
Comment: @NaniHari, just google NASA and the NASA website will be the first thing that comes up. Same with the others.
Answer: Scientists think that Venus' internal structure is somewhat like Earth's, as shown below:

In other words, a crust, mantle, and core. The evidence points to Venus not having plate tectonics like Earth or a magnetic field. Venus also probably has a partially molten core, like Earth, as it has been cooling at the same rate.
Honestly, we don't know much else. We can tell you the atmosphere composition, but we don't know what the core is made up of. The Venus Wikipedia page (here) is very helpful and has more information and explanations of why we don't know these things.
Comment: What scientists think this?  The only indirect thing we know about Venus' core is that it does not have a net magnetization (i.e., Venus has no intrinsic magnetic field).  This leads to several questions and ideas, but I cannot see them leading to Venus having a similar core to that of Earth (i.e., a nickel-iron molten core would likely generate a net magnetic field through a dynamo effect, like what occurs within Earth).  Also, there is recent evidence that Venus is volcanic, so the tectonic remark may not be accurate.
Comment: @honeste_vivere, I got pretty much all of my facts from [this website](https://en.m.wikipedia.org/wiki/Venus#Internal_structure) and it seems that they are pretty well accepted.
Answer: Venus's Mass is roughly $.815 M_e$. So it would not be unorthodox to hypothesize that it is molten, which is supported by the volcanoes on its surface. It probably has a solid molten metal core like ours, with a smaller mantle and the solid core region, with the core being smaller in proportion to the mantle then our core to mantle ratio.
Answer: Venus core is probably made of iron and nickel. With a sprinkle of other elements. Also some radioactive elements might provide some heat in Venus' core. Its inner core might be solid but its outer core might be liquid. However the outer core will not be as fluid as here on Earth because of Venus's slow rotation. This is why Venus does not have a magnetic field. Venus's slow rotation is not able to make Venus's core create a magnetic field.

What is Venus's core made of?


DB4O with Silverlight RIA Services

Question: I've considered using the db4o OODBMS with a recent Silverlight / RIA Services project, but there's one point that I could use some advice on - how to make associations work.  RIA Services requires that you mark all of your associated entities with an AssociationAttribute.  The AssociationAttribute's constructer requires that you specify your entity's key to the associated entity, and the key of the associated entity itself.
As an example, imagine that I have a Racer class with CarID and Car properties, and a Car class with an ID property.  My Racer class would look something like this:
<code>class Racer
{
    public int ID { get; set; }
    public int? CarID { get; set; }
    [Association("Racer_Car", "CarID", "ID")]
    public Car Car { get; set; }
}
</code>
The problem that I see with using db4o (or any OODBMS) is that foreign keys and primary keys do not, and need not, exist - and the result is that I wouldn't need the Racer.CarID and Car.ID properties.  To make this work with RIA Services, I would need to create my own unique keys, which I don't mind, I just don't know the best way to go about doing so.
So my question for you is "how would you create these keys/IDs"?
Since there isn't any concept of an auto incrementing generated field (none that I'm aware of any way), I would have to choose between trying to manually, safely increment the keys, or use something like a Guid. Since the former would be more difficult to manage with multiple users and/or multithreading, I'd imagine that using a Guid would be the simplest solution.
So let's consider using a Guid.  The easiest solution would be to create my ID properties, just as I had within the example above, but use a Guid instead of int. I would need to set the ID to a new Guid after creating new entities - then, whenever I set the the Racer.Car property, I would also need to set the Racer.CarID.
Doing that by hand would be prone to error, so I'd want a lot of that handled in the property getters and setters, but I'm not sure of the best way to implement that.

That's what I've thought of so far. I think I'll look into how the Linq-to-SQL generated code handles some of these concerns - maybe I'll find a clue there.
Any suggestions would be greatly appreciated.
Thanks,
-Charles
Answer: Db4o does use IDs and UUIDs internally and it is possible to use those. Also worth reading is this.

DB4O with Silverlight RIA Services


MSTest code coverage file is too big, How to selectively generate code coverage

Question: I have  an MSTest code coverage setup in my visual studio project. However, when the code coverage runs, it generates a coverage file (data. coverage) that is too big. The reason being it scans for all the dlls, third party libraries. My project has some C++ solution and it generates code coverage for all the methods in the header files. Note that in my testsetting (local.testsettings, which is the currently active one) I have selected only a single xyz.dll (the one I want to get code coverage). However, the final code coverage contains code coverage information which xyz.dll depends on. How to configure, MSTest such that I don't get code coverage beyond the boundaries of xyz.dll?
Note: Having a big data.coverage file cause issues when I try to generate xml reports using Hudson emma plugging. The final xml is about 750MB
Answer: How a test coverage tool represents the data it records (probe locations, probe hits) obviously makes a difference in manageability of the collected test coverage data.
I can't speak to how MS encodes this data, but it is clear you aren't happy with the result.
 I will agree that 750Mb of output seems a bit over the top.
It may be the problem is you are simply getting every method/function instrumented when you
only want the DLL instrumented.   I suggest you look for a switch to control what is instrumented.  I can't help you further with the MS tool.
Our C++ Test Coverage will let you specify just the files you want instrumented.  It does produce a probe location file with one entry per probe, but its size is proportional to the amount of code instrumented, and it isn't a bulky XML file.  A million lines of instrumented code produces a probe location file of a few megabytes.  At execution time, you produce probe hit data; that exported is measured in bytes plural barely for each probe in the worst case, and is much smaller if your coverage is low or high.   For the same million lines, I'd expect this to be another megabyte.
It is likely a bit more effort to configure our tool to instrument a DLL; MS has the advantage of controlling the compiler and we do not.   That seems like a small price to get a usable answer.


MasterPage in children subsite

Question: Can I change master page only in subsite without selecting "Specify a master page to be used by this site and all sites that inherit from it:" in "Site Settings" -> "Look and feel" -> "Master Page"?
Comment: Just so you know, Site Settings->Look and Feel -> Master page only affects subsites created after you make the change.  You have to tick the "Reset all subsites" box in order to force existing subsites to use the new master page selection.
Answer: Yes, you can through one of the below methods.

Using SharePoint PowerShell
$web = Get-SPWeb siteurl
$web.MasterUrl = "masterpagerelativeurl"
$web.Update()
$web.Dispose()

Using SharePoint Designer,

Open your Site using SharePoint Designer.
Go to MaterPage section in the left side> Right Click on your Master Page > Select Set Master Page as Default

MasterPage in children subsite


2-Deoxy-D-arabinohexose, 2-Deoxyglucose

Question: Aldrich says that these two names are synonyms of one another.  Does anyone know the etymology of arabinohexose used in this context?
Answer: Actually arabinohexose got its name from the family of six carbon membered mono saccharide(i.e. aldohexose) and the first name arabinose is taken from the another popular name i.e. gum arabica because it was first extracted from it!
Comment: But if you look at the nomenclature of aldoses https://en.wikipedia.org/wiki/Monosaccharide_nomenclature arabinose has five carbons https://en.wikipedia.org/wiki/Arabinose and glucose has six.  Do you have a reference for your statement "[a]ctually arabinohexose got its name from ..."
Comment: In the statement you've replied you wrote about arabinose and actually you were asking for arabinohexose
Comment: OK.  Can you give me the link for arabinohexose please?
Comment: Sir, actually I have not copied it from somewhere rather i'd combined contents from internet and my knowledge of etymology. That's why I can't give you a exact link. I hope you understand!
Answer: D-glucose (a hexose) is a C6, normal (straight) chain aldehyde (in its non-cyclized form) bearing a hydroxyl group at each carbon (C2-C6) in a unique spatial arrangement at C2-C5. 2-Deoxyglucose is missing the hydroxyl group at C2. D-Arabinose is a pentose (C5) that has the same absolute configuration at C2-C4 as 2-deoxyglucose does at C3-C5. The prefix arabino refers to the configurations in 2-deoxyglucose. "Hex" means six carbons. "Ose" is the suffix for a sugar.

2-Deoxy-D-arabinohexose, 2-Deoxyglucose


Is it appropriate for a class to only be a collection of information with no logic?

Question: Say I have a class Person that has instance variables age, weight, and height, and another class Fruit that has instance variables sugarContent and texture. The Person class has no methods save setters and getters, while the Fruit class has both setters and getters and logic methods like calculateSweetness. Is the Fruit class the type of class that is better practice than the Person class. What I mean by this is that the Person class seems like it doesn't have much purpose; it exists solely to organize data, while the Fruit class organizes data and actually contains methods for logic.
Comment: So, a Person has setters for height, weight and/or height, right? Setters would be pointless unless there is logic that manipulates these attributes somewhere. Is that logic in a correct class?
Comment: @COMEFROM: you are right, that is the question to be asked here. However, in information systems it is not uncommon that the whole purpose of some attributes is that they are stored, shown and reported in that system, without any real logic (business processes actually using that attributes may exist outside of the information system).
Comment: @Doc Brown: I know and I agree. I don't see anything wrong with classes without logic but having setters in such class is somewhat suspicious. I would check where these setters are needed. Like you wrote: add functionalities to a class when needed. A setter is a functionality.
Answer: If your person is actually not doing anything, then there is no need to have any actions on it. It is possible to have classes which only collects data and then there will be classes which operates on this data. In your case, it may be possible that you do not have any action on single person, but there may be action on group of persons, like CalculateAverageHeight(). In this case it makes sense to have only Person without action and then have another class (may be friend) which works on this.
Comment: I wouldn't say it was "common" to split your data and logic into different classes in a properly-designed OOP system.  For your example, I would expect `CalculateAverageHeight()` to be a static method on `Person` which takes a collection of `Person` objects.  That way, even though `CalculateAverageHeight()` isn't applicable to an individual instance of `Person`, you are still keeping it close to the data it operates on.
Comment: @TMN - Sorry for the common word. It is not common, but possible. I disagree that Calculation of average height is closely related to the person class. Consider another function HighDensityArea(), which finds out which is the area in which most of the population resides. This function only needs the address field of the person. There is no need for binding this closely with the Person class.
Answer: It is difficult to come with a rule saying all classes must have some logic. In general classes without any logic are considered to be  AnemicDomainModel.
Even then, it is better to organize data if the related information is getting large. For example in this case you may still need a collection of Person than many unrelated collections.
Comment: I don't think this (AnemicDomainModel) is always true *just* because you have no logic. In fact, I think that many basic Entity types are just this: a collection of information all related to one particular object, but without any particular logic connected with it. A Person just ... is, yet it would be hard to argue you shouldn't have a class to represent a Person.
Comment: You could also have implemented the [command design pattern](http://en.wikipedia.org/wiki/Command_pattern)
Comment: @ Peter Rowell : The Entity (bean) from J2EE gets special mention in the article.
Comment: A good working definition of Anemic Domain Model is a domain where business rules must exist to enforce data integrity within an object, *but those rules are not encapsulated within the same object*. If an object doesn't *need* logic to maintain an internally consistent state, such as a Money pattern, then it shouldn't *have* said logic. However, if an Invoice has a Subtotal data property that should always be the sum of its line items' Extended Costs (each of which is in turn Unit Price * Quantity), then those properties should be calculated and not directly settable.
Comment: If you have many classes that are like this you have a problem.  However, sometimes you simply want to organize some data items but there are no methods that don't make more sense elsewhere.
Comment: I really liked that article.  He says, "the problem with anemic domain models is that they incur all of the costs of a domain model, without yielding any of the benefits".  Can anyone point me to the article where he lists the benefits of a domain model? He kind of hand waved that as a given in this article.
Answer: The DataTransferObject is a good example of a class that has no logic, only data.  That's its purpose, though; it's explicitly an exception to the general rule that all classes should implement the business logic that  affects their internal state.  Having a class whose internal state is changed by external logic is often a design smell.  It's not always wrong, but it's almost always something that you should consider refactoring.
Answer: Reverse the question, look at the other end. If you have a collection of information that obviously belongs together, should you keep it apart just because there are no methods which you could add to that class? Should you be forced to invent arbitrary methods just to justify the class?
Answer: Models are no end to themselves - you should add functionalities to a class when you really need them in your program, not on guessing that you will need them probably in the future. So its natural that at one point in time you have classes with no "real" methods, and later, when you determine that it makes sense to add methods to the class, you do exactly that. The quality of a model is not measured by "do I have methods here and no methods there" - the quality is measured by "do I have all the methods my application actually needs in there".
For example, when your application in version 1.0  needs something like calculateSweetness for a Fruit, but does no operations on a Person except getting and setting the attributes, then your model should exactly reflect that by not having any logic in the class Person. In version 2.0, it may make sense to add some logic to a Person too, so when you are at that point, add the methods in question.
Answer: I think this depend on the language and how you are using the language.
In the trivial case some languages insist on everything being in a class, so e.g. collections of constants have to go into a class which then may or may not have any logic, in other languages they might end up in a namespace instead.
In multi-paradigm languages it can also depend on what paradigm you want your design to adhere to. Borrowing the example of CalculateAverageHeight(), as is it probably should reside in a PersonCollection class, however that presupposes an OOP solution. in a more Functional design you might use a higher order function with a generic collection, e.g. in C#
List<Person> personList = GetListOfPeople();
personlist.Average(p => p.Height);

and then the logic is not in PersonCollection or even statically in Person. Indeed higher order functions and generic data types in general mean you are more likely to end up with objects that are just bags of data, as the logic is operating at a higher level of abstraction then your specific data model.
Answer: It sounds like what you are talking about is a POD (plain old data).  Different languages can represent these in different ways - it could be a class with public members for instance, or a struct with only public members in C++.
Organising data is a perfectly valid reason for a class to exist - it can often make code cleaner and easier to read.  std::pair in C++'s STL is a good example of a structure that exists solely to organise data - simply a struct that holds two values of any type named first and second.  Probably one the most useful classes in the entire STL (in my opinion anyways :) )


In Pokemon Go, will aiming for the highest IV give the highest CP as well?

Question: It seems at first to me that, if a Dratini only has a CP of 10, but has the semi-circle bar possible going to a possible maximum of 500, then it will be better than a Dratini that has a CP of 390 but is already near the max.
But it seems that many people go for the highest IV.  When I looked at some gyms, people have CP values of 3000 or so.
So, does that mean I should go for the highest IV or CP?  Or since most people aim for the highest IV, it seems, will that result in a highest possible CP as well?
Answer: Maximum CP is determined by both IV and trainer level.
Since trainer level is the same for all of a given trainer's Pokemon, a trainer can choose to look at only IVs instead when determining which of their pokemon have the highest potential.
Answer: To give you a quick guide/answer, if you want to start battling now and don't plan on powering up any of the pokemon you're going to use, prioritize:

CP
Moveset
IVs

If you're going to power up a pokemon and stick with it, prioritize:

Moveset
IVs
CP

and you can even argue that CP is irrelevant on a pokemon you plan on powering up since that will increase.
Some movesets are better than others depending on whether or not you're attacking/defending and what the purpose of your pokemon in the lineup is. That's beyond the scope of this answer.

Explanation on why:
IV determines the max possible CP but doesn't necessarily mean a pokemon will do more damage at a certain level. In fact, you could have two pokemon with equal CPs and the one with lower IVs could possibly do more damage because of the way damage is calculated (it's affected by pokemon level, which means the higher IV pokemon will be a lower level because it doesn't require as many levels to reach the same CP as the lower IV pokemon).
There are some complicated mechanics involved...but to actually answer your question usefully:
Aim for the highest CP while you're not powering up any of your pokemon. IV doesn't matter (or, doesn't matter in any significant way) if you're not powering them up. If you decide to stick with a pokemon, then you can consider its IVs. Its current CP won't matter because you're just going to level it up anyway.
Oft overlooked by some people who just hear that perfect IVs are king is the fact that moveset is significantly more important than IV%. Some poor movesets do as low as 60-70% of the damage an optimal moveset does. Since IVs only account for 10% of total possible CP at max level, an optimal moveset is often far more important than the IV%.


Evolution Calender event not showing in panel date menu

Question: I have entered an event in Evolution but it is not showing in panel's date menu. Also I have selected Monthly calender and Coming events from Evolution Calender in System Settings > Time & Date > Clock tab
Answer: What version of Evolution are you using? For me in 14.04 LTS the Software Center shows 3.10.4-0ubuntu2. (Although there is a newer one available). I needed from optional add-ons:

Standard plugins for evolution (evolution-plugins)
GNOME panel indicator applet for Evolution (evolution-indicator)

sudo apt-get install evolution-indicator
sudo apt-get install evolution-plugins
And in Evolution>Edit>Plugins>Enable Both.
If you use Google Calenders, then there is a as well a workaround without need of Evolution:
http://helpdeskgeek.com/linux-tips/view-your-google-calendar-events-in-the-ubuntu-unity-panel/
http://www.webupd8.org/2012/02/calendar-indicator-displays-google.html
sudo add-apt-repository ppa:atareao/atareao
sudo apt-get update
sudo apt-get install calendar-indicator


How do I support large tab bar previews in iOS 11?

Question: In some of Apple's apps like Photos in iOS 11 if you hold down on a tab bar icon while your phone is in landscape and you have the larger accessibility size Dynamic Text turned on a large preview of the tab you are holding appearing. How do I support this in my app? Is it a new API or do I have to build it myself?
Answer: You can use PDF image assets and get large tab bar preview behavior for free.
Check the "Preserve Vector Data" button in the attributes inspector for the PDF image asset.
https://developer.apple.com/videos/play/wwdc2017/204/
Answer: The new property is:
<code>// Higher-resolution version of the standard image. Default is nil. Used for rendering assistive UI (e.g. for users with visual impairments who need large text). If not provided, the system may attempt to generate an image based on the standard image (for instance, by rasterizing matching PDF representations at a higher resolution).
@property(nullable, nonatomic, strong) UIImage *largeContentSizeImage API_AVAILABLE(ios(11.0));
</code>
Which is on UIBarItem (which UITabBarItem inherits from). I've left the comment in from the header file as it's relevant.
It's also possible to set this under the 'accessibility' property in Interface Builder.


Does converting an image count as executing it

Question: I'm talking about user uploaded images. These images might be unsafe and may even contain scripts and such. I was told that as long as I don't execute the image, I should be fine. What exactly counts as executing an image? If the user uploads a .png and I need to convert it to .jpg first before displaying it, does this conversion count as executing the image.
Answer: If you e.g. use some library to work with the library, then the only way for that to be a security risk is an issue with the library itself. E.g. if there is a buffer overflow security issue in the library, a mere process of reading the image could potentially make it execute the code conveniently hidden in the image (i.e. image would not be the image anymore, it will be turned into code).
If you use standard libraries, chances for such security holes are rather slim. Not zero, though, but I guess you would have to live either with that or not looking at any digital picture in your life again.
Answer: Provided that the tool used to convert the image isn't vulnerable to any exploits, the act of converting it does not involve executing it.
Answer: You can trust the image conversion process if you like, but as others have said, the risk exists that simply processing the data could leave you vulnerable.  You can take other steps to isolate the image processing step if it is critical.
You could put that step on a separate machine, so that a compromise doesn't put the malicious code on the server communicating with the public.  You could  also run that process as another user, so that an exploit would have to escalate privileges in order to compromise your service.


Stripped Threads in Hyrdo Boost

Question: From the pictures above, I have a hydroboost that I need to attach a hose/line to. The problem is that when trying to screw in the bolt with just my fingers, I get a little bit of resistance, and the bolt pops out. To me, the bolt looked slightly damaged, so I went ahead and got a new line since it seemed like the threads in the hole were fine. I am still have the same issue however. Is there anyway for me to get past this? Is it possible for me to rethread the hole while still keeping the same size? I would like to refrain from getting a new hydroboost unit all together. Thanks
Comment: If I'm not mistaken, those are tapered pipe threads. The male fitting is a little narrower at the tip and broadens to matching female threads for a pressure proof seal along with O-ring. These aluminum fittings require some finesse, aligning the fitting  perfectly when hand threading while pressing the fitting on. If you can,  carefully remove the O-ring and clean debris on both fittings. Put the O-ring back on, lube the fitting and align the fitting perfectly while screwing on the nut into its female mating hole. You may have to use a wrench to continue threading.
Answer: Top thread in the hole were stripped. Using a tap for the same hole and thread size cut out any deformed threads that were blocking the threads on the bolt. Can use some teflon tape on the fitting if there is a leak afterwards.

Stripped Threads in Hyrdo Boost


Not receiving Text Messages after upgrade to iOS 7

Question: Upgraded both iphone5s to ios7 approx two weeks back. Suddenly last Thurdays I cannot receive his texts. Phone calls and FaceTime yes. Texts no. He can receive texts from me. Any ideas?
Comment: http://support.apple.com/kb/TS2755?viewlocale=en_US&locale=en_US This place is here to help anyone that may have problems with their Apple products (software and hardware), but we do expect detailed questions. A lot of us take the time to help those that need it. We simply ask that you respect our time and include details that would help us do that. This also helps us better help you. You should try the troubleshooting tips in the link I provided. If nothing works, please edit your post to include more details (and what you have tried to fix the problem).
Answer: I had something similar. To fix it, go to the Settings app, then General, then scroll down all the way to the bottom and tap Reset.

This gives you various choices, but Reset Network Settings is what you want:

you will then be given a confirmation to Reset Network Settings -- tap the text.

The phone will restart, and your Messages and texts should work fine. You may have to enter your WiFi passwords again, and on my phone, Mobile/Cellular, the toggle for Mobile Data / Cellular Data had been changed, so it may be an idea to check that.
Comment: I have had the same issue. But people not getting my iMessages. doing this solved my problem. But I think if the OP messages are being seen and the friends cannot. Then it would be the friend that needs to do this.
Comment: Agreed, i would suggest the friend should do this as well.


What is the largest object/mass that can survive entry into the earth's atmosphere from space without heating to 40 degrees C, or above?

Question: This question is of interest because there are terrestrial organisms, such as bacterial and fungal spores, and even complex multicellular organisms, such as tardigrades, which can survive deep space conditions indefinitely. Such organisms, if cooled to cryogenic temperatures (e.e., below -100 degrees C, exhibit profound radiation resistance and a practical arrest of all biochemical activity, potentially allowing for millions or even billions of years of survival. If such organisms were ejected into space via meteorite impact or ice volcanism, they might successfully traverse interplanetary and, more problematically, interstellar distances.
Comment: Interesting question. There are organisms (bacterial spores for example) which can survive temperatures well over 100C. Consider editing the question to reflect this?
Comment: https://whatifshow.com/what-if-you-dropped-a-steak-from-orbit/ says you can't even cook the stake with such drop...
Comment: Are you looking into panspermia theory? If so, keep in mind that some simple organisms can survive frozen in ice, and that a large asteroid containing ice that enters Earth's atmosphere will shed its outer layers, but its core might arrive on the surface relatively cool.
Comment: There may be a sweet spot where a particle (large molecule, virus-like particle) can be heavy enough to not be blown away by the solar wind but light enough to be mostly suspended already at large altitudes (and therefore shed its potential energy very slowly). Nanometer scale particles can be found "[throughout the atmosphere"](https://www.sciencedirect.com/science/article/abs/pii/S1364682614000674).
Answer: The largest viruses measure 0.5 μm.
Bacterium typically measure up to 2.0 μm but their spores are a bit smaller.

Particles of 0.6 – 60 μm radius can remain cold enough to preserve
organic matter during atmospheric entry to planets

https://en.wikipedia.org/wiki/Directed_panspermia#:~:text=Panspermia%20missions%20should%20deliver%20microorganisms,microorganisms%20suited%20to%20various%20environments
Comment: Nice find, though worth noting this seemed to be for artificial capsules. The source paper seems to be 'Pre-biotic organic matter from comets and asteroids' is unfortunately paywalled, since it may have math that would support answering a number of other space SE questions on slow re-entry
Answer: For anything where conventional physics is in play getting from orbital velocity of at least 7 kilometers per second to approximately zero on earths surface involves dissipating 30 kJ of energy per gram. This is easily enough to heat that gram from below zero past boiling. This ratio stays fixed as mass reduces, at least to the point where we start talking about individual atoms and molecules.
In addition individual cells or clusters of cells are unlikely to handle individual high energy strikes in the upper atmosphere well.
Increasing the area and optimal shape can help, though not enough to stay below boiling unless we cheat and start ablating mass.
So we are unlikely to see a single organism make a journey across space and re-entry alone unless it uses exotic chemistry.
Panspermia theory generally assumes cells hidden from the extremes of space and re-entry within larger rocks, small sections of which can sheltered by ablation and insulation of the parent body. So the concern from extra terrestrial contamination probably increases as object size goes up, at least until the body is large enough to make substantial craters, though even there smaller chunks might be shed during re-entry in a manner that is not immediately lethal.
This means that the technical upper limit for 'delivering a payload kept below 40 degrees C' is probably when the impactor is so large that even the chunks trailing behind the main impactor are landing in lava or boiling ocean.
Comment: The square/cube law permits small objects to radiate heat faster than large objects. I'm not sure about the relationship of size to drag coefficient, but I can throw a rock further than a grain of sand. I suspect there are small objects which could de-orbit without significant heating. Molecules for sure. Viruses? bacteria?
Comment: Don't meteorites reach the surface of Earth with cold interiors?
Comment: @Woody - This answer (briefly) addresses that.  A small enough "lander" traveling at interplanetary speeds could be completely disrupted by impacting one molecule or atomic oxygen constituting the upper atmosphere.
Comment: @WayneConrad yep, but most of the mass that hit the atmosphere is gone, melted and/or vaporised on the way, so more starting mass means more potential places that do not get hot enough to cook some form of life hiding there.  The bits we find on Earth are by definition the bits that did not get hot enough to become vapor.
Comment: Why would you assume orbital velocity as a starting point for something coming from outside Earth's orbit?
Comment: @GremlinWranger escape velocity is about escaping not falling into. It is certainly possible to be outside Earths atmosphere with less than escape velocity.
Comment: @MikeB right, The orbit could be around the Sun not the Earth.
Comment: @candied_orange, it would certainly be expected that things hitting earth will be doing at least earth escape velocity, but since the question was looking at match assuming best case 'freak lunar gravity assist into LEO' into seemed a good starting point. Does not change the math of 'everything melts, most things vaporise' over much
Answer: There's an interesting passage in the Smithsonian Scientific Series "Minerals from Earth and Sky - THE STORY OF METEORITES" at page 22:

Of all the known iron meteorites, but seventeen were seen to fall, and
of these only that of Mazapil, Mexico, need be given in detail. The
account is that of one Eulojio Mijares, a ranchman living in Mazapil.
This fall is of special interest, having taken place during one of the
periodic meteor displays.

[...]

We returned after a little and found in the hole a hot stone, which we
could barely handle, and which on the next day looked like a piece of
iron.

There's no exact info on how much time passed between touchdown and handling, nor on the exact temperature, but it seems that we're not talking about molten iron lumps here.


Auto install a font used on my website

Question: I am using a custom font on my site and in search of a way that this font will be installed automatically on the user's system who is opening the site.
Is there any script or any way to do that?
Answer: Yes, font squirrel has an easy-to-use generator that will transform your font into various formats appropriate for different browsers.
The font is not actually installed on the user's machine, it's linked remotely, like an image or script. There's no way to automatically install things on people's machines for obvious security reasons.
Answer: The answer is Yes!
New in CSS3 is @font-face, which tells a browser to download a font and use it to render some text. This is an an example I made with jsFiddle. The caveat with @font-face is that each browser requires a different file type to work. On websites like Google Web Fonts you can use fonts that will work in all browsers.

Auto install a font used on my website


Currency and GDP

Question: USA's GDP (at this time) is ~21 trillion dollards, and UK's is ~2.8 trillion dollars, then how come UK's currency is more than USA's. By that I mean, 1 GBP gets you more than 1 USD.
Comment: Generally, the exchange rate for currencies depends on the market forces(Supply and Demand) in the foreign exchange market. To my knowledge, trade is one of the major factors which affects the demand/supply for various currencies. I don't see how GDP would fit anywhere into this as it is only measuring domestically produced goods.
Answer: Because currency exchange rate does not depend only on the size of output. Using monetary model of exchange rates, which is reasonable first approximation for where the exchange rate between two countries should be, we get that exchange rate ($S$) is given by:
$$\ln S= \ln(m)- \ln(m_f) -(\ln(y)-\ln(y_f))+\lambda(i-i_f)$$
where $m$ is money supply at home and $m_f$ in foreign country, $y$ is the real output at home and $y_f$ in foreign country and $i$ is the interest rate at home and $i_f$ in foreign country.
According, to Statista the money supply (M2) in UK was about 2700 billion GBP, whereas in the US M2 was about 19 trillions (i.e. 19000 billions) of USD.
UK has slightly lower interest rate than US but the difference is very small.
As a matter of fact if you just naively apply the monetary model of exchange rates above (assuming away difference in interest rate to simplify calculations) you will find that GBP should be stronger than USD.  This being said the model above won't give you precise exchange rate because in short run exchange rate can overshoot (e.g. as explained by  Dornbusch overshooting model of exchange rate), or exchange rate might move in short run due to various other reasons (e.g. traders can scapegoat different fundamentals as predicted by the scapegoat theory of exchange rates (see Fratzscher et al 2015), or there might be carry trade etc.). Furthermore, what matters is not just the present value of the fundamentals but also how their expectations change, this is again not captured by the simple model presented above but more complex nuanced versions of it include expectations as well.
To sum up the GBP is stronger because there are more variables than just output that matter for exchange rate that are in favor of GBP and additionally even if fundamentals would suggest that USD should be stronger in short-run exchange rate can deviate from the rate that would be justified by fundamentals either because it overshoots or other reasons (discussing every possible reason for that would be beyond scope of SE answer, you can have look at an overview of literature in Copeland: Exchange Rates and International Finance textbook).

Currency and GDP


Is it possible for a hacker to download a php file without executing it first?

Question: I have a php website where everything is in the public_html\ folder, including an includes folder with config and classes. I told my developer to move it away from public folder but he said there is no risk as files are php files and even if someone types in browser the

www.example.com/includex/config.php

all they will get is a blank page.
Is that correct? Is there no way someone can download a php file and see whats inside, even  if hacker logs into my server somehow to download the file or include it in a php file on his server using XSS?
Comment: XSS is client side,  there is no way in which this could ever be used to read source code on the server. ever.  If you think this is possible you need to lean more about XSS,  this is a very serious venerability and not understanding the basics of this venerability is **extremely dangerous**.
Comment: Its correct provided the php settings are correct which is easy enough to verify.  There are tons of resources which explain what settings features should be enabled and disabled when using PHP and the values certain settings should be ( i.e. timeout, file uploads, ect )
Comment: It's relatively easy to make a configuration mistake that will temporarily disable PHP execution, so why take the risk ? For any decent app the only thing that needs to reside in the public folder is an `index.php` that bootstraps the app/framework and assets such as images or stylesheets. Everything else should be one directory above that is not accessible from the outside.
Answer: In order to read PHP code you need a directory traversal vulnerability. file_get_contents() or other file system functions that are exploitable.
SQL Injection under mysql can be used to read source code.  For example:
select load_file("/var/www/index.php")

To combat this make sure file_privs are disabled for the MySQL user account used by PHP.  If display_errors = on in your php configuration then an attacker can obtain the path to your web root,  and use sql injection or directory traversal to read source code.
Using FTP means that source code is transmitted in plain text.   Use SFTP,  and make sure you have a strong password -- or better yet, set up an RSA key.
Be careful of backup files,  sometimes editors will create index.php~ or index.php.orig files which can discovered using forced browsing.
Answer: In addition to server-side vulnerabilities of all varieties, leaked FTP passwords are also a significant concern. There is a class of client-side infections that harvest your saved FTP passwords from programs like CuteFTP, FileZilla, and DreamWeaver, sending the login credentials to an attacker. This is very common. I've personally seen hundreds, maybe thousands of cases where this has happened. And typically, the person who unknowingly leaked the passwords is someone who no longer needs to have them anyway.
And if you're wondering whether an attacker will actually dig through your configuration files looking for passwords, the answer is unambiguously "yes". Typically it's one of the very first things an attacker will do, within minutes of compromising a new machine.
Comment: FTP means that source code is transmitted in plain text...  why does FTP still exist?
Comment: @Rook Gopher still *exists*. FTP will always exist. The question is why people still use it. And the answer probably has to do with the fact that SFTP requires a shell account (or rssh, etc) an isn't supported on Windows.
Comment: @user3490 The encryption overhead is approximately zero on modern hardware. In fact, SFTP is dramatically faster than ancient FTP on most workloads because there is no additional per-file connection overhead.
Comment: Searching through config files for hardcoded passwords is seriously the easiest way to priv-esc and pwn networks...
Comment: @tylerl For files you intend to distribute publicly there's no major drawback. Also, the encryption required for SFTP can become a bottleneck if you have a fast enough network connection and a slow/busy enough CPU.
Answer: There are two possible ways that an attacker would be able to read this file as text, rather than execute it.

If your web server is misconfigured, then the php might not be executed. You obviously need to have php installed and running server-side, as well as have a web server in place that supports this. If, for some reason, something goes wrong with your php installation, then it is theoretically possible to download the php file "raw." This, however, is unlikely.
If there is an LFI (local file inclusion) vulnerability in this script (or any other dynamic pages on the site), it is possible to display a file that is located on the web server. See the Wikipedia page on file inclusion vulnerabilities to see what this would look like.

As an aside, it's worth noting that in order to use PHP files at all, they need to be reachable by a browser. There's no way to "hide" the page, unless you have another script executing it elsewhere.
Comment: An LFI can **never** be used to read PHP code because an LFI would execute that PHP code.
Comment: @Rook The LFI vulnerability would typically be in another file (or piece of PHP code).
Comment: @Rook - LFI is entirely possible. Imagine e.g a script that serves images as a file stream (say to add cache headers on the fly e.t.c.), but doesn't do any form of input parameter or actual content check, it just assumes it's some image type and adds relevant MIME type to response headers, if at all (such scripts are often used to make images downloadable, for example, so the MIME type would be static).
Comment: @Jeff Ferland an LFI could be used to read /etc/passwd or some text file or xml config file, but if you use an LFI to include a PHP file that file will be executed,  not displayed.  There for an LFI could never be used to download PHP source code.
Comment: I guess, that instead of LFI you mean AFD (Arbitrary File Download).
Comment: @TildalWave that is true for any remote code execution exploit, and this was not mentioned.
Comment: @Rook - LFI of the nature `include($_GET['var'])` would execute the code. However, you can also have something along the lines of `echo file_get_contents($_GET['var'])`, which would echo back arbitrary files.
Comment: @dshaw  I think this was covered more clearly in my post.  In general directory traversal in all functions except include/require lead to source code disclosure.
Answer: Leaked FTP passwords are all very common and are one of the most common ways that source files are removed, malware installed on the developers websites is very common and recently develops gave began witnessing spear phishing attacks against them in an attempt for hackers to gain intellectual property.
One of the not so common ways and from what I'm aware of is only known by a certain amount of people, but if you develop your website on the Linux webserver where the website is being hosted onthen you may have a problem as some editing software will store backups of edited files hidden from the developers view e.g.

Login.php~

This file because it is not run by the webserver can be accessed by entering

This would reveal the source of of the backup login.php file to prevent against this you would either have to develop your code of site and upload it to the server or make sure that there are no backup files stored in a directory that the public have access to.
Source: 2600 magazine
What happens if an attacker was able to access

databaseConnection.php~

Then your really up s*** creek
Answer: As others answered, this shouldn't be possible. However, you can't say that there's absolutely no way for an attacker to read your PHP source code.
For example, there may be a vulnerability that allows an attacker to view files in the web server, including raw PHP code. Or an attacker may be able to discover your FTP password, which also could be done in many ways, including man-in-the-middle attacks and social engineering. There are many possibilities. Below, I've listed some vulnerabilities that could allow it, but bottom line is, just having PHP files in the public_html folder absolutely shouldn't be a risk for itself.

A download.php file which takes a GET/POST parameter with the name of the file to download, and doesn't filter user input correctly, could make it possible to download the raw code of a file on the site, through accessing an address like this: http://www.example.com/files/download.php?file=../index.php. See this.
Another example: if there's a vulnerability that allows an attacker to execute code on your server, such as Local/Remote File Inclusion, File Upload Vulnerabilities, and others, it might also be possible for him to run code that allows him to read your PHP source code.
Answer: As long as things are setup correctly on the server, PHP files should be registered as scripts and the web server should have them interpreted by PHP when requested and only display the results of that interpretation.
That said, any number of issues can result in files being exposed.  Some of these issues can also expose data regardless of if they are in a public folder or not.  It is always important to make sure your server is properly configured to only allow the requests you need allowed.  This reduces the surface area available to attack and helps avoid possible bug related issues that could result in a breach.
Is it a good idea to have a config file in a public folder?  As long as the server is configured not to give out the file without processing it, it probably isn't much less secure than any other spot on the system.  There is the small chance of a bug in the web server being used to prevent execution by the scripting engine, but the more likely attacks are attacks that would come from some other direction like SQL, FTP or some code injection where being in a private folder would be equally exposed.
That said, the flip side of the question is why not put it somewhere else.  The most secure option would be to put it someplace that only the user that the web site's PHP instance runs as can access and deny access to the file from any other mechanism (such as the FTP user or any other publicly used users.)  This is rather difficult to configure and manage however, so a decision has to be made if the additional security is necessary or not.
It's a toss up on which is best.  It's a lot of extra work to manage all the paths, permissions and users to maintain that level of security.  On the flip side, as long as the server is kept patched and properly configured, you should only be vulnerable to zero day exploits that attack at a very low level and can be safe against pretty much all common attacks, even with the config file in the public folder.


How do you calculate your array throughput with VMFS?

Question: How do you calculate your maximum throughput available for a RAID volume? Do you use your VMFS block size per IOP? Your OS Blocksize? Your array stripe size? Any idea?
Answer: The OS\App blocksize and your IO patterns are what you want to focus on.
VMFS blocksize has no effect on IO patterns - it affects the maximum file size that a particular VMFS can contain not the read\write IO size. Array strip size has an effect but it's more indirect and the optimal stripe size depends on the IO patterns and the storage system you are using - in general go with the vendors recommendation for your workload or the default unless you have benchmarks that tell you otherwise.
Answer: What I always do is to benchmark the array by booting one of the hosts into linux, format the LUN using ext2 and just using iozone - it's close enough.


What should I do when my work has been published by my supervisor without my knowledge?

Question: I had worked on a project for my bachelor thesis in 2012 and in 2013, I moved to Germany for further study. Now when I am facing several interviews for Ph.D. and the supervisors ask if I have published my bachelor thesis or not. So I was thinking to add some computational data and publish my work in a good journal. But I noticed my supervisor with another student had already published my work in 2015 and I didn't know anything. Another student had a similar project(we worked together when we were working in the lab, we just had different solvents/medium for our samples) so he merged both projects together and published it and my supervisor was the first author. And anyone can find my thesis if they search in my university website with my name and the project name. Now my question is what steps I can take? It's my work and I worked for 1 year on this project and they didn't even mention my name anywhere or never asked me about this. Should I write to my supervisor regarding this? or should I inform the publication house?
(I did not have any contact with my supervisor after I graduated)
Comment: Was your thesis properly cited in the publication?
Comment: No. I already checked.
Comment: Same basic thing happened to me. The prof I worked for was a very nice person. I'm pretty sure the key difference between myself, who didn't get co-authorship, and my friend (who also worked there) who did, was keeping in touch with the prof. Getting co-authorship at that level is just a gift. If you leave and aren't heard from again, they assume you don't need favors from them anymore. Doesn't matter, though. It really isn't a numbers game; if you are smart and productive it will show in the CV.
Comment: There are some "real nice" people in Academia... Your ex-supervisor probably won't want to change the authorship after so long... And if you take it to the publishing house then the supervisor will come up with something like " oh that student ran a few tests under direct supervision" so authorship was not an issue...
Comment: Without your knowledge can't really matter. Without your consent would be actionable at law, if you could prove it. To what extent can you prove it?
Answer: There is probably little you can do formally or legally. Not citing your thesis was a lapse, but getting that changed is not likely to happen. You can, of course, point people directly to your thesis.
I don't see any ethical issues with the publication itself. The work was, in some sense, unfinished. It is natural to want to finish it and you weren't there to help. But you should have been cited. But the ethical lapse was in failure to cite, not the publication itself, assuming that it was an extension.
But you might also be able to obtain a letter from your old supervisor explaining that the publication in question incorporated prior work of yours. That might be enough for your current purposes.
However, you might also be able to publish your thesis unchanged with original dates attached. It would be a late publication but if you can convince a journal to publish it, you could establish priority on at least some of the ideas. Your university will verify that the work was done prior to the new publication's date. If you change/update it, however, you lose the advantage of priority.
But try to work first with your old supervisor.
Another option is to extend not only your own old work but the publication itself. Then it is new work. You can cite your old thesis and the newer publication in this work. Ultimately that is what you want to be able to do, of course.
Answer: I don't agree with @Buffy that it was a lapse!  It was bluntly unethical.
If you are in a situation where you don't need your advisor's approval or recommendation, you might want to consider filing a complaint to the ethics committee of your university. Of course, contact him first and demand that he will add your name.
I am just a MSC student, but I don't see how I am wrong.
Comment: I disagree that "publication" was unethical, assuming that the work was extended. It was failure to cite that was unethical. Sorry I wasn't more clear. I've made an edit to try to clarify. There isn't enough information here to evaluate a plagiarism charge.