Is stretching my fingers on the piano healthy?

Question: I'm currently playing a piece which requires big stretches of large intervals across the keyboard. It slightly hurts when I do so, and I am wondering if I should continue to practise like this.

My piano teacher suggests fingerings with a combination of 3 1 and 2 1 in the L.H.
Comment: Can you put up a pic of the music you are playing and tell what fingering you are using to cover those notes?
Comment: You also probably need to be more specific as to what hurts. Is it the stretching of your fingers that hurt or the scraping of the keys against your fingers? And a picture of your hand position on the chord (to the best of your ability, before it hurts) would help address any posture and technique issues.
Answer: Don't persist in doing anything that hurts.
As commented, if you show us the passage in question we might be able to suggest a strategy.
Comment: I've played the violin for over 20 years. You're not suppose to play when the callouses hurt, because it means there is injury. You're suppose to let it heal and then it'll hurt less, then you repeat the practice / healing process until the callouses stop hurting. If you notice your callouses are always hurting and it never gets better, then there may be underlying issues that should be addressed. Continued practice won't help you.
Comment: Getting callouses hurts; don't ever play a stringed instrument.
Answer:
It slightly hurts when I do so

Huge cue! You should never ever insist with something that hurts and that could damage you in any way. If somebody recommends some kind of exercise,  but when you do it, it hurts, the exercise just isn't right, or you are not doing it right, or the exercise doesn't work for you. Either way, you should never go through pain to achieve anything.
So, shortly:

I am wondering if I should continue to practise like this.

