Uncategorized

Ant BuildException Cannot run program “..\src\protoc”

Error that I am getting when trying to run mvn test on google protobuf library. [INFO] Executing tasks [INFO] ———————————————————————— [ERROR] BUILD ERROR [INFO] ———————————————————————— [INFO] An Ant BuildException has occured: Execute failed: java.io.IOException: Cannot run program "..\src\protoc": CreateProcess error=2, The system c annot find the file specified   [INFO] ———————————————————————— [INFO] For more information, …

Ant BuildException Cannot run program “..\src\protoc” Read More »

Ant BuildException Cannot run program “..\src\protoc”

Error that I am getting when trying to run mvn test on google protobuf library. [INFO] Executing tasks [INFO] ———————————————————————— [ERROR] BUILD ERROR [INFO] ———————————————————————— [INFO] An Ant BuildException has occured: Execute failed: java.io.IOException: Cannot run program "..\src\protoc": CreateProcess error=2, The system c annot find the file specified   [INFO] ———————————————————————— [INFO] For more information, …

Ant BuildException Cannot run program “..\src\protoc” Read More »

Triming leading and trailing new lines with regex.

Here is some regex to trim leading/trailing newlines carriage and spaces returns from some text. Without replacing ‘spaces’ just new lines/carriage returns. ^(\n|\r)+|(\n|\r)+\Z   This will trim also spaces ^(\n|\r|\s)+|(\n|\r|\s)+\ZWithout replacing 'spaces' just new lines/carriage returns. ^(\n|\r)+|(\n|\r)+\Z This will trim also spaces ^(\n|\r|\s)+|(\n|\r|\s)+\Z Quick explanation might be in order. This regex consists of two parts, …

Triming leading and trailing new lines with regex. Read More »

No Dialect mapping for JDBC type: -4

Yet another fun day with hibernate. While working on ResourcePhaseListener for JSF attachment problem I run into following problem while trying to retrieve BLOB from MySQL db. org.hibernate.MappingException: No Dialect mapping for JDBC type: -4 No Dialect mapping for JDBC type: -4org.hibernate.MappingException: No Dialect mapping for JDBC type: -4 No Dialect mapping for JDBC type: …

No Dialect mapping for JDBC type: -4 Read More »

GLSurfaceView queueEvent and onTouchEvent seams broken!!!

What a title, I know but thats exactly what it is. This issue is happening on Android 1.6 so it might already been fixed. Just as per documentation i have implemented my GLSurfaceView as GameGLSurfaceView and overridden public boolean onTouchEvent(final MotionEvent event) method as so. /** * Capture touch event and delegate it to our …

GLSurfaceView queueEvent and onTouchEvent seams broken!!! Read More »

Expanding Rich tree nodes programmatically

I have found two different methods for expanding nodes in Rich tree  from code, they both take  advantage of component binding and component state. Tree Setup <rich:tree value="#{ourbean.sampleTree}" binding="#{ourbean.sampleTreeBinding}"   var="node" nodeFace="simple" id="someid" > <rich:treeNode type="simple" > <h:outputText value="#{node}"/> </rich:treeNode> </rich:tree><rich:tree value="#{ourbean.sampleTree}" binding="#{ourbean.sampleTreeBinding}" var="node" nodeFace="simple" id="someid" > <rich:treeNode type="simple" > <h:outputText value="#{node}"/> </rich:treeNode> </rich:tree> Only thing to …

Expanding Rich tree nodes programmatically Read More »

Show last executed query SQL Server – Disected

I found this online, without explanation so I will dissect the query and explain what is happening. SELECT deqs.last_execution_time AS [TIME], dest.TEXT AS [Query] FROM sys.dm_exec_query_stats AS deqs CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest ORDER BY deqs.last_execution_time DESCSELECT deqs.last_execution_time AS [Time], dest.TEXT AS [Query] FROM sys.dm_exec_query_stats AS deqs CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest ORDER BY deqs.last_execution_time …

Show last executed query SQL Server – Disected Read More »