Effects of regular rock climbing on instrument play

Question: Related : Is it bad for a piano player to work out?
Context :
The SE question linked above actually reminded me of a story about a guitar teacher that used to rock climb regularly but quit as he felt his climbing activity hindered his guitar play.
As an occasional climber and a guitar player, I wondered about this story for quite a time. The answers in the question above claimed that working out should not be a problem for piano playing. But what about rock climbing ? Climbing definitely put some hard pressure to your fingers, and anyone who had ever rock climbed know that you feel that a numbness lingers in the fingers quite some time after climbing (several hours usually).
Question :
Does rock climbing hinder, in the long-term, your finger dexterity, hence your instrument play ? If yes, how, and how much ?
Details :
I'm more interested in the lingering effects from climbing exposure on the fingers (or arms), not so much about the injury risk from fall/mishap (of course if you crush your fingers on a rock it will seriously hinder your play). Though they're not totally out of the question either.
For the instrument, I obviously think about the guitar, although I guess this question could be extended to any instrument that requires some finger dexterity, like the piano.
EDIT : this is what I mean when I write 'climbing' : https://en.wikipedia.org/wiki/Rock_climbing
Comment: @021 -- I don't think that the question is necessarily a bad one, but the comments about taking risks with your limbs do seem relevant. I think that your question might be better answered not by musicians but by medical professionals or sports-medicine professionals who can address long-term physiological and neurological effects of such activities.
Comment: @021 is it "regular" or "occasional?" I imagine the amount of climbing matter as overuse/injury could be more likely if it's frequent. Also, intensity could matter. Does the climber do crazy stuff like hold their whole weight by a few fingers, etc?
Comment: @Michael For the frequency, one of my motivations for posting this question (and possibly for any future reader to look for this question) would be to adapt my climbing frequency depending on the resulting effects on my playing. That's why I would prefer not to be too specific about frequency.
About intensity, I kinda feel the same as for frequency (not wanting to be too specific). Though I'd be more ok with giving up more information about this if needed. I would say the intensity required to climb E4/6a british grade (or 6c in french).
Comment: I'm voting to close this question as off-topic because care of one's physical self is hardly limited to rock-climbing.
Comment: @Carl Can you elaborate ? I don't understand
Comment: As the existing answers point out,  **any** activity which puts your body at risk has the potential to end your musical career.
Comment: Right, I think I understand what bugs you now. Though if you allow me, if anything, it's Michael's answer and your point of view which are off-topic. I was looking for answers directly linked to rock climbing (and not any physical activity) and its interaction with instrument play, and he gave me a less specific answer. Still correct and good however, that's why (that and the fact that I actually can't) I didn't downvote his answer.