No.
Comment: @Kaz On the contrary, I fell on my wrists as a teenager and continued playing softball. I wrecked my wrists so bad that I couldn't turn doorknobs for 3 months. I still have not fully recovered 20 years later. When something hurts, you have to intelligently assess what is causing the problem.
Comment: I suspect you've never done any sport seriously.
Comment: @Kaz There's a huge difference between pain inherent to the activity (muscle strain or fatigue in sports, i.e. "feel the burn") and pain that is antithetical to the activity (pulled/torn muscle, sprained ankle, broken wrist, etc). If you're doing something that hurts _when it isn't supposed to hurt_, you should stop immediately and assess the situation.
Comment: @Kaz I suspect you've never studied any instrument seriously if you think you can compare it to doing sports, and thus justify pain. Abion's last sentence sums it up pretty well.
Comment: @Kaz Again, you are describing discomfort inherent to the activity. Taking your stretching example, some pulling discomfort and maybe even a little soreness is expected. If you feel a sharp tearing pain, however, you should immediately stop, as you are doing something that you should not be doing and continuing to do it could result in significant and maybe even permanent injury. OP didn't describe their fingers stretching or feeling discomfort, they described pain. As such, it's good advice to stop at least until they know what the cause of the pain is.
Comment: @Nelson I think moderation is the key. Never doing anything that hurts is likely to hold you back, but doing things aggressively when they hurt a lot will likely lead to serious consequences/injuries. The trouble is there are differences in pain perception and things that some people describe as discomfort others call pain. In fitness training burning/mild muscle pain is generally encouraged whereas strong or concentrated pain should be avoided.
Comment: @DRF moderation is not necessarily good medical advice. At the time, it really didn't hurt at all. My adrenaline and pain blockers kicked in and I didn't feel pain at all (swinging the bat, catching the ball). It only got REALLY bad after dinner and by next morning, I couldn't turn doorknobs. If you don't know why something hurts, you need to stop and seek medical advice. If you know why something hurts, then you should know what is hurting and what the foreseeable damages are, and assess the risk. It really comes down to knowing the root cause and not whether it is moderate or not.
Comment: Joint pain and other types of deep body issues don't necessarily hurt. I just came back from a middle ear infection diagnosis and that didn't hurt at all. The doctor told me it was generating pus, and that's what caused the ear blockage. I had to do a follow-up in 3 days to make sure it is going away. You need to know **WHY** something is hurting. Never judge an injury by how much you can "handle" the pain.
Comment: @Nelson Good point. Knowing why the things hurt is definitely essential. I retract my comment.
Comment: @Abion47 Indeed there is a big difference! Blurring that difference is a strawman argument and that was made against me; I insinuated no such thing as that broken wrists from a fall are inherent to softball, through which players should keep training and playing. If you stretch your fingers as much as you can (without any external force) and you feel some discomfort due to the tightness, that is an example of something inherent to what you're doing that you are supposed to feel, and not an injury. I can reproduce that feeling right now and so can just about anyone; I am not injured in any way.
Answer: Sadly, some piano music simply can't be played as written with small hands without some modification.  If you're trying to play certain pieces by, say, Liszt or Rachmaninoff (two famously large-handed performers - seriously, they still make plaster casts of their hands so you can compare to an average human - they're enormous), you may not be able do as wide a spread as they could, and so some music they wrote may be physically beyond your capability.  There are exercises you can do to increase your hand span, but they can only take you so far.  You may find you need to roll chords rather than play all the notes at once, or even omit or transpose some notes if your hands cannot reach them all.  Many publishers include suggested variations for small hands on some difficult passages.
Answer: Since we can't see the score, and we don't know exactly what you are trying to do, it's hard to answer this, except by saying:
Whatever you are doing, it is the wrong technique to play the piece, so stop doing it before you injure your hands permanently.
Comment: No, it's either bad technique, or too small hands, or not enough of stretching from years of playing.
Answer: In my piano lessons I was told the story in which famous composer Schumann permanently damaged his fingers by performing excessive stretching exercises:

(...) that Schumann damaged his finger by using a mechanical device that held back one finger while he exercised the others—which was supposed to strengthen the weakest fingers

(From Wikipedia)
This story (I really see it as a story, I think it's historically unproven) was told to me to teach me the following things:

Every piano player knows the situation that your fingers seem too weak or not stretched enough, that's normal on every skill level.
It's not possible to force rapid performance boosts, especially not by enduring physical pain. Controlled practice with patience is all you can do.
Respect your hands! Yes, you can practice finger strength or range with the right exercises, but if there is any risk in damaging/hurting them, stop.
Answer: Never do something that is causing pain.  If your hand cannot do the "stretch" you may have to shift.  Is the stretch for a chord or a single note run?
I would like to add to this that in general it is a good ideal to stretch before playing as a warm up.  But never to the point of pain.  We all have to deal wit our individual physical limits.  Perhaps in time your body will adjust to get the reach it needs but if it's a far reach then probably not.  Pain is different than discomfort.  Many players experience a feeling of awkwardness as beginners but eventually get comfortable with the instrument and the demands it places on the body.  But pain usually means injury and once you injure tendons, joint cartilage etc. they will scar up and that typically reduces mobility.  Stretch gently as a warm up and see how it progresses.  Never force you hand beyond its range of motion.
Answer: The best advice is, of course, to not cause any further damage to your fingers.  The object is to discover what the source of the pain and attempt to alleviate the pain.  One definitely does not want to aggravate an injury if it exists.  It could be that the pain is caused by developing stronger muscles; that is normal.  Pianists are much like athletes in that respect.  The pain could also be caused by other factors.
I have a specific example of my own personal pain that was alleviated by better technique.  I would get terrible cramps in my left wrist when playing the first movement of Beethoven's Pathetique Piano Sonata.  The left hand (my weaker hand) must maintain a tremolo in the bass for most of the movement.  The solution was to work on playing without letting my left hand get tense.  The tension was the cause of my pain.  It was more of a mental fete to keep the left hand relaxed.  But, gradually, the pain subsided and I was able to play without pain.
Comment: After 10 years of piano lessons and then getting wrist injuries, there are definitely certain angles that no longer work for me. I know it wasn't suppose to hurt so I knew to stop. This is good advice.
Answer: If it truly only hurts slightly, and you're otherwise able to perform the required stretch, then try continuing that way. If the discomfort lessens, that's a good sign; if it grows worse, it's a bad sign: at the very least you need a break from practicing that music, or that passage, and possibly to change what you're doing.
If you're not able to perform the music properly, then your stretch is insufficient. It will not increase, just from trying. It could be that just throwing yourself at the stretch will increase your span by, say, millimeter over time. If you need seven millimeters, that's not nearly enough. (If you're still a child or young adult, not yet fully grown, you have a chance that way.)
It's not advisable to persist in something that hurts, in a situation where the goal is not attainable in that manner.
In the pursuit of a musical instrument, there are some pains along the way, due to the body adjusting to the stresses of acquiring new skills. There are some good pains and there are some bad ones; you have to learn to "play it by ear".
Any sudden, sharp pain is a sign to stop. So is pain that is trending for the worse day over day.
Regarding stretching, do not apply external forces to try to make your reach bigger. If the discomfort you're experiencing is just from your hand's own effort at stretching, that is a lot less dangerous than if you start forcing your fingers into stretched positions using your other hand, or some sort of tool.


Pager will come by default in blogs template or not?

Question: I am using blogs  module in one of the website. I have created a template file for that, I want to add pager if blog items exceeds that 10. So my question is in that template file how can I use pager. It will display by default or is there any other ways to add pager to that template.
Answer: If you are creating a custom template for the blogs created by the blog module you will have a variable called $pager available to you in that template. Wherever you want it displayed you can just add something like this:

<?php echo $pager ?>

If you look in blog.pages.inc you'll see that the "pager" is added to the "$build" render array in each of the menu callback functions defined in that file.


Context initialization failed or loading properties

Question: I have a problem with building my application, I get this error:
VII 08, 2012 10:03:46 DOP. org.apache.catalina.startup.Embedded start
INFO: Starting tomcat server
VII 08, 2012 10:03:46 DOP. org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
VII 08, 2012 10:03:47 DOP. org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
INFO : org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization started
INFO : org.springframework.web.context.support.XmlWebApplicationContext - Refreshing Root WebApplicationContext: startup date [Sun Jul 08 10:03:47 CEST 2012]; root of context hierarchy
INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [file:/D:/work/projekty/java/evrem/target/classes/META-INF/spring/root-context.xml]
INFO : org.springframework.context.annotation.ClassPathBeanDefinitionScanner - JSR-330 'javax.inject.Named' annotation found and supported for component scanning
INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [file:/D:/work/projekty/java/evrem/target/classes/META-INF/spring/bean-context.xml]
INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from URL [file:/D:/work/projekty/java/evrem/target/classes/META-INF/spring/security-context.xml]
INFO : org.springframework.beans.factory.support.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@28f2525: defining beans [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0,org.springframework.format.support.FormattingConversionServiceFactoryBean#0,org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#0,org.springframework.web.servlet.handler.MappedInterceptor#0,org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver#0,org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver#0,org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver#0,org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping,org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter,org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,userRepository,org.springframework.data.repository.core.support.RepositoryInterfaceAwareBeanPostProcessor#0,org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0,org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor#0,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,homeController,org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,entityManagerFactory,transactionManager,dataSource,messageSource,org.springframework.web.servlet.handler.MappedInterceptor#1,localeResolver,pageUtil,org.springframework.security.web.PortMapperImpl#0,org.springframework.security.web.context.HttpSessionSecurityContextRepository#0,org.springframework.security.web.authentication.session.SessionFixationProtectionStrategy#0,org.springframework.security.authentication.ProviderManager#0,org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler#0,org.springframework.security.access.vote.AffirmativeBased#0,org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0,org.springframework.security.web.access.DefaultWebInvocationPrivilegeEvaluator#0,org.springframework.security.authentication.AnonymousAuthenticationProvider#0,org.springframework.security.authentication.RememberMeAuthenticationProvider#0,org.springframework.security.web.savedrequest.HttpSessionRequestCache#0,org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0,org.springframework.security.config.http.UserDetailsServiceInjectionBeanPostProcessor#0,org.springframework.security.filterChainProxy,org.springframework.security.provisioning.JdbcUserDetailsManager#0,org.springframework.security.authentication.dao.DaoAuthenticationProvider#0,org.springframework.security.authentication.DefaultAuthenticationEventPublisher#0,org.springframework.security.authenticationManager,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0]; root of factory hierarchy
ERROR: org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'dataSource' defined in URL [file:/D:/work/projekty/java/evrem/target/classes/META-INF/spring/root-context.xml]: Could not resolve placeholder 'jdbc.url'
    at org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:209)
    at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:220)
    at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:84)
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:681)
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:656)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:446)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
    at org.apache.catalina.startup.Embedded.start(Embedded.java:825)
    at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunMojo.java:558)
    at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java:255)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
