Do you Lorem Ipsum?

2011.September.01 Leave a comment

Hi there!

Here I’m posting something new that I don’t know before.

When you need to provide some fake/use-less text on a wire-frame or mock-website you can use Lorem Ipsum, that is placeholder text (filler text) commonly used to demonstrate the graphics elements of a document or visual presentation, such as font, typography, and layout. The lorem ipsum text is typically a section of a Latin text by Cicero with words altered, added and removed that make it nonsensical in meaning and not proper Latin.

Example:
“Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.”

Regarding wire-frame here is a tip to create some online wire-frames, check HERE.

Example of wire-frame

New job!!!

2011.August.24 Leave a comment

Hi there!

For those that fallow me here on my blog, just a quick “personal update” I quit my last job and now I’m working on a new company called “Anhanguera Educacional”, is very big company on educational area, in about 3 years we are planning to have 1 million students!!!

Here I’m coordinating a big team that have as main focus: sustain and update all 34 portals from all areas.

I have some great opportunities on my last company, was a very good and a pleasure to work with those guys, perhaps I could work there some moment on the future!

;)

Add M2_REPO to eclipse

2011.June.08 Leave a comment

Maven

While working with maven projects we normally need to create the M2_REPO variable on Eclipse.

Normally I was used to do manually with these steps:

 - Eclipse > Window > Preferences > Select the Java > Build Path > Classpath
 - Point to your maven repository, shall me under: ~/.m2/repository
 - >rebuild your project

But a easiest way is:

>mvn eclipse:add-maven-repo -Declipse.workspace={PATH_TO_YOUR_WORKSPACE}

If you are thinking on “Where do I need to point my M2_REPO”
Answer: You need to point to your {home}/.m2/repository

SOLVED – iPhone/iPod JailBreak – Stops at UPLOADING RAMDISK

2011.May.06 3 comments

If you are Jailbreaking your iDevice and during the JailBreak process you got stuck on any step, mainly during the “Uploading RAMDISK” and you progress bar stops!!! You reach the same place that I did today! After a dig on internet I just find many posts and blogs with guys asking for help, and here is the solution!!!!!!!!

Just for windows users!!

Goto task manager>processes 
find redsn0w
Right click > set affinity cpu1 ONLY

If you need to update your iPhone 4 to iOS 4.3.3 please click on THIS LINK

Maven write an properties file

2011.March.03 Leave a comment

Maven

Hi there, still going with Maven issues.

In a previous post I mentioned about how make your app read files from a properties file. But, this is not enough to my requirements, what I need:

  • Default properties file – with all values from our CI enviroment
  • Developer properties file – Each developer need to create a personal file re-writing some files like, database_host
  • The output file shall be on specific directory – In my project I need the properties file under: ${basedir}/src/main/resources/app.properties

So this is my solution:

<!-- ************************************************************** 
	MAKE POSSIBLE TO RUN CREATE A PROPERTIES FILE BASED 
	ON default.propertes filtered by user.name.properties
    ************************************************************** -->
	<plugin>
		<groupId>org.codehaus.mojo</groupId>
		<artifactId>properties-maven-plugin</artifactId>
		<version>1.0-alpha-2</version>
		<executions>
			<execution>
				<phase>initialize</phase>
				<goals>
					<goal>write-project-properties</goal>
				</goals>
				<configuration>
					<outputFile>${basedir}/src/main/resources/myApp.properties</outputFile>
				</configuration>
			</execution>
		</executions>
	</plugin>
	<plugin>
		<groupId>org.codehaus.mojo</groupId>
		<artifactId>properties-maven-plugin</artifactId>
		<version>1.0-alpha-2</version>
		<executions>
			<execution>
				<phase>initialize</phase>
				<goals>
					<goal>read-project-properties</goal>
				</goals>
				<configuration>
					<files>
						<file>properties/default.properties</file>
						<file>properties/${user.name}.properties</file>
					</files>
				</configuration>
			</execution>
		</executions>
	</plugin>

Important points:

  • I don’t know yet why the ORDER of this two plugins are important, but it is. I’ll do some tests to check this!
  • If you have any Unit Test that need the output file done, inside your eclipse you will need to run: >mvn initialize

That’s it for now…

Any questions? Leave a comment! Just click UP there on Leave a comment

Cheers

Posting Source Code on wordpress