I think it's relevant to ask it specifically about climbing because -as phoong pointed out- rock climbing requires hard finger strength, that and other things.
Comment: Can a point of view be off-topic here? I may have to go elsewhere, then....
Comment: If you think that rock climbing does not have any effect besides generic effects from physical activity on instrument play, then the answer I'm looking for would be something like : **No more (effects) than just the danger of physical activity**
If my question requires editing to clarify this point, I'll be glad to hear it, though I thought I made it clear (notably in the first paragraph of the *details* section).
Comment: @David Either I'm misunderstanding it completely, or I'm misunderstood here. 'Point of view' may not be the right words to use here as well. What I mean is that, this way of approaching the question (what I mean by 'point of view') is neglecting all the specificity of rock climbing as a physical activity, which I'm looking for more than anything else more generic. If I wanted answer about effects from generic physical activity, I wouldn't have written 'rock climbing' in my question !
Comment: @David On that point I think I agree with you. I wanted to link these long-term physiological and neurological effects with my real concern which is guitar play, but it seems that this question requires more knowledge about sport-medicine than it requires knowledge about music.
I think I had hoped some musician with rock climbing experience would stumble upon my question and give me some knowledge about it.
Comment: @David And yes, the risk of fall/mishap is relevant, but there's more to that question that just this. That's what I was trying to explain to Carl.
Answer: rock climbing does indeed hinder your fingers' range of motion, but not necessarily dexterity.
Tenosynovitis: Your tendon sheaths around your joints get inflamed from regular and repeated rock climbing strain and they start to build up scar tissue. They thicken and drastically reduce range of motion, especially limiting your fingers' ability to touch your own palm. This doesn't really affect piano playing but does affect guitar playing, limiting your ability to play some certain intricate chords.
I'm speaking from experience.
Context: I played...
Classical Piano from 5-14yrs old
Jazz Guitarist from 14-24yrs old
Rock Climbed/Bouldered from 24-27yrs(now)
Answer: Short answer: No. Longer answer: depends.
Similar to my answer in the question you linked, I have several friends who are intense rock climbers - all play different instruments: piano, trumpet, etc. They are professional musicians and have never had issues resulting from it.
That said, any intense sport you do will show up later in life as an effect on the body. It's possible that if it's going to affect you, it won't be until your 50-60's, which is when it'll really start to give you trouble. Also possible it never effects you at all. This is entirely dépendant in your individual biology.
Hope that helps.
Answer: I play guitar, and infrequently go climbing at bouldering gyms. Anecdotally, I've found that for a couple of days after climbing, even once the muscle soreness is gone, (bearing in mind that I only climb once every couple of months) my finger dexterity when playing guitar feels reduced. I find it frustratingly difficult to play things that would normally be easy. It almost feels as though, because the muscles have changed, that I can't rely on the "muscle memory" that I normally would. Perhaps more frequent climbing and consecutive guitar practice would mitigate this.
Answer: I think a person needs to assess their sport technique and make a personal decision about how much risk they are willing to take.
If you played a sport a lot, you could face an overuse injury. Something like tennis and a wrist problem. But, generally if you have good form and take care of yourself you should not get injured just from playing a sport frequently.
On the other hand you could play a sport occasionally and have an accident. (I jammed my finger catching a football this summer, but I don't play regular football.)
But, you can say the same for nearly anything you do. I could cut my hand chopping vegetables.
Some sports may be especially risky. Martial arts - where you punch stuff all the time
 - seems risky for the aspiring concern pianist. But other than an extreme like that, a musician should be able to play sports without fear of injury.
Comment: Well put.  A certain famous BSO director (Ozawa) gave up professional piano after breaking a finger playing baseball (I think; might have been some other ball sport).
Comment: Good points, however all of this would apply for any other physical activity, and I'm more interested in the effects from rock climbing specifically. My primary concern is that climbing put hard pressure on the fingers, which could cause some long-term damage. But I don't want to narrow the question too much either, that's why I did phrase my question to stay open for things I might not have thought of.
Answer: My wife climbs mountains for fun (I can't even watch her), and she is also the Worship Leader at our church. If anything, the mountain climbing helps her guitar playing, because she feels healthier and stronger. Of course, the question can be viewed as purely subjective - it works for my wife, but it doesn't work for me (Gravity and I don't have a good relationship)
Comment: I think the question is about *rock* climbing, which involves serious finger strength, as opposed to hiking, which involves none.  In my experience in the US, "mountain climbing" usually denotes hiking.
Comment: I'm in the US, but not from the US. My interpretation of 'Mountain Climbing' means ropes, helmets, abseiling, belays etc - not just a nice stroll in the park on a Sunday afternoon.
Comment: I'm from the US, and my interpretation of mountain climbing includes ascending mountains even if ropes, helmets, etc., are not necessary, but "stroll in the park on a Sunday afternoon" does not include ascending mountains.


Unable to log into a rsyslog filter using logger

Question: Ubuntu 64 14.04 comes with rsyslog (7) built-in.
I've added test.conf to /etc/rsyslog.d with the following line:
:syslogtag,isequal,"test"       /var/log/test.log

I then restart rsyslog and log using logger:
echo "hi there" | logger -t test

I expect that line to reach /var/log/test.log, but instead it reaches syslog.log.
What am I doing wrong?
Answer: You're missing a colon after test.  It reads "test" but should read "test:".
This is the same issue:  how to filter rsyslog messages by tags.
Comment: That was it. Thanks. (if you edit your answer to update it I'd be happy to accept it)
Comment: I've disabled all rules in the rsyslog.d dir and left only the above test rule. Restarted rsyslog. Nothing reaches test.log (nor does anything reach syslog, naturally). I've tried specifying `-p user.notice` but it did not make a difference.
Comment: I misread part of your question and didn't notice you were trying to route based on the tag.  The commonly accepted practice is to use the facility to route syslog messages.  I think you'll find that much more straightforward.  That said, I think your problem is you're missing a colon in `"test"`.  It should be `"test:"`.  See: [how to filer rsyslog messages by tags](http://serverfault.com/questions/514901/how-to-filer-rsyslog-messages-by-tags).


Como obter um valor usando interpolação?

Question: Estou tentando recuperar um valor de uma classe usando interpolação. Usando   Console.WriteLine($"Meu Nome é,  {pessoa.Nome}");, obtenho o valor da forma que quero, mas no meu caso a string vai vir de uma configuração do banco de dados.
Tentei montar da seguinte forma
string expressao = "Meu Nome é,  {pessoa.Nome}";

e chamar assim
Console.WriteLine($"" + (expressao));

Isso imprime a string

Meu Nome é,  {pessoa.Nome}

E isso não é o que quero. Existe alguma forma de fazer isso?
using System;

namespace Usando_Interpolacao
{
    class Program
    {
        static void Main(string[] args)
        {
            var pessoa = new Pessoa()
            {
                Documento = new Documento()
                {
                    Numero = 12345,
                    Tipo = "RG"
                },
                Idade = 20,
                Nome = "Papai Noel",
            };

            string expressao = "Meu Nome é,  {pessoa.Nome}";

            Console.WriteLine($"Meu Nome é,  {pessoa.Nome}"); // print --> Meu Nome é,  Papai Noel
            Console.WriteLine($"" + (expressao)); // print --> Meu Nome é,  {pessoa.Nome} .. Errado :(
            Console.ReadKey();
        }
    }

    public class Pessoa
    {
        public int Idade { get; set; }
        public string Nome { get; set; }
        public Documento Documento { get; set; }
    }

    public class Documento
    {
        public int Numero { get; set; }
        public string Tipo { get; set; }
    }
}

Comment: Relacionada: [Biblioteca que faça igual a interpolation string do C# 6.0 em tempo execução](https://pt.stackoverflow.com/q/136458/18246)
Comment: e `expressao = $"Meu Nome é,  {pessoa.Nome}";` dps, `Console.WriteLine(expressao);` ?
Comment: Não tem como porque a interpolação é resolvida em tempo de compilação. Ou seja, os tokens precisam ser conhecidos de antemão. O código final é um `string.Format` padrão. O que você pode fazer é construir um método pra resolver os tokens dinamicamente.
Comment: Relacionada: [O que significa o simbolo "$" antes de uma string?](https://pt.stackoverflow.com/q/91117/18246)
Comment: Você precisa de algo que faça o "parse" ou "evaluate" da sua expressão para isso. Dá uma olhada nesse pacote que faz exatamente isso: https://github.com/dotnet/roslyn/wiki/Scripting-API-Samples
Comment: Com esse pacote, seu código ficaria assim: `var resultado = await CSharpScript.EvaluateAsync(expressao);`
Comment: @LINQ, legal esse link do bigown, vou ver essas bibliotecas que ele deu de referencia.
Answer: Consegui resolver usando o  Smart.Format, não sei se é uma boa biblioteca, mas no momento atendo o que preciso.
var pessoa = new Pessoa()
{
    Documento = new Documento()
    {
        Numero = 12345,
        Tipo = "RG"
    },
    Idade = 20,
    Nome = "Papai Noel",
    Codigo = 1,
};

string expressao = "Pessoa/{Documento.Tipo}";
string texto = string.Empty;

texto = Smart.Format(expressao, pessoa);
Console.WriteLine(texto);

Comment: Essa biblioteca não resolve o problema da sua pergunta também?
Comment: @LeandroAngelo, resolve sim. montou a string como eu queria.


Using k-fold cross-validation to test all data

Question: Is it possible to do k-fold cross-validation to test all data, rather than using kfcv to find the optimal hypothesis as is typically done.
Example:
Say I want to use a svms on a dataset of size 1000. Could I use 900 events to train the svm for the testing of the other 100 events. Then use a separate 900 events to train the svm for a separate 100 events, repeating this process 10 times until all of the data has been tested.
Would events tested using separately trained svms be comparable? i.e. through this technique could I then use my entire dataset instead of setting aside a certain fraction for training, or is this a statistically unwise thing to do?
Thanks for any help,
Colorado
PS) Any references to why this would['nt] work is greatly appreciated, I'm discussing this technique in an academic setting.
Answer: As far as I understand your question, it can be formulated this way:
Instead of calculating a quality measure for each of the k validation-folds and then calculate the average, may I aggregate all folds an then calculate my quality measure, hence getting only one instead of k values?
This question requires two perspectives:
From the perspective of crossvalidation itself it is ok, because training- and testsamples still have an empty intersection etc. Since you just aggregate multiple samples drawn without replacement, the test-distribution is not spoiled.
From the perspective of the model, it depends whether the model produces comparable scores. SVM will work in my opinion, but imagine a model which min-max-normalizes the scores across the test-set (iiek), so that the calculation of a representative decision threshold across all test-samples will be quite hard.
In general, a lot of techniques which require the estimation of a parameter, which itself depends on the quality of a model, utilize this approach. A concrete example is the calculating of an operator to calibrate the scores of a classification model, e.g. Platt Scaling.
Furthermore (also this not an completely satisfying argument) the open source software Rapidminer has an operator for this approach.
PS:
I want to point out, that although this approach is useful to get reliable quality measures for only small datasets, it may be hard to perform statistical tests to compare the significance of two models, since cv cannot be repeated endlessly (example: how to estimate whether the assumption of the so-often-misused t-test is satisfied if you only have 6 data points?).
PPS: Also interested, I was not able to find a paper focusing on the examination of this approach. The papers I have seen so far using this technique did not bother to reference it.
Comment: I think you have misunderstand the question (I believe it was Can I use CV to just make error approximation instead of the whole model selection?), but +1 for relevant remarks.
Comment: I also had this interpretation in my mind, but I thought that this would be too easy ;), since this is exactly what cv does. Additionally, the whole "all data"-part confused me.
Comment: Thanks for your response, lots of relevant information here. Just to make sure we're on the same page let me state this another way:

In some papers I've noticed that people set aside a certain fraction of the dataset for training purposes. Given a dataset of size 1000 they set aside 300 events for training and use 700 events for classification and never discuss the 300 events used to train the model (i.e. they don't train a separate model and then test those 300 events). Couldn't they just use cross validation technique to classify all of the data?
Comment: @C.Reed: Not with the same ratios ! Sometimes you want to reduce the computation time and/or control the test-to-training-ratio to study the bias-variance tradeoff. I you have some time to spend, I recommend chapter 3 of Kohavis Phd Thesis discussing this topic extensively (http://robotics.stanford.edu/~ronnyk/teza.pdf). But all in all, the cv (from my point of view) is the favored method for error estimation (as mbq already said)
Comment: Thanks for the thesis reference, ch. 3 is quite helpful on this matter.
Answer: Yes it is; and while this is a very reliable way of reporting error, I would say it is even encouraged.
Answer: I'm not 100% clear on the question, but I have a few points to add:
I'm assuming that the error you are trying to estimate is the prediction error. If so, I agree that 10 fold cross validation would be good (and likely unbiased) approximation of the true prediction error IF your training sets are sufficiently large. Large in this case means that the training sets provide enough information to build a "good" SVM (one that, in a sense, captures most of the underlying relationships between between the predictors and response.) Training sets of size 900 are more than likely large enough. In fact, unless the SVM you are fitting is extremely complex, I would recommend using a 5-fold cross validation in order to get a more precise estimate of prediction error (and yes, you can average the error estimates of the 5 folds to obtain an final estimate.)
With regards to the question:
"Would events tested using separately trained svms be comparable? i.e. through this technique could I then use my entire dataset instead of setting aside a certain fraction for training, or is this a statistically unwise thing to do?"
I don't understand this question, but since the phrase "entire dataset" is in a post about CV, I just want to warn you that estimating prediction error from models fit to all available data is generally a bad idea. For cross validation to make sense, each training set/test set pair should have no points in common. Otherwise, the true error will likely be underestimated.


How can I configure Android Studio to get rid of these errors?

Question: After attempting to import a project into my version of android studio, I was bombarded with the following errors:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:processDebugResources'.
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
    at java.lang.Thread.run(Thread.java:745)

In order to mitigate this, I set my android studio project to android sdk 26 but it's failed to mitigate the issue. I've also tried updating the build gradle but that also has yet to produce promising results.
Here's an area in which I've received an error:
boolean workerStarted = false;
        boolean workerAdded = false;
        Worker w = null;
        try {
            w = new Worker(firstTask);
            final Thread t = w.thread;
            if (t != null) {
                final ReentrantLock mainLock = this.mainLock;
                mainLock.lock();
                try {
                    // Recheck while holding lock.
                    // Back out on ThreadFactory failure or if
                    // shut down before lock acquired.
                    int rs = runStateOf(ctl.get());

                    if (rs < SHUTDOWN ||
                        (rs == SHUTDOWN && firstTask == null)) {
                        if (t.isAlive()) // precheck that t is startable
                            throw new IllegalThreadStateException();
                        workers.add(w);
                        int s = workers.size();
                        if (s > largestPoolSize)
                            largestPoolSize = s;
                        workerAdded = true;
                    }
                } finally {
                    mainLock.unlock();
                }
                if (workerAdded) {
                    t.start();
                    workerStarted = true;
                }
            }
        }

I expect to run my build and the error message above is what I got instead.
Here's the full stack trace:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:processDebugResources'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
    at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
    at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
    at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
    at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)
    at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: Failed to execute aapt
    at com.android.build.gradle.tasks.ProcessAndroidResources.doFullTaskAction(ProcessAndroidResources.java:201)
    at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:82)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
    at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:46)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:121)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
    ... 32 more
Caused by: com.android.ide.common.process.ProcessException: Failed to execute aapt
    at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:867)
    at com.android.build.gradle.tasks.ProcessAndroidResources.doFullTaskAction(ProcessAndroidResources.java:194)
    ... 48 more
Caused by: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing process C:\Users\Ahers\AppData\Local\Android\Sdk\build-tools\26.0.2\aapt.exe with arguments {package -f --no-crunch -I C:\Users\Ahers\AppData\Local\Android\Sdk\platforms\android-26\android.jar -M \\?\C:\Users\Ahers\Downloads\codecanyon-wL3wOIIS-cupid-love-dating-native-android-application\MainFile\CupidLove\Androidapp\CuipdLove_paid_feature_added\app\build\intermediates\manifests\full\debug\AndroidManifest.xml -S C:\Users\Ahers\Downloads\codecanyon-wL3wOIIS-cupid-love-dating-native-android-application\MainFile\CupidLove\Androidapp\CuipdLove_paid_feature_added\app\build\intermediates\res\merged\debug -m -J \\?\C:\Users\Ahers\Downloads\codecanyon-wL3wOIIS-cupid-love-dating-native-android-application\MainFile\CupidLove\Androidapp\CuipdLove_paid_feature_added\app\build\generated\source\r\debug -F C:\Users\Ahers\Downloads\codecanyon-wL3wOIIS-cupid-love-dating-native-android-application\MainFile\CupidLove\Androidapp\CuipdLove_paid_feature_added\app\build\intermediates\res\resources-debug.ap_ -D \\?\C:\Users\Ahers\Downloads\codecanyon-wL3wOIIS-cupid-love-dating-native-android-application\MainFile\CupidLove\Androidapp\CuipdLove_paid_feature_added\app\build\intermediates\multi-dex\debug\manifest_keep.txt --debug-mode --custom-package com.example.cupidlove -0 apk --output-text-symbols \\?\C:\Users\Ahers\Downloads\codecanyon-wL3wOIIS-cupid-love-dating-native-android-application\MainFile\CupidLove\Androidapp\CuipdLove_paid_feature_added\app\build\intermediates\symbols\debug --no-version-vectors}
    at com.google.common.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:299)
    at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:286)
    at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:116)
    at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:865)
    ... 49 more
