My mistakes

 

username@hostname:~$ python

>>>from passlib.context import CryptContext
>>>print CryptContext(['pbkdf2_sha512']).encrypt('PASSWORD')
$pbkdf2-sha512$25000$U.r9H4Ow9l5LiVHq3dt77w$q0f2q/WcDLD3I8/KzB3E4TqJ6vaKIXqWySE8HyRCzJXbh4N8wZtcJjN2zPQ5337PYep6IFFIUeoshUm1beMifg

Replace the PASSWORD with the appropriate password.

username@hostname:~$su - postgres_username
postgres_username@hostname:~$psql -t database_name
database_name=#UPDATE res_users SET password='', password_crypt='$pbkdf2-sha512$25000$U.r9H4Ow9l5LiVHq3dt77w$q0f2q/WcDLD3I8/KzB3E4TqJ6vaKIXqWySE8HyRCzJXbh4N8wZtcJjN2zPQ5337PYep6IFFIUeoshUm1beMifg' WHERE id=1;

 

Posted on: April 25, 2014


MySQL distinct count if conditions unique

Build a query to find distinct women and men in a given records. 
The row is identified by the field id and it may be duplicated , but the gender for an id should only be counted once.

SELECT
    COUNT(DISTINCT CASE WHEN gender ='m' THEN id END) as male_count,  
    COUNT(DISTINCT CASE WHEN gender ='f' THEN id END) as female_count
FROM table.

Try the below solution.

  1. cd .metadata/.plugins
  2. mv org.eclipse.core.resources org.eclipse.core.resources.bak
  3. Start eclipse
  4. It will start but will show errors with opened tabs. This is because we have changed the resources folder, which eclipse use for managing the resources
  5. Close all opened tabs
  6. Exit from Eclipse
  7. Delete any newly create org.eclipse.core.resources folder
  8. Rename back the ‘org.eclipse.core.resources.bak’ to ‘org.eclipse.core.resources’
  9. Start Eclipse
  10. It should start fine with all projects

It worked for me.

This information is taken from the below URL.

http://www.vedantatree.com/2012/07/solution-for-nullpointerexception-on.html

SEVERE: Servlet.service() for servlet EmailServlet threw exception
java.lang.SecurityException: Access to default session denied

Please try the below solutions
1) Verify there is no duplication of javamail.jar in the tomcat or in your application.

Check the tomcat_home/lib , your_app/WEB-INF/lib

2)  Verify you are using only one email configuration to call the Session.getDefaultInstance through out the site.

Because as per the http://docs.oracle.com/javaee/6/api/javax/mail/Session.html#getInstance%28java.util.Properties documentation the replication of the configuration with getDefaultInstance will cause an error.

In such case if you want to insist with the new configuration then use Session.getInstance instead of Session.getDefaultInstance.

Tags:

The Apache Tika™ toolkit detects and extracts metadata and structured text content from various documents using existing parser libraries

For more information follow the below link
http://tika.apache.org/

Tags:

Things to take care

1) Set the contentType on the jsp via

<%@ page contentType="text/html;charset=UTF-8" %>

2) Set this tag inside the jsp:
<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8" />

3) Add the below filter to the web.xml

<!– Ensure UTF-8 encoded pages so that certain characters are displayed and submitted correctly –>
<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>

4) Make sure the database fields have appropriate collation like utf-8, utf-16

Tags:

Install eclipse and then

Help -> Software Updates -> Available Software -> Add Site

put http://subclipse.tigris.org/update_1.8.x in input field

check two checkboxes:

1) Subclipse

2) SVNkit Adapter (Important, the default JavaHL adapter doesn’t support SSH and public key authentication)

accept everything and install it

Verify the SVN client is SVNKit ->Window -> Preferences -> Team -> SVN ( select the SVNKit. in the Client dropdown )

Now checkout the project

Right click in explorer -> New -> Project -> SVN folder -> Checkout projects from SVN -> Next -> Create a new repository location

Enter the location of the project you’re checking out e.g.
svn+ssh://example.com/repo/

Press Next

Enter SSH credentials.
next, next… and ready.