2011.February.28 Leave a comment

I was searching with no much effort a decent way to publish source-codes on WordPress, and I found it!

For more info PLEASE check THIS link.

But is simple and I’ll show here:

[sourcecode language="css"]
your code here
[/sourcecode]

Nice hum?

:D

Maven read an external properties file

2011.February.28 2 comments

Maven
Hi there,

Back to my project and one more lessons learn, on my study project I need maven to read values from my properties file, values like database host, password and etc…

Maven have a nice plugin called Properties Maven Plugin

Here is the changes on your pom.xml

		<!-- *************** MAVEN PROPERTIES PLUGIN *************** -->
		<dependency>
			<groupId>org.codehaus.mojo</groupId>
			<artifactId>properties-maven-plugin</artifactId>
			<version>1.0-alpha-2</version>
		</dependency>

and…

<build>
    <plugins>
    (...)
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>properties-maven-plugin</artifactId>
            <version>1.0-alpha-2</version>
            <executions>
                <execution>
                    <phase>initialize</phase>
                    <goals>
                        <goal>read-project-properties</goal>
                    </goals>
                    <configuration>
                        <files>
                            <file>${basedir}/src/main/resources/your.properties</file>
                        </files>
                    </configuration>
                </execution>
            </executions>
    (...)
    </plugin>
(...)

And finally I discover a decent way to post source-code do wordpress!!!!!!!!!!!!!!!!!!!!!!!!!! :)

Spring-MVC FileNotFoundException: dispatcher-servlet.xml

2011.February.21 Leave a comment

Maven
Hi there,

Here I’m again back to my things and found one more issue, trying to create my Maven project with Spring.

Today I realize that my dispatcher-servlet.xml was in a wrong directory and was causing this error:


HTTP ERROR 500

Problem accessing /future/. Reason:

IOException parsing XML document from ServletContext resource [/WEB-INF/dispatcher-servlet.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/dispatcher-servlet.xml]
Caused by:

org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/dispatcher-servlet.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/dispatcher-servlet.xml]
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
at javax.servlet.GenericServlet.init(GenericServlet.java:241)
at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)
at org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:339)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/dispatcher-servlet.xml]
at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:117)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
... 33 more
Caused by:

java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/dispatcher-servlet.xml]
at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:117)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
at javax.servlet.GenericServlet.init(GenericServlet.java:241)
at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:440)
at org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:339)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)


And the error was in the directory that I put my dispatcher-servlet.xml, so I’ll try to explain thinking that “A picture is worth a thousand words”
WRONG DIRECTORY:

CORRECT DIRECTORY:

Hope this tip helps!

Cheers and post your comment!

Enable Remote Access To MySQL

2011.February.17 Leave a comment


Hi there,

By default remote access to MySQL database server is disabled for security reasons. However, some time you need to provide remote access to database server from home or a web server. So here is one more tip arround MySQL


Open your configuration file from MySQL:
>vi /etc/mysql/my.cnf

Search for the entry:
bind-address = 127.0.0.1
and remove this entry or comment out this line!!

Restart your server:
>/etc/init.d/mysql restart


One important thing is to GRANT root access from anywhere:
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;
mysql> exit

And be happy!
:)

MySQL performance – INDEX

2011.February.16 Leave a comment


Hi there,
At my work I’m dealing with some performance issues, and I’m kind of needing some background regarding MySQL.


I’ll add some quick notes from my researches around INDEXES:

  • Indexes are used to find rows with specific column values quickly.
  • Performance increase – If a table has 1,000 rows, this is at least 100 times faster than reading sequentially.
  • MySQL uses indexes for these operations:
  • To find the rows matching a WHERE clause quickly.
  • To eliminate rows from consideration.
  • To retrieve rows from other tables when performing joins.
  • MySQL can use indexes on columns more efficiently if they are declared as the same type and size. In this context, VARCHAR and CHAR are considered the same if they are declared as the same size. For example, VARCHAR(10) and CHAR(10) are the same size, but VARCHAR(10) and CHAR(15) are not.
  • To find the MIN() or MAX() value for a specific indexed column
  • To sort or group a table if the sorting or grouping is done on a leftmost prefix of a usable key

I’ll update this post with all my research on this subject or create new ones!

Keep watching! :)

Follow

Get every new post delivered to your Inbox.