Caused by: com.android.ide.common.process.ProcessException: Error while executing process C:\Users\Ahers\AppData\Local\Android\Sdk\build-tools\26.0.2\aapt.exe with arguments {package -f --no-crunch -I C:\Users\Ahers\AppData\Local\Android\Sdk\platforms\android-26\android.jar -M \\?\C:\Users\Ahers\Downloads\codecanyon-wL3wOIIS-cupid-love-dating-native-android-application\MainFile\CupidLove\Androidapp\CuipdLove_paid_feature_added\app\build\intermediates\manifests\full\debug\AndroidManifest.xml -S C:\Users\Ahers\Downloads\codecanyon-wL3wOIIS-cupid-love-dating-native-android-application\MainFile\CupidLove\Androidapp\CuipdLove_paid_feature_added\app\build\intermediates\res\merged\debug -m -J \\?\C:\Users\Ahers\Downloads\codecanyon-wL3wOIIS-cupid-love-dating-native-android-application\MainFile\CupidLove\Androidapp\CuipdLove_paid_feature_added\app\build\generated\source\r\debug -F C:\Users\Ahers\Downloads\codecanyon-wL3wOIIS-cupid-love-dating-native-android-application\MainFile\CupidLove\Androidapp\CuipdLove_paid_feature_added\app\build\intermediates\res\resources-debug.ap_ -D \\?\C:\Users\Ahers\Downloads\codecanyon-wL3wOIIS-cupid-love-dating-native-android-application\MainFile\CupidLove\Androidapp\CuipdLove_paid_feature_added\app\build\intermediates\multi-dex\debug\manifest_keep.txt --debug-mode --custom-package com.example.cupidlove -0 apk --output-text-symbols \\?\C:\Users\Ahers\Downloads\codecanyon-wL3wOIIS-cupid-love-dating-native-android-application\MainFile\CupidLove\Androidapp\CuipdLove_paid_feature_added\app\build\intermediates\symbols\debug --no-version-vectors}
    at com.android.build.gradle.internal.process.GradleProcessResult.buildProcessException(GradleProcessResult.java:74)
    at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:49)
    at com.android.builder.internal.aapt.AbstractProcessExecutionAapt$1.onSuccess(AbstractProcessExecutionAapt.java:78)
    at com.android.builder.internal.aapt.AbstractProcessExecutionAapt$1.onSuccess(AbstractProcessExecutionAapt.java:74)
    at com.google.common.util.concurrent.Futures$6.run(Futures.java:1319)
    at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:457)
    at com.google.common.util.concurrent.ExecutionList.executeListener(ExecutionList.java:156)
    at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:145)
    at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:185)
    at com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:53)
    at com.android.build.gradle.internal.process.GradleProcessExecutor$1.run(GradleProcessExecutor.java:60)
Caused by: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Ahers\AppData\Local\Android\Sdk\build-tools\26.0.2\aapt.exe'' finished with non-zero exit value 1
    at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:382)
    at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:47)

Comment: Look at the rest of the stacktrace, particularly any "Caused by", which should show the actual cause of the error.
Comment: Caused by: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: Failed to execute aapt
 at com.android.build.gradle.tasks.ProcessAndroidResources.doFullTaskAction(ProcessAndroidResources.java:201)
 at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:82)
Comment: That's what the caused by said but the files its reffering to seem be fine.
Comment: Edit the question and show the ***full*** stacktrace, not just the first "Caused by". Show all of them.
Comment: ok, sure thing:)
Comment: Is this your personal project or some sample from github or somewhere else. If so can you share the link ?
Comment: Also what do you mean by **"I've also tried updating the build gradle but that also has yet to produce promising results."** ?
Comment: It's a personal project, may I send you the source?
Comment: @MikePence have you tried my suggested workarounds? You can also share your source code with me so that I can try fixing the issue.
Comment: Hi. @Roaim . I tried a lot of your suggestions but I still wasn't able to get around it.  I'd be more than happy to send you my source code. Is there another platform you'd like to move to for this?
Comment: you can host your project on GitHub and share the link to me. you can also connect me on https://linkedin.com/in/roaim
Comment: Thanks so much for your help! I've sent you an invite on LinkedIn. I can send you everything from there.
Answer: From your stack trace, it can be guessed that the error is due to the Android Resources or more specifically within the XML files as it says,
Execution failed for task ':app:processDebugResources'

After going further, we can see -
Error while executing process C:\Users\Ahers\AppData\Local\Android\Sdk\build-tools\26.0.2\aapt.exe with arguments {package -f --no-crunch -I C:\Users\Ahers\AppData\Local\Android\Sdk\platforms\android-26\android.jar -M \\?\C:\Users\Ahers\Downloads\codecanyon-wL3wOIIS-cupid-love-dating-native-android-application\MainFile\CupidLove\Androidapp\CuipdLove_paid_feature_added\app\build\intermediates\manifests\full\debug\AndroidManifest.xml -S C:\Users\Ahers\Downloads\codecanyon-wL3wOIIS-cupid-love-dating-native-android-application\MainFile\CupidLove\Androidapp\CuipdLove_paid_feature_added\app\build\intermediates\res\merged\debug -m -J \\?\C:\Users\Ahers\Downloads\codecanyon-wL3wOIIS-cupid-love-dating-native-android-application\MainFile\CupidLove\Androidapp\CuipdLove_paid_feature_added\app\build\generated\source\r\debug -F C:\Users\Ahers\Downloads\codecanyon-wL3wOIIS-cupid-love-dating-native-android-application\MainFile\CupidLove\Androidapp\CuipdLove_paid_feature_added\app\build\intermediates\res\resources-debug.ap_ -D \\?\C:\Users\Ahers\Downloads\codecanyon-wL3wOIIS-cupid-love-dating-native-android-application\MainFile\CupidLove\Androidapp\CuipdLove_paid_feature_added\app\build\intermediates\multi-dex\debug\manifest_keep.txt --debug-mode --custom-package com.example.cupidlove -0 apk --output-text-symbols \\?\C:\Users\Ahers\Downloads\codecanyon-wL3wOIIS-cupid-love-dating-native-android-application\MainFile\CupidLove\Androidapp\CuipdLove_paid_feature_added\app\build\intermediates\symbols\debug --no-version-vectors}

I can give you the following suggestions by analyzing the above error message,

We can see the build tool version is 26.0.2. Make sure Compile and target SDK versions are not higher than it. Try to keep them in the same version. If the project has multiple modules then check if all the module has the same version. Also try to match the Gradle versions.
As we can see aapt is throwing the error while processing the AndroidManifest.xml file, then the most possible reason could be any malformed entry in this file. Therefore I would suggest you to go through each and every line in the manifest file (including all flavors). Especially check the proper implementation of 3rd party SDKs entries in Manifest across all the flavors.
Try to clean the project from the build menu and invalidate the cache and restart from the file menu.
Last but not least, try to build your app from the Gradle toolbar on the right side of the android studio's default window. Choose your module -> Tasks -> build -> build . By doing so you will probably get more details logs in the run tab. Which will help you debug quickly.
Comment: Thanks again for everything!


How to hide contents of content (font awesome)

Question: I want to hide search from
search

using css. Before we were using material icons
mode_edit*

and there it was hidden (mode_edit)
I already tried looking around, but couldn't figure a way out using only css.
Comment: @Gosi That would hide the entire icon. OP wants to hide only the text, keeping the icon intact.
Comment: I'm assuming he means to hide text but to keep for screen readers, or when the icon font fails to load or something.
Comment: OP consult their docs on how to do this correctly, so that your icon also remains accessible. https://fontawesome.com/how-to-use/on-the-web/other-topics/accessibility#web-fonts-semantic

Essentially, wrap the text in a span tag and hide the span.
Comment: lol, that means just remove the text? as in like, backspace the text within ?
Answer: You can just delete 'search' from inside the tags.
so it will look like this:

if you wanted to keep the text for screen readers you could do this:
Search
css file should have:
.hidden{display:none;}
Comment: Re edit: The usual goal of having an icon with associated hidden text is to provide content that is friendly to screen reader and search engine software. Using `display: none` will hide the text from screen readers and risk looking like keyword stuffing to search engines.
Comment: All else being equal, `class="hidden"`won't hide anything.
Comment: Youre right, i assumed OP would have a good enough understanding off CSS to implement the class, Ive updated my answer in case they dont


Using residuals in 2SLS regression to remove reverse causality

Question: Someone suggested the following idea to me to control for reverse causality. Suppose we want to test for the effect of $X$ on $Y$ in a panel data set, but we suspect that there is reverse causality. That is, past values of $Y$ may cause variation in $X$, too.
The suggestion goes as follows: In order to remove potential reverse causality between independent variable $X_t$ and dependent variable $Y_t$, we could run a first stage regression of the second lag of $y$ on the first lag of $x$,
$$x_{t-1}=\alpha + \beta y_{t-2} + e_{t-1}$$
and then use the residuals of that regression $e_{t-1}$ as the independent variable in our main model
$$y_t = \beta_0 + e_{t-1} + z_{t-1}$$
Here, $e_{t-1}$ would thus represent the part of $x_{t-1}$ that is not explained by preceding values of $y$. This method should therefore effectively remove the reverse causality in the model.
The proposition makes intuitive sense to me at least. However, I have not seen it proposed or applied anywhere before, the common remedy for reverse causality being 1) lagging independent variables, and b) using IVs. Though I admit that I am perhaps not skilled enough an econometrician to give an adequate response here. I was therefore hoping the community could weigh in on the question. Does this method seem viable to you as a control for reverse causality, or have you seen it (or something similar) applied somewhere before?
Answer: The approach seems to be correct although the expression for $x_{t-1}$ and $y_t$ may not be. Ths is an instrument variable model where the causality between X and Y needs to be inferred in the presence of a confounder affecting both.
Consider a DAG  where we want to understand the effect of A on X. Because there is an unknown/unobserved variable U affecting both A and Y, we cannot have the independence between Y(a) and A. Y(a) is the random variable when A is fixed to some value a. Now, imagine there is another variable Z that can completely predict A and hence renders the arrow connecting
U->A completely useless i.e, . Due to this strong predictor of A, we can have $Y(a) \perp A$. In most cases however, you are going to have a middle ground between the two which implies $Y(a,z) \perp {A}$. It allows us to create linear models to understand the causal relationship between A and Y.