VII 08, 2012 10:03:48 DOP. org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'dataSource' defined in URL [file:/D:/work/projekty/java/evrem/target/classes/META-INF/spring/root-context.xml]: Could not resolve placeholder 'jdbc.url'
    at org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:209)
    at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:220)
    at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:84)
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:681)
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:656)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:446)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
    at org.apache.catalina.startup.Embedded.start(Embedded.java:825)
    at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunMojo.java:558)
    at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java:255)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

VII 08, 2012 10:03:48 DOP. org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
VII 08, 2012 10:03:48 DOP. org.apache.catalina.core.StandardContext start
SEVERE: Context [/evrem] startup failed due to previous errors
VII 08, 2012 10:03:48 DOP. org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
VII 08, 2012 10:03:48 DOP. org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/evrem] registered the JBDC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.

My web.xml
<?xml version="1.0" encoding="UTF-8"?>

<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

  <display-name>evrem</display-name>
  <context-param>
    <param-name>defaultHtmlEscape</param-name>
    <param-value>true</param-value>
  </context-param>
  <filter>
    <filter-name>encodingFilter</filter-name>
    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
    <init-param>
      <param-name>encoding</param-name>
      <param-value>UTF-8</param-value>
    </init-param>
    <init-param>
      <param-name>forceEncoding</param-name>
      <param-value>true</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>encodingFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
            classpath*:/META-INF/spring/root-context.xml,
            classpath*:/META-INF/spring/security-context.xml
        </param-value>
  </context-param>
  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
  <servlet>
    <servlet-name>default1</servlet-name>
    <servlet-class>
          org.apache.catalina.servlets.DefaultServlet
        </servlet-class>
    <init-param>
      <param-name>debug</param-name>
      <param-value>0</param-value>
    </init-param>
    <init-param>
      <param-name>listings</param-name>
      <param-value>true</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>appServlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>classpath*:/META-INF/spring/appServlet/servlet-context.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>appServlet</servlet-name>
    <url-pattern>/</url-pattern>
  </servlet-mapping>
  <filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  <error-page>
    <error-code>404</error-code>
    <location>/WEB-INF/views/error/404.jsp</location>
  </error-page>
  <servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>*.css</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>*.js</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>*.gif</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>*.jpg</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>*.png</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>*.txt</url-pattern>
  </servlet-mapping>
</web-app>

root-context.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
    xmlns:jee="http://www.springframework.org/schema/jee" xmlns:jpa="http://www.springframework.org/schema/data/jpa" xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
    xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
             http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
             http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
             http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
             http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
             http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
             http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">

    <mvc:annotation-driven />
    <context:annotation-config />
    <jpa:repositories base-package="com.evrem.webapp.repository" />
    <tx:annotation-driven transaction-manager="transactionManager" />
    <context:component-scan base-package="com.evrem.webapp" />

    <bean
        class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <list>
                <value>classpath*:*.properties</value>
            </list>
        </property>
    </bean>

    <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="persistenceUnitName" value="persistenceUnit" />
        <property name="dataSource" ref="dataSource" />
        <property name="jpaDialect">
            <bean class="org.springframework.orm.jpa.vendor.HibernateJpaDialect" />
        </property>
    </bean>

    <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
        <property name="entityManagerFactory" ref="entityManagerFactory" />
    </bean>

    <bean id="dataSource" class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource">
        <property name="url" value="${jdbc.url}" />
        <property name="user" value="${jdbc.username}" />
        <property name="password" value="${jdbc.password}" />
    </bean>

    <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
        <property name="basename" value="classpath:localization/messages" />
        <property name="defaultEncoding" value="UTF-8" />
    </bean>

    <mvc:interceptors>
        <bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
            <property name="paramName" value="lang" />
        </bean>
    </mvc:interceptors>

    <bean id="localeResolver" class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
        <property name="defaultLocale" value="cs_CZ" />
        <property name="cookieMaxAge" value="15768000" />
    </bean>

    <import resource="bean-context.xml" />

