It’s not too late to be a great man :)
http://zenpencils.com/comic/106-chris-hadfield-an-astronauts-advice/
It’s not too late to be a great man :)
http://zenpencils.com/comic/106-chris-hadfield-an-astronauts-advice/
Today I updated an old Spring MVC application to Apache Tomcat 7 and some other newer jars and, when I started it, I get this error:
SEVERE: Servlet.service() for servlet [mvc-dispatcher] in context with path [/CG] threw exception [/WEB-INF/view/main.jsp (line: 2, column: 0) /WEB-INF/view/include.jsp (line: 3, column: 75) Attribute qualified names must be unique within an element] with root cause org.apache.jasper.JasperException: /WEB-INF/view/main.jsp (line: 2, column: 0) /WEB-INF/view/include.jsp (line: 3, column: 75) Attribute qualified names must be unique within an element |
After some search i find out that using single attribute multiple time in a single tag throw this error(it works with no problem in previous version!!!)
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> |
I removed the duplicated “prefix” tag and everything worked fine! (…ehm… everything? Of course not… but this exception has been fixed)
Today I found this article on LinkedIn web site: The 15 Most Inspiring Videos of All Time. That’s really amazing collections of inspiration videos. In my opinion, there top of the list should be this one:
The Last Lecture – Randy Pausch
The most motivational video I’ve ever seen.
When you need to customize Alfresco content model, not always everything works fine so, it’s necessary to find a way to check if your model is correct or not. It’s possible to use the built-in Get Class Definitions webscript to debug. Basically, you can use this webscript to see if an expected content type exists on Alfresco or not. You can also use this webscript to see if an expected content type exists on Alfresco or not. All you have to do is to call the webscript with your class name which in this case myroot:mycontent for me.
http://localhost:8086/alfresco/service/api/classes/myroot_mycontent |
Or you can call the same webscript without a class name, in this case webscript will dump every content type that exists on Alfresco.
The response will be something like that:
{
"name": "labtest:Labtest_content",
"isAspect": false,
"isContainer": false,
"title": "Labtest content model",
"description": "",
"parent":
{
"name": "cm:content",
"title": "content",
"url": "/api/classes/cm_content"
},
"defaultAspects":
{
"sys:referenceable":
{
"name": "sys:referenceable",
"title": "Referenceable",
"url": "/api/classes/labtest_Labtest_content/property/sys_referenceable"
},
"sys:localized":
{
"name": "sys:localized",
"title": "Translation",
"url": "/api/classes/labtest_Labtest_content/property/sys_localized"
},
"cm:auditable":
{
"name": "cm:auditable",
"title": "Auditable",
"url": "/api/classes/labtest_Labtest_content/property/cm_auditable"
}
},
"properties":
{
"cm:name":
{
"name": "cm:name",
"title": "Name",
"description": "Name",
"dataType": "d:text",
"defaultValue": null,
"multiValued": false,
"mandatory": true,
"enforced": true,
"protected": false,
"indexed": true,
"url": "/api/classes/labtest_Labtest_content/property/cm_name"
},
"labtest:Labtest_result_name":
{
"name": "labtest:Labtest_result_name",
"title": "Labtest result name [java uses to get this content]",
"description": "",
"dataType": "d:text",
"defaultValue": null,
"multiValued": false,
"mandatory": false,
"enforced": false,
"protected": false,
"indexed": true,
"url": "/api/classes/labtest_Labtest_content/property/labtest_Labtest_result_name"
},
"cm:content":
{
"name": "cm:content",
"title": "Content",
"description": "Content",
"dataType": "d:content",
"defaultValue": null,
"multiValued": false,
"mandatory": false,
"enforced": false,
"protected": false,
"indexed": true,
"url": "/api/classes/labtest_Labtest_content/property/cm_content"
}
},
"associations":
{
"labtest:labtest_static_components":
{
"name": "labtest:labtest_static_components",
"title": "Labtest static components",
"url": "/api/classes/labtest_Labtest_content/association/labtest_labtest_static_components",
"source":
{
"class": "labtest:Labtest_content",
"mandatory": true,
"many": true
},
"target":
{
"class": "labtest:Labtest_static_component",
"mandatory": false,
"many": true
}
}
,
"labtest:labtest_dynamic_components":
{
"name": "labtest:labtest_dynamic_components",
"title": "Labtest dynamic components",
"url": "/api/classes/labtest_Labtest_content/association/labtest_labtest_dynamic_components",
"source":
{
"class": "labtest:Labtest_content",
"mandatory": true,
"many": true
},
"target":
{
"class": "labtest:Labtest_dynamic_component",
"mandatory": false,
"many": true
}
}
},
"childassociations":
{
},
"url": "/api/classes/labtest_Labtest_content"
} |
Sometime happens to receive some interesting requests from the business like “Hey man, take a look if there are some strange access to our web mail”. This tool it’s really useful for this kind of task: Log Parser Studio
It requires (in this case) a IISW3CLOG and a simple query like that:
SELECT TOP 20 cs-username AS UserID, cs(User-Agent) AS Application, cs-uri-stem AS Vdir, c-ip AS CLIENT, cs-method, COUNT(*) FROM '[LOGFILEPATH]' WHERE cs-uri-stem LIKE '%OWA%' GROUP BY UserID, Application, Vdir, Client, cs-method ORDER BY COUNT(*) DESC |
That’s all!
To download a remote file (like a PDF) redirecting to response output, use these instructions to update a your Spring MVC controller:
@RequestMapping(value="/viewAttach", method = RequestMethod.GET) public ModelAndView viewAttach(@RequestParam(value="article_id", required = true) String article_ref, HttpSession session, HttpServletResponse response) { /* *** Remember to check if Session still valid *** */ try { URL url = new URL(remoteURL); response.setHeader("Content-disposition", "attachment;filename=" + filename); //Set the mime type for the response response.setContentType("application/pdf"); // URLConnection connection = url.openConnection(); InputStream is = url.openStream(); BufferedOutputStream outs = new BufferedOutputStream(response.getOutputStream()); int len; byte[] buf = new byte[1024]; while ( (len = is.read(buf)) > 0 ) { outs.write(buf, 0, len); } outs.close(); } catch (MalformedURLException e) { logger.error("Error ModelAndView.viewMain - MalformedURLException : " + e.toString() + " -- " + e.getStackTrace()[0].toString()); return null; } catch (IOException e) { logger.error("Error ModelAndView.viewMain - IOException : " + e.toString() + " -- " + e.getStackTrace()[0].toString()); return null; } return null; } |
To import an Oracle exported file with *nix command line, use this command:
imp \'/ as sysdba\' file=expdat.dmp fromuser=ORIGINALUSER touser=DESTINATIONUSER |
Credit crunches are usually considered to be an extension of recessions. A credit crunch makes it nearly impossible for companies to borrow because lenders are scared of bankruptcies or defaults, which results in higher rates. The consequence is a prolonged recession (or slower recovery), which occurs as a result of the shrinking credit supply.
Read more: http://www.investopedia.com/terms/c/creditcrunch.asp#ixzz2M09MeA6H