$A = v_0 + v_1 * Z + e_1$
$Y = u_0 + u_1 * A + e_2$ and,
$Y = w_0 + w_1*Z + e_3 $

Getting the average causal effect of A on Y i.e, $E[Y(1)] - E[Y(0)]$ is now straight forward. Using Sewell path analysis method gives us
$E[Y(1)] - E[Y(0)] = \frac{E[Y(z=1)] - E[Y(z=0)]}{E[A(z=0)] - E[A(z=1)]} = \frac{w_1}{v_1}$
$Y_{t-1}$ is doing the same job as Z in your case


What does the notation f(·|θ) mean?

Question: I've been trying to solve a sum where $X$ is a stochastic variable with density $f(\cdot | \theta)$ with density $f$ defined by:
$$f(x|\theta) = \frac{θ}{x^{\theta+1}} \tag{Pareto}$$
I don't really understand what $f(\cdot | \theta)$ means. Can anyone shed some light on this?
Comment: If denotes a PDF that is equipped with a parameter $\theta$. Its actual argument is $x$.
Comment: It's sometimes written $f_\theta(x)$.
Comment: A family of probability densities parametrized by $\theta$ -- what is otherwise called *a statistical model*.
Comment: In general it is an placeholder for an argument of a function. With it you can express a function more generally.
Comment: Look here:https://en.wikipedia.org/wiki/List_of_mathematical_symbols_by_subject#Functions
Answer: For simulation we have to specify the values of parameters; in such a context, the notation $f(x \mid \theta)$ suggests that $\theta$ (may be a vecotr) is "known". For statistical inference the values of parameters are to be investigated via data at hand; in this context, the notation $f(\theta \mid x)$ is preferable, which suggests that the "data" $x$ are known.
I think it will do no harm to read the bar "given".
Comment: "in this context, the notation f(θ∣x) is preferable" Sorry but no. For each fixed $θ$, $f(\cdot\mid θ)$ is a PDF. For each fixed $x$, $f(x\mid θ)$ is the *likelihood* of the sample $x$ for the PDF $f(\cdot\mid θ)$, thus one should rather use the notation $L(θ\mid x)=f(x\mid θ)$ or, even better, $L_x(θ)=f_θ(x)$.
Comment: @Did That is mathematically correct, for sure; but for statisticians that I know, they do not put so much emphasis on this distinction. It depends on the OP's background; here is no room for "true" or "false", I am afraid.

What does the notation f(·|θ) mean?


image view e text view lado a lado no linear layout

Question: Tenho que colocar a imagem e o texto lado a lado porém não sei como fazer, meu código por enquanto:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="costamilam.guilherme.contatosempresariais.TelaAjuda">

<ScrollView
    android:id="@+id/sv_help"
    android:layout_width="0dp"
    android:layout_height="0dp"
    android:layout_marginBottom="8dp"
    android:layout_marginLeft="8dp"
    android:layout_marginRight="8dp"
    android:layout_marginTop="8dp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintHorizontal_bias="0.0"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintVertical_bias="0.0">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:weightSum="1">

        <ImageView
            android:id="@+id/imageView2"
            android:layout_width="143dp"
            android:layout_height="250dp"
            android:layout_marginTop="15dp"
            android:background="@drawable/shape"
            android:elevation="0dp"
            android:paddingBottom="2dp"
            android:paddingTop="2dp"
            app:srcCompat="@drawable/main_activity"
            android:layout_gravity="left" />

        <TextView
            android:id="@+id/textView2"
            android:layout_width="227dp"
            android:layout_height="match_parent"
            android:layout_gravity="right"
            android:layout_weight="0.96"
            android:text="TextView"
            tools:text="@string/tv_introducao" />

    </LinearLayout>
</ScrollView>
</android.support.constraint.ConstraintLayout>

Answer: Troca a orientação do LinearLayout para horizontal (android:orientation="horizontal"), se quiser que cada item ocupe metade da tela coloque o android:layout_weight de ambos com o valor 1 (define o "peso" de cada view pelo que entendi dele). Se quiser colocar outras views em baixo você pode fazer um LinearLayout na vertical e dentro dele colocar o LinearLayout na horizontal
Comment: funciono, valeu


Programmatically created nodes are shown only after re-saving

Question: I'm creating a lot of nodes programmatically in a custom module. These nodes are showing up on admin/content and in a default view display (unformatted/fields), but not in a calendar view display. Only if I open and resave, those nodes will be shown in the calendar view.
Why is this happening? All nodes are published.
Comment: SOLVED: I was using a timestamp for the generated dates, it needed to be a string like: "1967-01-15T00:00:00". I needed to look up the values in my database directly, devel / dpm() did not show a difference.
Comment: Does anything change in the node's devel page after re-saving?
Comment: Thanks for poining me that direction, Niall. You're right, the "path" array (one value in there: "1") is missing in my created nodes. This could be coming from pathauto, can this be the reason for my nodes to not show up?
Comment: The missing path was not the problem.. I've added "$node->path['pathauto'] = TRUE;" before node->save($node). Now the path alias is present, but the nodes are still missing in the calendar.
Answer: SOLVED: I was using a timestamp for the generated dates, but it needed to be a string like: "1967-01-15T00:00:00". I needed to look up the values in my database directly, devel / dpm() did not show a difference.


MARS for binary outcomes

Question: Is it possible to use Multiple Adaptive Regression Splines for predicting a binary outcome?
Comment: See section 13.4. http://www.milbo.org/doc/earth-notes.pdf
Answer: I just tried it using R's earth package and it worked. I used a subset of the Iris data set, choosing only two Species, and it chose all four of the predictors and 8 of 15 terms. It appears to predict reasonably.
So the answer seems to be Yes.
Call: earth(formula=Species~., data=a)

                    coefficients
(Intercept)            0.2649069
h(5.5-Sepal.Length)    0.5429979
h(3.2-Sepal.Width)     0.2234503
h(Petal.Length-4.6)    0.5164827
h(Petal.Length-5.3)   -0.6734858
h(5.8-Petal.Length)   -0.2360982
h(Petal.Width-1.7)     5.0733963
h(Petal.Width-1.8)    -5.1097885

Selected 8 of 15 terms, and 4 of 4 predictors
Termination condition: Reached nk 21
Importance: Petal.Width, Petal.Length, Sepal.Length, Sepal.Width
Number of terms at each degree of interaction: 1 7 (additive model)
GCV 0.04134384    RSS 2.987092    GRSq 0.8379156    RSq 0.8805163

and the data
> str (a)
'data.frame':   100 obs. of  5 variables:
 $ Sepal.Length: num  7 6.4 6.9 5.5 6.5 5.7 6.3 4.9 6.6 5.2 ...
 $ Sepal.Width : num  3.2 3.2 3.1 2.3 2.8 2.8 3.3 2.4 2.9 2.7 ...
 $ Petal.Length: num  4.7 4.5 4.9 4 4.6 4.5 4.7 3.3 4.6 3.9 ...
 $ Petal.Width : num  1.4 1.5 1.5 1.3 1.5 1.3 1.6 1 1.3 1.4 ...
 $ Species     : Factor w/ 2 levels "versicolor","virginica": 1 1 1 1 1 1 1 1 1 1 ...

and the confusion matrix:
> table (a$Species, predict (e) > 0.5)

             FALSE TRUE
  versicolor    49    1
  virginica      2   48

Answer: Yes. to expand on @Wayne, From the earth package's tutorial "Notes on the earth package":
13.4  Can I use earth with a binary response?Yes. Typically you want to predict a probability. Usually the best way to proceed is:

(i) Convert your binary response to alogical, if it isn't that already. To do the conversion, you can use code like this: `data$response <- data$response == "survived"`

Actually, you don't necessarily have to do that.  Although a response of type logical is canonical in this situation, if you prefer you could also use a two-level factor or a 1s-and-0s response. Earth doesn't mind.

(ii) Include `glm=list(family=binomial))`in your call to `earth`. This tells earth to build a model that estimates response probabilities.

See Section4.1(i) for an example, and the rest of that chapter for details

MARS for binary outcomes


Foreign Key Constraint Mysql

Question: I'm trying to create a relationship between a blog and an image, where a blog can have at most one image (think like avatar), but it can also have none.  Therefore, I put the foreign key on the blogs table.  I was trying to create a constraint on the images table where if the blog gets deleted, its associated image also gets deleted from the database.  However, I'm not sure how to create the constraint when the foreign key is not in the table that should be cascading.  Here's my tables, minus those fields that aren't relevant:
CREATE TABLE `blogs` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `image_id` int(10) unsigned default NULL,
  PRIMARY KEY  (`id`),
) ENGINE=InnoDB AUTO_INCREMENT=921 DEFAULT CHARSET=utf8;

CREATE TABLE `images` (
  `id` int(10) unsigned NOT NULL auto_increment,
  PRIMARY KEY  (`id`),
) ENGINE=InnoDB AUTO_INCREMENT=251021 DEFAULT CHARSET=utf8