</beans>

I have my database.properties with jdbc.url, jdbc.username and jdbc.password in src/main/config path..
Also, I would like to ask you if my project structure is correct.
Answer:
Also, i would like to ask you if my project structure is correct.

No, and this is actually causing your problem. Even though src/main/config is marked as a project directory in Eclipse, maven won't treat it in any special way, in particular it won't include that folder on CLASSPATH. Check out your built WAR file, it won't even contain these files!
By simply moving all your *.properties files to src/main/resources your application should build and run fine.


How to play these overly extended intervals on piano?

Question: There are two images I have attached.
In the first one it says, I guess, play the top note on the treble clef with your left hand (cross hands). But how on earth am I supposed then to play the chord in the bass clef? My fingers are not long enough to play all the notes written in both clefs.
Could you please help me, how should I do this? If it means I should play all the notes in the treble clef with my left hand, that sounds even more fantastic. The fingering indicates that I have three second fingers, which is not true at least for me. Is that a typo?
A similar concern is with the second image. Although it says "Pedal" there, I still do not see how it is possible to play all the notes in the bass clef at the same time.

1
Comment: Please make proper citations :  provide name of piece, composer, publisher or edition detail. First, as respect to the composer but also because the right answer might depend on style, period, etc.
Answer: The wavy vertical lines to the left of the chords mean "arpeggio": in other words, you are being told to roll the chords. Given that both both passages have Ped indications (the lines and carets under the bass stave in the first excerpt), you aren't obliged to hold the notes with your fingers, so you can indeed cross hands in the first passage.
(Edit: To clarify, the horizontal line under the bass stave in the first example means to hold down the pedal, with the carets meaning to release the pedal, then depress it again. The example shows syncopated pedaling, meaning a release and attack of the pedal after the chord is sounded in order to tie the chords together in legato fashion. In this particular case, I would consider doing this after starting the chord, but just before crossing hands.)
Comment: In general, *whenever* the range of a chord exceeds your hand span, you're expected to play it via arpeggio even if there *isn't* a waved mark. Pianists have very different body measurements, and this convention makes it easier to notate things without worrying whether or not you are demanding the impossible. Towards the end of the romantic era, a lot of composers omitted the arpeggio mark even when writing monster chords that were obviously too wide for *anybody* to play, even Rachmaninow himself.
Comment: In these particular cases, you aren't being given a choice, though, @Kilian. I _can_ span tenths, so, without an explicit arpeggio sign, I would tend to play such chords without rolling. It's also a matter of form: the arpeggiation of the chords so marked is meant to be heard - in fact, in the first example, you'd probably roll the chords relatively slowly. The arpeggiation in chords that you roll _faute de mieux_ shouldn't be obvious.
Comment: Thanks a lot! As I understand, when arpeggiated, these notes should be played as sixteenth notes, or just as fast as possible? Or should they be equally divided throughout the length of the written note?
Comment: Depends on a number of things: tempo, rhythmic context, number of notes in the arpeggio, written duration, and so forth. Taste even, sometimes. Arpeggios of this sort are played a little out of time: if they were measured, they would have been written out in full. In the first example, the written durations are long, I'm guessing that the tempo is slow, and the crossing hand imposes a delay, so a slow roll is in order, possibly roughly 16ths. If the second example is moderate in tempo or faster, the roll is going to sound like fast ascending grace notes: "t-t-lump", so to speak.
Comment: (Granted, without rolling, the layout of the chords in the first example would be a real stress.)
Comment: But you normally don't divide the written note equally: the impression to give is that the chord has the written duration.
Comment: I can span 9ths but I still tend to arpeggiate past an octave or just change the notes so that the harmony stays the same but it is more comfortable(more so with like grace notes leading into an octave) because a 41 fingering for an octave and a 51 fingering for a 9th are both uncomfortable but the 41 for an octave slightly more so.
Answer: The other answer didn't explain exactly, but in the first case, you're supposed to cross over and play the top note with your left hand.  So you roll the LH chord, then continue the roll into the RH, and finally cross over and play the top note with your left hand.  The pedal will keep everything sounding.
The second example is just a simple one-handed roll.  Use fingers 5-3-1, and if your hands aren't big enough to span the 10th, pivot on your 3rd finger.  Again, the pedal will hold everything together.
Comment: Yup, exactly, @Matt. The short rule is that you roll from bottom to top all the notes covered by the length of the arpeggio sign. I had considered that as sufficiently obvious from the two-handed and one-handed examples given, but, on sober reflection, I suspect I was wrong. +1 for adding the necessary detail.


Maximize $\int_\Gamma\,\langle{y,x}\rangle^2\, dx$