Any help?
Answer: The only reason to have the images in a separate table would be if the same image could be shared by multiple blogs.  In that case you would not want to delete on cascade anyway.  You would need special logic to determine if there were no blogs left that referenced that image to delete it -- something that you could not do through DDL.
Instead, simply make the image values nullable columns on the blogs table.
Comment: I didn't mention it, but images are being used in other ways as well, such as images in blog posts, so I thought it would make sense to store them all the same way.  However, I will consider just storing the path directly as you said, as that may turn out to be the best solution anyways.

Foreign Key Constraint Mysql


pm-update fails updating drupal-core and deletes everything

Question: I need to update drupal install (core files + some contrib modules) through drush but as I run drush up it first correctly update the contrib modules but then fails on updating the core.
The main issue is that everything in the root directory is deleted and so is drush installation, plus a new folder (drupal 7.39) containing the new partial installation is created in the root.
This is the output:
(uiserver):uSOMENUMBER:~ > drush upc
Update information last refreshed: Ven, 08/21/2015 - 00:19
 Name                                  Installed Version  Proposed version  Message
 Drupal                                7.38               7.39              SECURITY UPDATE available
 Advanced CSS/JS Aggregation (advagg)  7.x-2.14           7.x-2.15          Aggiornamento disponibile
 Chaos tools (ctools)                  7.x-1.7            7.x-1.9           SECURITY UPDATE available
 Markup (markup)                       7.x-1.1-beta1      7.x-1.2           Aggiornamento disponibile
 Metatag (metatag)                     7.x-1.5            7.x-1.7           Aggiornamento disponibile

NOTE: A security update for the Drupal core is available.
Drupal core will be updated after all of the non-core projects are updated.

Security and code updates will be made to the following projects: Advanced CSS/JS Aggregation [advagg-7.x-2.15], Chaos tool suite (ctools) [ctools-7.x-1.9], Markup [markup-7.x-1.2], Metatag [metatag-7.x-1.7]

Note: A backup of your project will be stored to backups directory if it is not managed by a supported version control system.
Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.
Do you really want to continue with the update process? (y/n): y
Project advagg was updated successfully. Installed version is now 7.x-2.15.
Backups were saved into the directory /*/*/*/*/htdocs/drush-backups/*/*/modules/advagg.                                     [ok]
Project ctools was updated successfully. Installed version is now 7.x-1.9.
Backups were saved into the directory /*/*/*/*/htdocs/drush-backups/*/*/modules/ctools.                                     [ok]
Project markup was updated successfully. Installed version is now 7.x-1.2.
Backups were saved into the directory /*/*/*/*/htdocs/drush-backups/*/*/modules/markup.                                     [ok]
Project metatag was updated successfully. Installed version is now 7.x-1.7.
Backups were saved into the directory /*/*/*/*/htdocs/drush-backups/*/*/modules/metatag.                                    [ok]

Code updates will be made to drupal core.
WARNING:  Updating core will discard any modifications made to Drupal core files, most noteworthy among these are .htaccess and robots.txt.  If you have made any modifications to these files, please back them up before updating so that you can re-create your modifications in the updated version of the file.
Note: Updating core can potentially break your site. It is NOT recommended to update production sites without prior testing.

Do you really want to continue? (y/n): y
Unable to load class \Drush\VersionControl\Backup                                                                                [error]
Unable to load class \Drush\VersionControl\Backup                                                                                [error]
(uiserver):uSOMENUMBER:~ > ls
drupal-7.39  logs  sites

I'm on a 1and1 shared hosting and followed this guide for a proper installation.
Minor changes I did from what the guide says are:

Disregarding the paragraph on access from remote machine & aliasing (as I'm not interested in it)
Using php5.5-cli instead of php5.5 for DRUSH_PHPexport in my .bash_profile: this was done to fix this issue (anyway it fails even by using php5.5).

I'm using drush 8.0-dev.
This is the file structure before updating:
(uiserver):uSOMENUMBER:~ > ls -la
total 39808
drwx---r-t 16 uSOMENUMBER ftpusers     4096 Aug 21 00:56 .
drwxr-xr-t  6 root      root         4096 Aug 21 00:14 ..
-rw-------  1 uSOMENUMBER ftpusers      638 Jul 27 13:23 .bash_history
-rwx---r-x  1 uSOMENUMBER ftpusers      764 Aug 20 22:54 .bash_profile
-rwx---r-x  1 uSOMENUMBER ftpusers      507 Jul  2 15:36 .bashrc
drwx---r-x  4 uSOMENUMBER ftpusers     4096 Jul  2 15:36 .composer
drwx---r-x  3 uSOMENUMBER ftpusers       32 Jul  2 15:36 .drush
-rw----r--  1 uSOMENUMBER ftpusers      174 Jun 21 10:51 .gitignore
-rw----r--  1 uSOMENUMBER ftpusers     5826 Jul  2 15:52 .htaccess
drwx---r-x  3 uSOMENUMBER ftpusers      124 Aug 21 00:46 .subversion
-rw----r--  1 uSOMENUMBER ftpusers    98401 Jun 21 10:51 CHANGELOG.txt
-rw----r--  1 uSOMENUMBER ftpusers     1481 Jun 21 10:51 COPYRIGHT.txt
-rw----r--  1 uSOMENUMBER ftpusers     1717 Jun 21 10:51 INSTALL.mysql.txt
-rw----r--  1 uSOMENUMBER ftpusers     1874 Jun 21 10:51 INSTALL.pgsql.txt
-rw----r--  1 uSOMENUMBER ftpusers     1298 Jun 21 10:51 INSTALL.sqlite.txt
-rw----r--  1 uSOMENUMBER ftpusers    17995 Jun 21 10:51 INSTALL.txt
-rw----r--  1 uSOMENUMBER ftpusers    18092 Jun 21 10:51 LICENSE.txt
-rw----r--  1 uSOMENUMBER ftpusers     8167 Jun 21 10:51 MAINTAINERS.txt
-rw----r--  1 uSOMENUMBER ftpusers     5382 Jun 21 10:51 README.txt
-rw----r--  1 uSOMENUMBER ftpusers     9642 Jun 21 10:52 UPGRADE.txt
-rw----r--  1 uSOMENUMBER ftpusers     6604 Jun 21 10:51 authorize.php
drwx---r-x  2 uSOMENUMBER ftpusers       48 Jul  2 15:34 bin
-rw----r--  1 uSOMENUMBER ftpusers      720 Jun 21 10:51 cron.php
-r-----r--  1 uSOMENUMBER ftpusers 40437884 Aug 20 23:26 d.tgz
-rw----r--  1 uSOMENUMBER ftpusers      872 Jul 28 18:29 drupal-update.sh
drwx---r-x  4 uSOMENUMBER ftpusers       84 Aug 20 22:36 drush-backups
drwx---r-x  4 uSOMENUMBER ftpusers     4096 Jun 21 10:53 includes
-rw----r--  1 uSOMENUMBER ftpusers      529 Jun 21 10:51 index.php
-rw----r--  1 uSOMENUMBER ftpusers      703 Jun 21 10:51 install.php
drwxr-xr-x  3 root      root         4096 Aug 21 00:14 logs
drwx---r-x  4 uSOMENUMBER ftpusers     8192 Jun 21 10:53 misc
drwx---r-x 42 uSOMENUMBER ftpusers     4096 Jun 21 11:00 modules
-rw----r--  1 uSOMENUMBER ftpusers      105 Nov  3  2014 php.ini
drwx---r-x  5 uSOMENUMBER ftpusers       98 Jun 21 10:51 profiles
-rw----r--  1 uSOMENUMBER ftpusers     1479 Jun 21 10:51 robots.txt
drwx---r-x  2 uSOMENUMBER ftpusers     4096 Jun 21 10:52 scripts
drwx---r-x  4 uSOMENUMBER ftpusers      144 Aug 20 22:36 sites
-rwx---r-x  1 uSOMENUMBER ftpusers      128 Aug 20 22:11 test.sh
drwx---r-x  7 uSOMENUMBER ftpusers     4096 Jun 21 10:53 themes
-rw----r--  1 uSOMENUMBER ftpusers    19986 Jun 21 10:52 update.php
-rw----r--  1 uSOMENUMBER ftpusers     2178 Jun 21 10:52 web.config
drwx---r-x  2 uSOMENUMBER ftpusers       74 Nov  3  2014 webscripts
-rw----r--  1 uSOMENUMBER ftpusers      417 Jun 21 10:52 xmlrpc.php

How can this be fixed?
Answer: I was having a similar issue. I tried to run drush up drupal and it was returning Unable to load class \Drush\VersionControl\Backup. I can confirm that removing drush from my composer.json file solved this issue. My steps were: remove drush from the composer.json, run composer update and then re-run drush up drupal.
I'm also using Drupal 8.1.9. Just updated to 8.2.
Hope this also helps others.
Thanks Marco.
Comment: I know this is old, but... what if you *only* have Drush installed in `/usr/local/bin/drush` and still get the `Unable to load class \Drush\VersionControl\Backup` error?
Comment: Actually, I followed your steps and *still* get the `…Backup` error. Weird. :(
Answer: After some testing, I found a solution: although installing drush in the same drupal folder may work for updating single modules, it will break your site if you try to update the core.
Apparently, you should never install drush in the same folder of drupal.
So the issue is solved by moving the drupal installation into ~/drupal/ and install drush into ~/.
Answer: You are using Drush 8, but your Drupal is Drupal 7. Try to use Drush 7.
Comment: I tried this - it doesn't work.
Comment: This issue has appeared with Drupal 7.57 and downgrading Drush 8 to 7 solved the issue to me. Thanks @ccosta


Flutter animated rotation with relayout

Question: I need to rotate a widget with animation and perform relayout.
RotatedBox does just what I want but without animation.
I used TweenAnimationBuilder and Transform.rotate. They do animated rotation, but keep width constraints and don't resize the child.
<code>  Widget build(BuildContext context) {
    return TweenAnimationBuilder<double>(
      tween: Tween<double>(begin: 0, end: pi / 2),
      duration: const Duration(milliseconds: 500),
      builder: (BuildContext context, double angle, Widget? child) {
        return Transform.rotate(
          angle: angle,
          child: Stack(
            children: [
              Image.network('https://i.imgur.com/Xl3LjXZ.jpeg'),
              Image.network('https://i.imgur.com/tF3g1JA.jpeg',
                  width: 30, height: 30),
            ],
          ),
        );
      },
    );
  }
</code>
I can use scale transform but I don't want all the widgets in the child to be scaled.
How can I do animated rotation with child relayout? Thanks.
Dartpad example (make the result frame narrow like mobile device)
Answer: I guess I've found the solution.
I use rotation and scale to make an animation and after animation is finished I change my widget to RotatedBox.
Dartpad code

Flutter animated rotation with relayout


inner div passes outside of outer div

Question: I have an inner DIV which keeps passing outside of the parent div at the bottom only.
I'm reluctant to change the mobileArea settings as its part of my dreamweaver FGL.css
CSS:
#mobileArea {
clear: both;
float: left;
margin-left: 0;
margin-top: -1252px;
width: 100%;
width: calc(100% - 10px);
height: 830px;
display: block;
}

.mobileContent{
display: block;
height: auto;
margin-left:2px;
margin-right:2px;
margin-bottom: 0px;
overflow-y: auto;
overflow-x: hidden;
border: solid;
border-color: #1D7C06;
 }

I've tried about every combination of things (apart from the correct thing), and can't understand why margin-bottom is not working.  I bet this is really simple but I cant find many similar posts.
Setup

  No Set Height as it needs to change in size

 No Set Height as it needs to change in size

displays after links on a new line OK,
       but continues out of parent div.

Comment: First, it should be `id="mobileArea"` instead of `name=....`
Comment: Perhaps you could construct a live example on a site like http://jsfiddle.net/ That will help distinguish if mistakes like Maxime just pointed out (and you still have wrong - you have a `#` in the `id=` attribute) are the source of your problem or just mistakes in the example.
Comment: The website is www.allcoles.co.uk, then if you resize the window to very small.  You should see the issue I've got.  I just wanted to make it a little simpler for others with the same problem.
Comment: It is not clear what you are trying to achieve. Why the enormous negative margin? Also try to better describe what you want and what goes wrong ...
Comment: Your URL doesn't work for me.
Answer: I think the Missing Id is just an TYPO
delete few css properties
#mobileArea {
 **clear: both;**Remove this line
 ....
 ....

 }

hope this would work
Answer: #mobileArea {
    overflow: scroll;

The CSS style for overflow need to be applied to mobileArea and not the child div.
Comment: Inside my child div are further divs.  So I require the child div to have the scroll.
Answer: Is this your site? - http://www.allcoles.com/
This will fix the position and make mobile main area a scrollable area:
.mobileContent - remove position:absolute
#mobileMainArea - overflow:scroll;

Of course you would want to throw this into a media query, since it looks like the page breaks at 706px you can do:
@media all and (max-width: 706px){
    .mobileContent - remove position:absolute
    #mobileMainArea - overflow:scroll;
}

Hope I understood your question correctly.
Comment: Thanks Mario, I have made some progress doing what I want it to do.  By changing mobileContent to absolute and bottom to 0pt, I had to change mobileMainArea to relative.  This has stopped it overflowing downwards, no I just got to work out how to stop it spilling over on the links and logo in the mobile sizes
Comment: Remove the following from .mobileContent - position, bottom, left, right, top. And add the following to #mobileMainArea - overflow-y:scroll;
Comment: Hi Mario, I want the child div to scroll with the content not the parent.  As there are further divs in the child div.
Comment: Set .mobileContent{height:695px;} ?
Comment: See that works and gives the effect I want, however if the links go down a line it still shifts it a little off the bottom

inner div passes outside of outer div


React Native Scrolling of list not working within scrollable view for Android

Question: My React Native app has a long view and the view shows scrollable lists.
<code>  const TOTAL_LISTS = 20;
  const lists = [];
  for (let i = 0; i < TOTAL_LISTS; i++) {
    lists.push(
      <ScrollView style={{ height: 50, margin: 10 }}>
        <Text>1</Text>
        <Text>2</Text>
        <Text>3</Text>
        <Text>4</Text>
        <Text>5</Text>
      </ScrollView>
    );
  }

  return (
    <ScrollView scrollEventThrottle={10}>
      <Text>Before Text</Text>
      <Text>Before Text2</Text>
      {lists}
      <Text>After Text</Text>
      <Text>After Text2</Text>
    </ScrollView>
  );
</code>
If the main view does not go beyond screen view (eg. TOTAL_LISTS = 2) then the lists are still scrollable for Android. However, if the main view goes beyond the screen (eg. TOTAL_LISTS = 20) the lists are not scrollable because it only scrolls the main view. This does not happen to IoS devices.
I am using Xiaomi Android 10.
Is there any way to fix the issue?
Answer: https://stackoverflow.com/a/51934761/5733033
<code><ScrollView {...parentProps}>
  <ScrollView {...childProps} nestedScrollEnabled={true}>
  </ScrollView>
</ScrollView>
</code>


Running grunt "concurrent:test" Aborted due to warnings

Question: I'm using a Yeoman angular generator and when I run this code I get grunt exiting with a warning. I'm running inside debian wheezy and have run these commands before running grunt:
sudo apt-get install ruby           &&
sudo gem install sass compass       &&
npm install                         &&
sudo npm install -g grunt-cli       &&
sudo npm install -g bower           &&

gruntfile.js:
 grunt.registerTask('test', [
    'clean:server',
    'concurrent:test',
    'autoprefixer',
    'connect:test',
    'karma'
  ]);

 test: {
        options: {
          port: 9001,
          base: [
            '.tmp',
            'test',
            '<%= yeoman.app %>'
          ]
        }
      },

Warning:
Running "concurrent:test" (concurrent) task
    Warning:  Use --force to continue.

        Aborted due to warnings.

Execution Time (2014-04-02 13:58:03 UTC)
concurrent:test  1.1s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 99%
Total 1.1s
Process finished with exit code 6

Comment: i had this error because of some wack scss syntax I'd written
Answer: Grunt exit code 6 is less than helpful, but the real point it is trying to tell you is that your tests had warnings (read: problems) in them and you should look at them. I would also suggest turning on JSHint or JSLint in your IDE and see what it comes up with. Running tests on a fresh install should work right out of the box, and having them failing is usually a sign of bad configuration, so check that too. Lastly, you might try re-installing Yeoman and making sure that every module installs without a problem.
Comment: I reinstalled yeoman and things are working better, was still  missing some karma plugins http://stackoverflow.com/a/22395388/1339087
Answer: I just experienced this as well.
After reading this thread I looked into my grunt file and found that concurrent:test was running compass.
I ran 'grunt compass' and saw a better error message.
Comment: This is what helped me - thx for posting.  I had pasted some invalid less code into my scss file and running grunt compass allowed me to find it and remove it.
Comment: This helped me. Thank you.


Show Alert dialog box while proceeding to next page in android

Question: I have 4 button options without clicking any one  of the options and  I am proceeding to next page it should show an alert dialog box.
if(btnOpt_1.equals(btnOpt_1)&&btnOpt_2.equals(btnOpt_2)&&btnOpt_3.equals(btnOpt_3)||btnOpt_4.equals(btnOpt_4)||btnOpt_5.equals(btnOpt_5)){
<code>    AlertDialog.Builder alertDialog = new AlertDialog.Builder(Feedback.this);

    // Setting Dialog Title
    alertDialog.setTitle("OOPs");

    // Setting Dialog Message
    alertDialog.setMessage("You can't proceed without selecting");

    // Setting Icon to Dialog

    // Setting Positive "Yes" Button
    alertDialog.setPositiveButton("YES", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog,int which) {

        // Write your code here to invoke YES event
        Toast.makeText(getApplicationContext(), "You clicked on YES", Toast.LENGTH_SHORT).show();
        dialog.cancel();
        }
    });

    // Setting Negative "NO" Button

    // Showing Alert Message
    alertDialog.show();
}

}
</code>
Comment: Try to do it in onResume().
Answer: Try this way,hope this will help you to solve your problem.
<code>    private Button btnOpt_1;
    private Button btnOpt_2;
    private Button btnOpt_3;
    private Button btnOpt_4;
    private Button btnNext;
    private int selectedOption;

        btnOpt_1 = (Button) findViewById(R.id.btnOpt_1);
        btnOpt_2 = (Button) findViewById(R.id.btnOpt_2);
        btnOpt_3 = (Button) findViewById(R.id.btnOpt_3);
        btnOpt_4 = (Button) findViewById(R.id.btnOpt_4);
        btnNext = (Button) findViewById(R.id.btnNext);

        selectedOption=0;
        btnOpt_1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                selectedOption=1;
            }
        });

        btnOpt_2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                selectedOption=2;
            }
        });

        btnOpt_3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                selectedOption=3;
            }
        });

        btnOpt_4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                selectedOption=4;
            }
        });

        btnNext.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(selectedOption==0){
                    AlertDialog.Builder alertDialog = new AlertDialog.Builder(Feedback.this);

                    // Setting Dialog Title
                    alertDialog.setTitle("OOPs");

                    // Setting Dialog Message
                    alertDialog.setMessage("You can't proceed without selecting");

                    // Setting Icon to Dialog

                    // Setting Positive "Yes" Button
                    alertDialog.setPositiveButton("YES", new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog,int which) {

                            // Write your code here to invoke YES event
                            Toast.makeText(getApplicationContext(), "You clicked on YES", Toast.LENGTH_SHORT).show();
                            dialog.cancel();
                        }
                    });

                    // Setting Negative "NO" Button

                    // Showing Alert Message
                    alertDialog.show();
                }else{
                    // write your code here and you also track which option button is click using  selectedOption value.
                }
            }
        });

    }