Question: Given a bounded, compact, closed surface $\Gamma\subset\mathbb{R}^n$, I'm searching
$$
\max_{y\in\mathbb{R}^n, \|y\|=1} \int_\Gamma \langle y, x\rangle^2.
$$
Without the square, and with the enclosed volume $\Omega$,
$$
\max_{y\in\mathbb{R}^n, \|y\|=1} \int_\Omega \langle y, x\rangle,
$$
I'm guessing $y_\text{max}$ points towards the centroid of $\Omega$. Not sure how to prove that though.
Any hints?
Comment: $\Omega$ is $n$-dimensional solid body and $\Gamma$ is its boundary Right ?
Comment: That's correct.
Comment: That should be an easy consequence of the Euler-Lagrange equations (https://en.wikipedia.org/wiki/Euler%E2%80%93Lagrange_equation).
Answer: Let's do the second one first.  Let
\begin{align*}
    f(y_1, \dots, y_n) &= \int_\Omega (y_1x_1 + \dots y_n x_n)\,dV \\
    g(y_1, \dots, y_n) &= y_1^2 + y_2^2 + \dots + y_n^2
\end{align*}
We want the critical values of $f$ subject to the constraint that $g=1$.
By the method of Lagrange multipliers, there is a constant $\lambda$ such that, for each $i$ from $1$ to $n$, $\frac{\partial f}{\partial y_i} = \lambda \frac{\partial g}{\partial y_i}$.  That is,
$$
   \int_\Omega x_i \,dV = 2\lambda y_i
$$
for each $i$.  By squaring and summing all $n$ of these equations, we get
$$
4\lambda^2 = \sum_{i=1}^n \left(\int_\Omega x_i \,dV\right)^2
$$
The only way the right-hand side is zero is if $\int_\Omega x_i \,dV = 0$ for each $i$.  In that case $f$ is identically zero and any $y$ will do.
Otherwise, $\lambda \neq 0$, so
$$
    y_i = \frac{1}{2\lambda} \int_\Omega x_i \,dV
$$
Since the $i$th coordinate of the centroid of $\Omega$ is $\bar x_i =\frac{1}{\operatorname{Vol}(\Omega)}\int_\Omega x_i \,dV$, I agree that $y$ is a multiple of $\bar x$.

The first one is trickier, at least, to me.  Let
$$
   h(y_1,\dots,y_n) = \int_\Gamma (x_1y_1+\dots+x_ny_n)^2\,ds
$$
Again, we want to maximize $h$ subject to $g=1$.  We have
$$
    2\int_\Gamma (x_1y_1+\dots+x_ny_n)x_i\,ds = 2\lambda y_i \tag{$*$}
$$
for each $i$.  If we set
$$
    M_{ij} = \int_\Gamma x_i x_j \,ds
$$
then $(*)$ is equivalent to
$$
    \sum_{j=1}^n M_{ij} y_j = \lambda y_i
$$
In other words, $y$ is an eigenvector of the matrix $M$, corresponding to the eigenvalue $\lambda$.
The matrix $M$ is symmetric, and I think, positive definite.  I am guessing the latter can be shown by squaring each equation and adding them up like before.  So there is an orthonormal basis of eigenvectors.  Therefore the maximum value of $f$ is the maximum of the eigenvalues of $M$.
I'm not sure if we can say more than that.  This is a very interesting problem but I've already spent way too much time that I should be doing something else! <code>\smiley</code>
Comment: The first one is clear without Lagrange: $\int (x^\text{T} y)^2 =\int y^\text{T} x \cdot x^\text{T} y = y^\text{T} \left(\int x x^\text{T}\right) y$.


notification near a location

Question: I want to know if there is any way to notify a user when he is near a particular location.
when the the user gets near the location a notification comes to his phone reminding him of his location.
I m trying following code but its not working.
public class NotifyuserActivity extends Activity {
     LocationManager locMan;
     double lat;
     double lon;
     NotificationManager notMan;
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    locMan=(LocationManager) getSystemService(LOCATION_SERVICE);
    locMan.requestLocationUpdates(LocationManager.GPS_PROVIDER,1000,10, mylistener);
}

LocationListener mylistener= new LocationListener() {
    @Override
    public void onStatusChanged(String provider, int status, Bundle extras) {
        // TODO Auto-generated method stub

    }

    @Override
    public void onProviderEnabled(String provider) {
        // TODO Auto-generated method stub

    }

    @Override
    public void onProviderDisabled(String provider) {
        // TODO Auto-generated method stub

    }

    @Override
    public void onLocationChanged(Location location) {
        // TODO Auto-generated method stub
        lat = location.getLatitude();
        lon = location.getLongitude();
        CharSequence from = "AlarmManager - Time's up!";
        CharSequence message = "This is your alert";
        Location tasklocation=new Location(LocationManager.GPS_PROVIDER);
        double dis1 = location.distanceTo(tasklocation);
        tasklocation.setLatitude(22.727733);
        tasklocation.setLongitude(75.886079);
        if(dis1 < 200.00)
        {

            notMan = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
            Notification n = new Notification(R.drawable.ic_launcher, "Click here for details", System.currentTimeMillis());

            Intent notificationIntent = new Intent(NotifyuserActivity.this,NotifyuserActivity.class);
            PendingIntent pendingIntent = PendingIntent.getActivity(NotifyuserActivity.this, 0, notificationIntent, 0);

         n.setLatestEventInfo(NotifyuserActivity.this, from,message, pendingIntent);
           notMan.notify(10001, n);
           Toast.makeText(NotifyuserActivity.this,"Distance to location is: " + dis1, Toast.LENGTH_LONG).show();
        }
    }
};

}
Comment: I'm not familiar with this so much, but you set the requested location (i.e taskLocation.setLat\setLong...) after you measure the distance.
Also, you only said, it's not working. what does it do? what does work?
Comment: actually i want to use this module in my project. ya i have tried writing tasklocation above dis but it is also not working
Answer: here Location change code..try this.
@Override
public void onLocationChanged(Location location) {
    // TODO Auto-generated method stub
    if (location != null) {
        System.out.println("in onlocationchanged");
         String locationString=location.convert(location.getLatitude(),1);
         Toast.makeText(this,"locationString=="+locationString, Toast.LENGTH_LONG).show();
        double lat = location.getLatitude();
        double lng = location.getLongitude();
        String currentLocation = "The location is changed to Lat: " + lat + " Lng: " + lng;
        Toast.makeText(this,currentLocation, Toast.LENGTH_LONG).show();
        p = new GeoPoint((int) lat * 1000000, (int) lng * 1000000);

        // check in database if we have same lattitude & longitude

        MySQLiteHelper m=new MySQLiteHelper(getBaseContext());
        Log.d("Reading: ", "Reading all contacts..");
        List<LocWiseProfileBeans> LocWiseProfile= m.getAllLocWiseProfile();

        for (LocWiseProfileBeans cn : LocWiseProfile) {
            String log = "Loc Name: "+cn.getLocname()+" ,Lattitude: " + cn.getLattitude()+ " ,Longitude: " + cn.getLongitude()+ " , Selected Profile :"+cn.getSelectedprofile();
                // Writing Contacts to log
            double distance2=00.00;

      GeoPoint storedLocation=new GeoPoint(
      (int) cn.getLattitude() * 1000000,(int) cn.getLongitude() * 1000000);

        Location locationB = new Location("point B");

        locationB.setLatitude((int) cn.getLattitude() * 1000000);
        locationB.setLongitude((int) cn.getLongitude() * 1000000);

        distance2=distFrom(lat,lng,cn.getLattitude(),cn.getLongitude());

        if(distance2>1 )
        {
            Log.d("Name: ", log);
            Toast.makeText(this, "Loc Name:"+log, Toast.LENGTH_SHORT).show();
            Toast.makeText(this,"identical", Toast.LENGTH_LONG).show();
            Toast.makeText(this,"distance2======"+distance2, Toast.LENGTH_SHORT).show();
sendnotification("Locale Notifications","You visited location " + cn.getLocname());

        }

This code are use to notify the user.
protected void sendnotification (String title, String message) {
       String ns = Context.NOTIFICATION_SERVICE;
       NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);

       int icon = R.drawable.icon;
       CharSequence tickerText = message;
       long when = System.currentTimeMillis();

       Notification notification = new Notification(icon, tickerText, when);

       Context context = getApplicationContext();
       CharSequence contentTitle = title;
       CharSequence contentText = message;
       Intent notificationIntent = new Intent(this, GoogleMapsActivity.class);
       PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);

       notification.flags = Notification.FLAG_AUTO_CANCEL;
       notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
       mNotificationManager.notify(1, notification);
    }

Here is function for converting longitude and latitude into miles.
public static double distFrom(double lat1, double lng1, double lat2, double lng2) {
      double earthRadius = 3958.75;
      double dLat = Math.toRadians(lat2-lat1);
      double dLng = Math.toRadians(lng2-lng1);
      double a = Math.sin(dLat/2) * Math.sin(dLat/2) +
               Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) *
               Math.sin(dLng/2) * Math.sin(dLng/2);
      double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
      double dist = earthRadius * c;

      return dist;
    }