</code>
Answer: Try this ... run your alert dialog on ui thread ...
<code>    if(btnOpt_1.equals(btnOpt_1)&&btnOpt_2.equals(btnOpt_2)&&btnOpt_3.equals(btnOpt_3)||btnOpt_4.equals(btnOpt_4)||btnOpt_5.equals(btnOpt_5)){

runOnUiThread(new Runnable() {

@override
public void run() {

if(!isFinishing()){
    AlertDialog.Builder alertDialog = new AlertDialog.Builder(Feedback.this);

    // Setting Dialog Title
    alertDialog.setTitle("OOPs");

    // Setting Dialog Message
    alertDialog.setMessage("You can't proceed without selecting");

    // Setting Icon to Dialog

    // Setting Positive "Yes" Button
    alertDialog.setPositiveButton("YES", new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog,int which) {

        // Write your code here to invoke YES event
        Toast.makeText(getApplicationContext(), "You clicked on YES", Toast.LENGTH_SHORT).show();
        dialog.cancel();
        }
    });

    // Setting Negative "NO" Button

    // Showing Alert Message
    alertDialog.show();
}
});
}
</code>


machine learning with linear regression algorithm

Question: I'm noob in machine learning, but I'm trying to know more about it.
I have a question about a prediction model (predict for every page when the number of click) how can I do with no data in some columns.
Should I drop these rows?
Any idea please?
Thanks.
Answer: If you mean that some rows have missing data (missing attributes) you can:

a) Drop them (if they are no too many rows with missing attributes).

If you can't / don't want to drop them then:

b) Fill them using K-nearest neighbors.
c) Use some method that can deal with missing data.

Take a look, for instance, at this thread.
Comment: You're welcome @user17241. However, now the question is quite different and became a question about R, you should open a new question for that instead of changing the sense of the original that much. I guess the problem is that hotelX has not the right shape. Add the 'R' tag or even ask it in stack overflow. You might also show us the dimensions of hotelX, dim(hotelX)


Can't write duplicate key, using combined primary key

Question: I have two tables and I just want to keep a relation between them, users and combines, defined by the below
CREATE TABLE `shocase`.`combineScorers` (
  `combineId` INT NOT NULL,
  `userId` INT NOT NULL,
  `createdAt` DATETIME NOT NULL,
  `updatedAt` DATETIME NOT NULL,
  PRIMARY KEY (`combineId`, `userId`),
  INDEX `combineId_idx` (`combineId` ASC),
  INDEX `userId_idx` (`userId` ASC),
  CONSTRAINT `fk_combines_combineId`
    FOREIGN KEY (`combineId`)
    REFERENCES `shocase`.`combines` (`combineId`)
    ON DELETE NO ACTION
    ON UPDATE CASCADE,
  CONSTRAINT `fk_users_userId`
    FOREIGN KEY (`userId`)
    REFERENCES `shocase`.`users` (`userId`)
    ON DELETE NO ACTION
    ON UPDATE CASCADE);

Nothing too fancy, combineId and userId. Both are foreign keys to their respective tables, and I'm trying to create a combined primary key as (combineId, userId)
When ran I'm getting the below error

Error Code: 1022. Can't write; duplicate key in table 'combineScorers'
Answer: You are probably using a constraint with the name combineId or userId in your database. They should be unique for the entire database. If so rename them.
Search for where the constraints are currently in use:
SELECT `TABLE_SCHEMA`, `TABLE_NAME`
FROM `information_schema`.`KEY_COLUMN_USAGE`
WHERE `CONSTRAINT_NAME` IN ('combineId', 'userId');

Comment: so that did show a result, I changed its name, re-ran the original create... and I'm getting the same error still, any other ideas?
Comment: Can you export the db and post it here?
Comment: hrmm okay not sure but there was another constraint with that same name I just didn't see, once removed all working well, thanks


Is there a way to create a Text Format on install of a Drupal Module? And enable a Filter for my module?

Question: I want to do a custom filter that replaces certain text with HTML. Essentially shortcodes as done by Wordpress.
Unfortunately, the Filtered HTML Text Format strips most HTML.
So I created my own Text Format manually and enabled only my own Filter.
Is there a way to do this programmatically in the module.install file?
Answer: Using Features you can export your Text Formats in code and have it automatically configured.
You can configure the filter used for a text format and their order. You can also configure the HTML filter used in the default Filtered HTML text format to allow more HTML elements. So by either allowing the HTML element produced by your filter, and by moving your filter after the HTML filter, you can get your custom filter to work.
Answer: If you plan on releasing this module for anyone to use, I would not be 'overriding' any currently set/activated formats, as this will cause problems for existing data/nodes/etc. You should simply provide the functionality, and let people activate it as need be. If there are node bodies saved with 'filtered_html' and you disable 'filtered_html', these nodes will not display correctly, and you will make a lot of people unhappy. As such, Drupal probably doesn't provide functions/hooks for doing this (so you can't cause damage to existing data).
If this is just for your own website, you can do anything you want with the right code and manual database changes. I would question the effectiveness of having code doing it, compared to just setting it once manually in the admin.
You can create a filter on install, if that is what you want. See filter_format_save and an example of how to use it in filter.install


How can W3C CSS Validator identify a css3 document?

Question: I'm having a issue!
Is there a way to identify a css3 file for the W3C validator?
In the HTML5 we put <!DOCTYPE html> but in a CSS file what can we put?
When I validate my css file and it contains some css3 elements (@font-face, box-shadow, etc), it says that it's not valid! 'cause it doesn't know it's css3. So... is there a method?
Thanks so much. Davide.
Comment: For why it doesn't default to CSS3, see http://stackoverflow.com/questions/7041008/css-border-radius-validation-errors
Answer: No, CSS files have no self-identification feature. To validate a file against a particular version of CSS, you have to explicitly choose what version you want. In the W3C Validator, this can be chosen from the "Profile" menu under "More options".
CSS Level 3 is there, for what it's worth; until all CSS3 Modules are complete (don't hold your breath!) it's debatable what this really means...
Answer: James code broke because he didn't enclose it in code tags but here is the actual code
http://jigsaw.w3.org/css-validator/validator?profile=css3&usermedium=all&warning=1&vextwarning=&lang=en&uri=http%3A%2F%2Fwww.yourwebsitename.com%2F

However, this will break your W3C Markup Validation.
cannot generate system identifier for general entity "usermedium"

…/css-validator/validator?profile=css3&usermedium=all&warning=1&vextwarning=&la…

general entity "usermedium" not defined and no default entity

…/css-validator/validator?profile=css3&usermedium=all&warning=1&vextwarning=&la…

reference not terminated by REFC delimiter

…ator/validator?profile=css3&usermedium=all&warning=1&vextwarning=&lang=en&uri=…

reference to external entity in attribute value

…ator/validator?profile=css3&usermedium=all&warning=1&vextwarning=&lang=en&uri=…

reference to entity "usermedium" for which no system identifier could be generated

…ator/validator?profile=css3&usermedium=all&warning=1&vextwarning=&lang=en&uri=…

cannot generate system identifier for general entity "warning"

…validator?profile=css3&usermedium=all&warning=1&vextwarning=&lang=en&uri=http%…

I do find it strange that code generated by the W3C CSS validation service breaks the W3C Markup service. LOL
So pick your poison.  I'm sticking with W3C Markup Validation. :)
Answer: Use the folling link with your URL in place of the question (???) marks:
http://jigsaw.w3.org/css-validator/validator?profile=css3&usermedium=all&warning=1&vextwarning=&lang=en&uri=http%3A%2F%2F???


Cant configure Apache with Passenger + Rails

Question: I am only beginner and try to understand how to configure apach web-server for my RubyOnRails app. I have linux, installed apache2, passenger and apache2-module for passenger. While installing i got text like this
LoadModule passenger_module /home/rubys/.rvm/.../ext/apache2/mod_passenger.so
PassengerRoot /home/rubys/.rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.8
PassengerRuby /home/rubys/.rvm/wrappers/ruby-1.9.2-p290/ruby

I need add this to my apache config file, so, i use
$ apachectl -V | grep HTTPD_ROOT
$ apachectl -V | grep SERVER_CONFIG_FILE

file, which i need is here
/etc/apache2/apache2.conf

my rails app is here
/home/alexkd/WebDev/rails/depot

Also i have file in /etc/apache2/ports.conf with text like this
NameVirtualHost *:80
Listen80

What I have to copy to my apache2.conf? and where i have to add this:
<VirtualHost *:80>
   ServerName depot.yourhost.com
   DocumentRoot /home/alexkd/WebDev/rails/depot
   <Directory /home/alexkd/WebDev/rails/depot>
     AllowOverride all
     Options -MultiViews
   </Directory>
</VirtualHost>

Comment: You're not really clear on what is being asked. You might want to clear up exactly what problem you're having and how we can help.
Comment: In which file I need to add:  ... ? In apache2.conf? And In which file add passenger routes?
Comment: Can I write: "ServerName localhost"?
Comment: You are way out of your depth here @AlexKurmaev - You need to spend some quality time with an Apache tutorial, or alternatively [the Apache documentation](http://httpd.apache.org/docs/2.2/) and understand the configuration files before you start mucking about with Passenger. You're trying to build a skyscraper, but you haven't learned how to use a hammer yet...
Comment: I dont think so voretaq7
Answer: Your DocumentRoot must be set to the public directory of your Rails app.
For instance (it seems you're trying out the demo from the Rails book):
   DocumentRoot /home/alexkd/WebDev/rails/depot/public

Comment: Yes it is. I decided my problem with creating new file in /etc/apache2/sites-available' with ... and using 'RailsEnv development' there.


Why can you mix Partial Derivatives with Ordinary Derivatives in the Chain Rule?

Question: This question is a simplified version of this previous question asked by myself.
The following is a short extract from a book I am reading:

If $u=(x^2+2y)^2 + 4$ and $p=x^2 + 2y$ $\space$ then $u=p^2 + 4=f(p)$ therefore $$\frac{\partial u}{\partial x}=\frac{\rm d f(p)}{\rm d p}\times \frac{\partial p}{\partial x}=2xf^{\prime}(p)\tag{1}$$ and $$\frac{\partial u}{\partial y}=\frac{\rm d f(p)}{\rm d p}\times \frac{\partial p}{\partial y}=2f^{\prime}(p)\tag{2}$$

I know that the chain rule for a function of one variable $y=f(x)$ is $$\begin{align}\color{red}{\fbox{$\frac{{\rm d}}{{\rm d}x}=\frac{{\rm d}}{{\rm d}y}\times \frac{{\rm d}y}{{\rm d}x}$}}\color{red}{\tag{A}}\end{align}$$
I also know that if $u=f(x,y)$ then the differential is
$$\begin{align}\color{blue}{\fbox{${{\rm d}u=\frac{\partial u}{\partial x}\cdot{\rm d} x+\frac{\partial u}{\partial y}\cdot{\rm d}y}$}}\color{blue}{\tag{B}}\end{align}$$
I'm aware that if $u=u(x,y)$ and $x=x(t)$ and $y=y(t)$ then the chain rule is $$\begin{align}\color{#180}{\fbox{$\frac{\rm d u}{\rm d t}=\frac{\partial u}{\partial x}\times \frac{\rm d x}{\rm d t}+\frac{\partial u}{\partial y}\times \frac{\rm d y}{\rm d t}$}}\color{#180}{\tag{C}}\end{align}$$
Finally, I also know that if $u=u(x,y)$ and $x=x(s,t)$ and $y=y(s,t)$ then the chain rule is $$\begin{align}\color{#F80}{\fbox{$\frac{\partial u}{\partial t}=\frac{\partial u}{\partial x}\times \frac{\partial x}{\partial t}+\frac{\partial u}{\partial y}\times \frac{\partial y}{\partial t}$}}\color{#F80}{\tag{D}}\end{align}$$
Could someone please explain the origin or meaning of equations $(1)$ and $(2)$?
The reason I ask is because I am only familiar with equations $\color{red}{\rm (A)}$, $\color{blue}{\rm (B)}$, $\color{#180}{\rm (C)}$ and $\color{#F80}{\rm (D)}$ so I am not used to seeing partial derivatives mixed up with ordinary ones in they way they were in $(1)$ and $(2)$.
Many thanks,
BLAZE.
Comment: @BLAZE Would it make more sense to you if it were written as $\frac{\partial u}{\partial x}=\frac{\partial f}{\partial p}\times \frac{\partial p}{\partial x}$?  Because partial derivatives and ordinary derivatives are equivalent in the one-dimensional case.
Answer: This is often confusing because there is a conflation of the symbol for a function argument as opposed to a function itself. For example, when you write $f(p) = p^2 + 4$, you are thinking of $f$ as a function and $p$ as the argument of that function, which could be any dummy variable. In fact, let us write $f(\xi) = \xi^2+4$, which is the same function with simply another symbol representing the rule that $f$ implies. At the same time, you are using the symbol $p$ as a function $p(x,y) = x^2 + 2y$. Now, with the functions $f(\xi)$ and $p(x,y)$ you have $u(x,y) = f \circ p\,(x,y)$; that is, $u$ is the composition of $f$ with $p$. Hence, using the chain rule and suppressing the variables $x$ and $y$, you have
$$
\frac{\partial u}{\partial x} = f'(p)\, \frac{\partial p}{\partial x} = \frac{d f}{d \xi} (p) \, \frac{\partial p}{\partial x}
$$
where $f' = \frac{d f}{d \xi}$ since we changed the argument symbol of $f$ to $\xi$ -- notice that $\frac{d f}{d\xi}$ is still evaluated at the function $p$ by the chain rule. If we wanted to to explicitly show where the variables $x$ and $y$ would manifest, we would have
$$
\frac{\partial u}{\partial x}(x,y) = f'(p(x,y))\, \frac{\partial p}{\partial x}(x,y) = \frac{d f}{d \xi} (p(x,y)) \, \frac{\partial p}{\partial x}(x,y).
$$
Hopefully this helps.
Answer: The given function $u$ has two variables $x$ and $y$. So, it makes sense to talk about partial derivatives $\frac{\partial u}{\partial x}$ and $\frac{\partial u}{\partial y}$. While you take another 'variable' $p$ for $u$, then you have a function of one variable, but which is dependent of other two variables, and so is $u$ then.
In other words you have: $$\frac{\partial u(p(x,y))}{\partial x}=\frac{\partial u(p)}{\partial p}\frac{\partial p(x,y)}{\partial x}$$ and $$\frac{\partial u(p(x,y))}{\partial y}=\frac{\partial u(p)}{\partial p}\frac{\partial p(x,y)}{\partial y}.$$
Comment: Thanks for your answer. When you write $\cfrac{\delta u}{\delta x}$ do you mean $\cfrac{\partial u}{\partial x}$ as $\delta$ is not the same as $\partial$?
Comment: Much better thanks.


Help understand lecturers example

Question: My lecture gave us the following example and I am having trouble following it

Would √23(mod 209) not become √23(mod 11) and √23(mod 19)? How is he getting √4?
And also I do not know how to use the Chines remainder theorem and I would really appreciate someone helping me out by explaining to me how it is done in this question.
Comment: I think, only typo can explain this
Comment: Related : http://math.stackexchange.com/questions/633160/modular-arithmetic-find-the-square-root
Answer: $\sqrt 4$ seems to be a misprint. Note that the text continues with $\pm23^3$, which matches $\pm a^{(p+1)4}$ with $a=23$ and $p=11$. (Similarly for the last line).

How to find yolutions with CRT?
Note that $11$ is $\equiv 0\pmod{11}$ and $\equiv 11\pmod{19}$. Try to find a multiple of $11$ that looks simpler modulo $19$. For example $22$ is already "just" $3\pmod{19}$; take this times six to arrive at $12\cdot 11\equiv -1\pmod{19}$; now take the negative to find $(19-12)\cdot 11=77\equiv 1\pmod{19}$. So $77$ is $\equiv 0\pmod{11}$ and $\equiv 1\pmod {19}$.
Similarly, start with $19$, which is $-3\pmod {11}$; times four gives $-12\equiv -1$; thus $(11-4)\cdot 19\equiv1\pmod {11}$. Hence $133$ is $\equiv 1\pmod{11}$ and $\equiv 0\pmod {19}$.
This allows us to find a number that is $\equiv -1\pmod {11}$ and $\equiv +17\pmod{19}$, for example: Just take $(-1)\cdot 133+17\cdot 77$. All four combinations of $\pm1$ with $\pm17$ give different numbers (which you should of course reduce downto the range $0,\ldots,208$).
The trial-and-error approach used above to find base solutions that are $\equiv1$ modulo one prime and $\equiv0$ modulo the other(s) can be made systematic with the extended Euklidean algorithm.

Help understand lecturers example


Mark only Event's start date on calendar?

Question: I am using calendar module, I created a view of calendar type that showing the event start date and end date. I just only want to mark the start date of event (Like change the background color.). How to do that?
Currently showing like this :
Answer: Try setting the end date the same as the start date
Comment: I know it will work but if end date can be differ so how to setup it in view? I can do it with an another end date field. But I preferred it to work in view.
Answer: I took different Start date and End date field.


C++ Checking for identical values in 2 arrays

Question: I have 2 arrays called xVal, and yVal.
I'm using these arrays as coords. What I want to do is to make sure that the array doesn't contain 2 identical sets of coords.
Lets say my arrays looks like this:
int xVal[4] = {1,1,3,4};
int yVal[4] = {1,1,5,4};

Here I want to find the match between xVal[0] yVal[0] and xVal[1] yVal[1] as 2 identical sets of coords called 1,1.
I have tried some different things with a forLoop, but I cant make it work as intended.
Comment: It will be much easier to do if you have just one array of coords, perhaps modeled as `std::pair`.
Answer: You can write an explicit loop using an O(n^2) approach (see answer from x77aBs) or you can trade in some memory for performance. For example using std::set
bool unique(std::vector<int>& x, std::vector<int>& y)
{
    std::set< std::pair<int, int> > seen;
    for (int i=0,n=x.size(); i<n; i++)
    {
        if (seen.insert(std::make_pair(x[i], y[i])).second == false)
            return false;
    }
    return true;
}

Answer: You can do it with two for loops:
int MAX=4; //number of elements in array
for (int i=0; i<MAX; i++)
{
    for (int j=i+1; j<MAX; j++)
    {
        if (xVal[i]==xVal[j] && yVal[i]==yVal[j])
        {
            //DUPLICATE ELEMENT at xVal[j], yVal[j]. Here you implement what
            //you want (maybe just set them to -1, or delete them and move everything
            //one position back)
        }
    }
}

Small explanation: first variable i get value 0. Than you loop j over all possible numbers. That way you compare xVal[0] and yVal[0] with all other values. j starts at i+1 because you don't need to compare values before i (they have already been compared).
Edit - you should consider writing small class that will represent a point, or at least structure, and using std::vector instead of arrays (it's easier to delete an element in the middle). That should make your life easier :)
Comment: This is a really bad approach in general because it is O(n²).
Answer: int identicalValueNum = 0;
int identicalIndices[4]; // 4 is the max. possible number of identical values
for (int i = 0; i < 4; i++)
{
    if (xVal[i] == yVal[i])
    {
        identicalIndices[identicalValueNum++] = i;
    }
}
for (int i = 0; i < identicalValueNum; i++)
{
    printf(
        "The %ith value in both arrays is the same and is: %i.\n",
        identicalIndices[i], xVal[i]);
}

For
int xVal[4] = {1,1,3,4};
int yVal[4] = {1,1,5,4};

the output of printf would be:

The 0th value in both arrays is the same and is: 1.
The 1th value in both arrays is the same and is: 1.
The 3th value in both arrays is the same and is: 4.
Comment: S/He's trying to solve a different problem; given a list of 2d points s/he wants to know if all points are distinct or not. The problem in the example is not that the point is `(1, 1)` (i.e. that `x == y`) but that is stored **twice** in the list.