you need to change where required as per your code....
Comment: i unable to understand your code it would be helpful if u figure out the error in my code...
Answer: The answer is yes.
You can register a LocationListener to LocationManager with some time or distance interval settings, then when location is changed, can compare it to what you have set to decide whether to notify the user.
GPS consumes large battery power, so you should better first use Network Location Provider, then when it's not so far to that location, start the GPS.

As the comment said, you should first move
tasklocation.setLatitude(22.727733);
tasklocation.setLongitude(75.886079);

above
double dis1 = location.distanceTo(tasklocation);
(Better, you could move these location setting out of onLocationChanged() and not hardcode Latitude/Longitude.)
This may not solve your problem ,but not doing this will NEVER make it work. So do not leave some mistake like that.

Then, I should say this code works for me (in my emulator) and I can not see other mistakes for what you give that may give you "not working".
You may check your permissions for
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

Or may show the Toast result or Logcat output.
After all, more details about your "not working".
Comment: I have already added the permission and made the changes u said but the code is still not working . While testing the code on phone when i go to the location no notification comes. This code works fine on the emulator.
Comment: Add some code to `onLocationChanged()` to show `dis1` for every location change (for example, output to `TextView`). Show the result.

notification near a location


Static class remaining in memory.....how best to achieve this

Question: I've created a very simple helper class that I can use in my ASP.Net pages. The idea is that it is supposed to be a very simple way to log an on-page error or success (not a form validation error) and then display it to the user.
In my public helper class I have a class which has certain properties, as shown below:
public class UserMessage
{
    public UserMessage()
    {
        Messages = new Dictionary<string, string>();
    }

    public string SummaryMessage;
    public Dictionary<string, string> Messages;
    public bool ShowMessages;
    public bool ShowAsError;
}

I then have a variable which is used to store an instance of the UserMessage class, like so:
private static UserMessage _userMessage { get; set; }
I then have two public static methods, one to log a message, the other to display all the messages, like so:
public static void LogSummary(string summaryMessage, bool showIndividualMessages, bool showAsError)
{
    _userMessage = new UserMessage();
    _userMessage.SummaryMessage = summaryMessage;
    _userMessage.ShowMessages = showIndividualMessages;
    _userMessage.ShowAsError = showAsError;
}

public static string DisplayUserMessages()
{
    if (_userMessage == null)
        return string.Empty;

    StringBuilder messageString = new StringBuilder();
    messageString.AppendFormat("\n");
    messageString.AppendLine(string.Format("
", (_userMessage.ShowAsError) ? "invalid" : "valid"));
    messageString.AppendLine(string.Format("
{0}
", _userMessage.SummaryMessage));
    messageString.AppendLine("
");

    return messageString.ToString();
}

The problem I have is that the _userMessage variable has to be a static variable, otherwise I get the error message "An object reference is required for the non-static field.......". The problem with the variable being static is that is stays in memory, so if the user receives an error message and then visits another page - the error message is still displayed!
I'm sure this is because I missed OOP 101, but how should I correct this?
Comment: You cannot access nonstatic variable from static methods, that's why it works after you made the `_userMessage` field static.
Comment: The bigger problem is that `static` in ASP.NET means that every request/user will use the same variable.
Answer: Pass the reference as an argument to the static member, or have it return a new instance like below:
public static UserMessage LogSummary(string summaryMessage, bool showIndividualMessages, bool showAsError)
{
    var userMessage = new UserMessage();
    userMessage.SummaryMessage = summaryMessage;
    userMessage.ShowMessages = showIndividualMessages;
    userMessage.ShowAsError = showAsError;
    return userMessage;
}

Comment: @KarelFrajtak In this case, I'd probably wrap his `DisplayUserMessages` up in the UserMessage class, and role the whole thing up in a user control.
Comment: You're returning instance of a `UserMessage` class from a `void` method. Also what will you do with it after?
Answer: Do not use static variable to keep messages per user! ASP.NET application is multi-threaded and using static variable is not thread safe. Store them in Session.
public static void LogSummary(string summaryMessage, ...)
{
   HttpContext.Current.Session["userMessages"] = new UserMessage();
   ...
}

public static string DisplayUserMessages()
{
   // get the value from session
   var userMessage = (UserMessage)HttpContext.Current.Session["userMessages"];
   // do the work
   // do the clean up
   HttpContext.Current.Session["userMessages"] = null;
   // the messages will not be displayed on next request
}

Each request is handled by different thread, so the users will overwrite the _userMessage field and you cannot guarantee that messages for the current user will be displayed.
Comment: The Session option worked really well for my solution. Thanks.
Answer: In my opinion you try to face a problem with a wrong approach. Considering that you're developing service side component (ASP.NET) and you have to have perfect isolation between every user visits your site, I personally don't see any reason why do not use a backend database for error message holding where every record can be associated to a single user unique ID.
The simple ACID supported database (in practice almost any on the market) is a perfect fit in this case.
In this way you can pull from the database the message you need at the moment you need, and don't need more worry about any type of memory issue (at least from the perspective of this question)
Hope this helps.
Answer: Static variable will be shared within AppDomain - i.e. concurrent requests will share the same instance and hence your approach is problematic.
You should consider putting your user-message instance into the current HttpContext to get per request semantics as needed by your use case. For example,
public class UserMessage
{
   public static UserMessage Current
   {
      get { return HttpContext.Current.Items["_User_Message"] as UserMessage; }
   }

   public static void LogSummary(string summaryMessage, bool showIndividualMessages, bool showAsError)
   {
      var userMessage = new UserMessage();
      userMessage.SummaryMessage = summaryMessage;
      ...

      HttpContext.Current.Items["_User_Message"] = userMessage;
   }

   public static string DisplayUserMessages()
   {
       var userMessage = UserMessage.Current;
       if (userMessage == null ) return string.Empty;

       ...
   }

   // rest of the code
   ...
}

I would probably also make UserMessage constructor private.


Consistency and Asymptotic Normality for MLE of Independent NON-identically distributed normals

Question: I have the following setting:
 $$ x_k \sim N(\mu,\sigma^2 + \hat{\delta}^2_k),k=1,\dots,K, $$
where $\{x_k,k=1,\dots,K\}$ - observed data, $\{\hat{\delta}^2_k\,k=1,\dots,K \}$ are known parameters (just consider them fixed), while $(\mu,\sigma^2)$ are unknown. My primary goal - making inference about $\mu$. Does anyone know of any results for this particular case in terms of consistency and asymptotic behavior of MLE estimator for $\mu$ as $K\rightarrow \infty$?
For the time being I am simply using a $\chi^2$ approximation for the likelihood ratio test, but I don't have solid theoretical argument for that as the data is not identically distributed. It also complicates things that I fail to get a closed-form solution for $\hat{\mu}_{mle}$
I have tried Hoadley's paper on "Asymptotic Properties of MLE for Independent Non-Identically distributed case" http://projecteuclid.org/download/pdf_1/euclid.aoms/1177693066, but verifying their general conditions is not coming to me easy as of yet.
Please let me know if anyone encountered this particular kind of a problem and knows what regularity conditions are needed for nice classic MLE properties. Obviously there should be a certain upper bound on values $\{ \hat{\delta}^2_k,\ k=1,\dots, \}$, but what kind of bound, and even with that bound - how to prove consistency/asymptotic normality.
Comment: The "hat" over your $\delta$s suggests they're estimated from data rather than actually known. Is it the case that you really know the true values rather than estimates of them?
Comment: You can just consider them fixed/known, yes. The "hat" is more like a notion for them to be distinguished from the usual notation for unknown parameters.
Comment: ...In the meantime you may want to have a look at https://stats.stackexchange.com/a/94128/28746
Answer: You can find much more accessible conditions for consistency and asymptotic normality of MLE in Hayashi's Econometrics, ch. 7.,in the general context of Extremum Estimators and its sub-class, the M-estimators. Hayashi has also references for detailed proofs on the conditions.
The MLE with independent observations belongs to this subclass, because it maximizes a "sample average", an average of a real-valued function of the data and the unknown parameters (note that with independent observations the log-likelihood of the sample is certainly a sum, and we can divide it by the sample size without affecting the solution).
So (in general notation)
$$\hat \theta_{MLE} = \text{argmax}_{\theta} \left\{\frac 1n \sum_{i=1}^n \ell_i(x_i;\theta)\right\}$$
where $\ell_i$ is the log-likelihood of observation $i$.
For consistency, there are two-three alternative sets of conditions. Common to all conditions are:
1) The parameters lie in the interior of the parameter space
2) $\ell_i(x_i;\theta)$ is measurable (if it is continuous, it is measurable)
3) The objective function $\frac 1n \sum_{i=1}^n \ell_i(x_i;\theta)$ converges in probability to some function, say $\ell_0(\theta)$
4) $\ell_0(\theta)$ is uniquely maximized at the true parameter vector (say $\theta_0$)
Then moreover:
1st Alternative : if the parameter space is compact, and convergence is uniform, we obtain consistency.
2nd Alternative : if the parameter space is not compact, then if the log-likelihood is concave and convergence is just pointwise, we again obtain consistency.
I ' ll leave asymptotic normality for the OP to look up and explore.
Comment: It seems to me that hayashi's notation $Q_n(\theta) :=  \frac{1}{n} \sum_{t=1}^n \log f(y_t | x_t ; \theta)$ does not assume the $f$ to vary as in your formula  $\frac 1n \sum_{i=1}^n \ell_i(x_i;\theta)$ where $\ell_i$ explicitly depends on $i$ .
Comment: @Monolite You are right that Hayashi passes without notice form general data to i.i.d. data. A paper exactly on the case of "independent non-identical" is  Bruce Hoadley (1971) "Asymptotic Properties of Maximum Likelihood Estimators for the Independent Not Identically Distributed Case". For non-standard conditions in general, see also https://stats.stackexchange.com/a/68866/28746
Comment: @Monolite Yes, it was distilling what one can find in Hayashi, Amemiya, etc
Comment: I can't find these conditions on the given reference of Hayashi's econometrics chapter 7, it seems to me Hayashi always assumes identically distributed random variables. where could I find this theorem you cite?
Comment: @Monolite Are you sure? See the various theorems in Hayashi pp. 456-465.
Comment: Thank you greatly! I am looking at the paper by Bruce Hoadley and it is very helpful but I feel curious now as to where the conditions stated in your answer to the OP come from since I can't seem to find them in Bruce Hoadley either, was your answer just an idea on the general conditions that one usually needs for consistency?


Effect of the independent variables on dependent variable

Question: I have a data set on student performance on various courses. The dependent variable is the grade of the student. The independent variables include "total study time ", "number of absences", and "access to Internet" which can be changed by the student.
What analysis methods are appropriate to analyze the effect of changing these independent variables (such as increasing the study time, getting an Internet account, etc) on the dependent variable grade.
Comment: Your tag `regression` is already the essence of any answer.  I can't see that you have a new question beyond those under that tag.
Comment: Note that in an observational study you only see associations, not cause and effect.
Answer: Given your description, and as Nick Cox stated, a linear regression would be suitable.
The basic model can be stated as:
$$
performance = \beta_0 + \beta_1 studytime + \beta_2 absences + \beta_3 internetaccess + \varepsilon
$$
Given that you have data on multiple classes/classrooms I would add a fixed effect for class and cluster standard errors on class levels.


How to generate all possible m combinations in R, with m varying

Question: How do we generate in R all possible combinations (of variable length, so that the resulting list can be of length 1, 2 or 3 if there are 3 elements) from a vector of variable length:
<code># say we have a vector of length 3:
vec = letters[1:3]

ret = list('a', 'b', 'c', 'ab', 'ac', 'bc', 'abc', 'a,b', 'a,c', 'a,bc', 'b,c', 'ac,b', 'ab,c', 'a,b,c')
</code>
Thank you!
Comment: @MrFlick  Please note I am not looking for this (which is the question you marked as duplicate): "a"   "b"   "ab"  "c"   "ac"  "bc"  "abc"; but I am looking for all combinations like this:  "a"     "b"   "c"  "ab"    "a,b"  "ac"    "a,c"   "bc"    "abc"  "a,bc" "b,c"   "ab,c"   "ac,b" "a,b,c"
Comment: @MrFlick This is not a duplicate, it is different results I am after...
Comment: What's different?Looks exactly the same to me.
Answer: Here's one way, but it performs poorly for longer vectors. There's probably a much neater way of doing it, but this might suffice in the meantime.
<code>get_combos <- function(x) {
  x2 <- unlist(lapply(seq_along(x), function(m)
    sapply(combn(x, m, simplify=FALSE), paste0, collapse='')))
  x3 <- expand.grid(rep(list(x2), length(x)))
  x4 <- sapply(apply(x3, 1, unique), function(x) paste0(sort(x), collapse=','))
  unique(grep('.*([^,]).*\\1', x4, val=TRUE, invert=TRUE))
}

get_combos(letters[1:3])

##  [1] "a"     "a,b"   "a,c"   "a,bc"  "a,b,c" "b"     "b,c"   "ac,b"
##  [9] "c"     "ab,c"  "ab"    "ac"    "bc"    "abc"
</code>
Comment: Thanks so much jbaums... So at the end it is 14 combinations for 3 letters, 51 for 4, after that it does become slow but it really helps show the math. Thanks so much!