Half Life 2 has got some problem on Vista 64 bit, it keeps crashing with a pop up message:
available memory less than 128mb!!! -1Solution for this is to run Half Life in Windows XP Compatibility Mode, right click on the short-cut of Half Life, click on the Compatibility tab, select Run this program in compatibility mode for:
Login to https://localhost:4848 (admin panel). Go to the Network Config > Network Listener and select the listener for which you want to enable gzip. Click on the HTTP tab, see below:
Scroll down until you get the following entries:
Select Compression= on, Put the mime types and click on Save button.
Its done!!
jtpl is a light-weight java template engine, which is good for small size application but becomes sludgy for data intensive apps. Following example shows how to use jtpl with mysql.
jtpl replaces everything which is put inside {} and it uses html comments as entry and exit points
< ! -- BEGIN: main -- >this template file should be saved with the extension .jtpl
{This will be replaced by jtpl}
{ThisToo}
< ! -- END: main -- >
In your servlet you need to create a Template object which will take template file as input parameter.
Template tpl = new Template(new File("FULL_PATH\\home.jtpl"));
next you need to assign the value to the template parameters like:tpl.assign("ThisToo", "Assigned Value Here !"); in the end template is parsed using tpl.parse("main"); If you have nested template regions in a template like this:< ! -- BEGIN: main -- >Everything remains same except when you parse, you'll have to parse the inner region first, like:
< ! -- BEGIN: header-- >
{Links}
< ! -- BEGIN: header-- >
< ! -- END: main -- >
tpl.parse("main.header"); then the outer (or main) region:tpl.parse("main"); You can put as many regions you want inside a main region.Using jtpl with mysql(or any other db) is simple as explained above. Here is a sample template file home.jtpl:
<!-- BEGIN: main1 -->
<html>
<head>
<title>{PTITLE}</title>
</head>
<body>
<div>
<div>
<a class="a" href="/anylink1">{LINK1}</a>
<a class="a" href="/anylink2">{LINK2}</a>
<a class="a" href="/anylink3">{LINK3}</a>
</div>
</div>
<div>
<div>
<div>
<!-- BEGIN: div -->
<div>
<a target="_blank" href ="{LINK}">{TITLE}</a>
<br><span>{CONTENT}</span>
</div>
<!-- END: div -->
</div>
</div>
</div>
</body>
</html>
<!-- END: main1 --> and here is the Servlet:import net.sf.jtpl.Template;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.sql.*;
/**
*
* @author viksin
*/
public class sample extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();
try {
out.print(this.generatePage());
} catch (Exception e) {
e.printStackTrace(out);
} finally {
out.close();
}
}
protected String generatePage() throws Exception {
Template tpl = null;
Connection conn = null;
Statement st = null;
ResultSet rs = null;
String Content = "";
TimeCalc tc = new TimeCalc();
tpl = new Template(new File("FULL_PATH\\home.jtpl"));
tpl.assign("PTITLE", "MySite");
tpl.assign("LINK1", "Home");
tpl.assign("LINK2", "News");
tpl.assign("LINK3", "About");
try {
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
conn = DriverManager.getConnection("mysql_URL", "USERNAME", "PASSWORD");
st = conn.createStatement();
rs = st.executeQuery("select title,link,content from table");
while (rs.next()) {
tpl.assign("TITLE", rs.getString("title"));
tpl.assign("CONTENT", rs.getString("content"));
tpl.assign("LINK", rs.getString("link"));
tpl.parse("main1.div");
}
tpl.parse("main1");
} catch (Exception ex) {
return ex.toString();
} finally {
if (rs != null) {
rs.close();
}
if (st != null) {
st.close();
}
if (conn != null) {
conn.close();
}
}
return (tpl.out());
}
}
jtpl is meant for small and simple applications, it does not have many features which other template engines like velocity, stringtemplate etc. have.jtpl also uses the SingleThreadModel which is not recommended also it gets slower with large data.
Presently I am using StringTemplate which is faster and better than jtpl.
1) The Sopranos
2) Carnivale
3) Scrubs
4) Dead Like Me
5) 24
6) The Life and Times of Tim
7) Rome
8) John Adams
9) Avatar the last Airbender
10) Psych
11) That 70's Show
12) Curb Your Enthusiasm
13) Dexter
14) Heroes
15) Bones
3. Self Employment
4. Get a powerful server for natmac.org
Finally they are out but after using the combo, I have realized that the best integration of both was glassfish v2.1 and netbeans 7.1.
The new combo has got some troubles in integration I think (or I may be doing something wrong!). Whenever I try to restart the glassfish from netbeans, it stops but does not start properly, when browsing an application I get blank pages. Again I stop the server and start it from the console it works fine.
Creating virtual server is still a nightmare as it was in Beta release of GF.
Keep getting this exception in server log all the time:
SEVERE: PWC3989: An exception or error occurred in the container during the request processingOne reason may be enabling the Comet support in GF, but no exact idea.
java.lang.ClassCastException: com.sun.grizzly.config.ContextRootInfo cannot be cast to org.apache.catalina.Context
at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:511)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:273)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.comet.CometEngine.executeServlet(CometEngine.java:473)
at com.sun.grizzly.comet.CometEngine.handle(CometEngine.java:341)
at com.sun.grizzly.comet.CometAsyncFilter.doFilter(CometAsyncFilter.java:84)
at com.sun.grizzly.arp.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:161)
at com.sun.grizzly.arp.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:137)
at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:88)
at com.sun.grizzly.http.TaskBase.run(TaskBase.java:189)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:619)
Don't put anything unknown inside C:\Program Files\sges-v3\glassfish\domains\domain1\docroot, you'll start receiving this warning and any JSP application will stop working.
WARNING: StandardWrapperValve[jsp]: PWC1406: Servlet.service() for servlet jsp threw exceptionWaiting for the fixes!!
org.apache.jasper.JasperException: PWC6345: There is an error in invoking javac. A full JDK (not just JRE) is required
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:89)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:375)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
at org.apache.jasper.compiler.Jsr199JavaCompiler.compile(Jsr199JavaCompiler.java:200)
at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:380)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:449)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:620)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:483)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:373)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.comet.CometEngine.executeServlet(CometEngine.java:473)
at com.sun.grizzly.comet.CometEngine.handle(CometEngine.java:341)
at com.sun.grizzly.comet.CometAsyncFilter.doFilter(CometAsyncFilter.java:84)
at com.sun.grizzly.arp.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:161)
at com.sun.grizzly.arp.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:137)
at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:88)
at com.sun.grizzly.http.TaskBase.run(TaskBase.java:189)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Unknown Source)
tormac.info is a torrent search engine which uses Google custom search service to search 250+ torrent sites.
Created it after getting frustrated jumping from one torrent site to another site for a video.
It also displays latest feeds updated on a few torrent sites.
News:
- Netbeans 6.8 and Glassfish v3 released today.
- Got a new 1.4kva UPS
- updated natmac.org home page
RSS and ATOM are XML specifications for web syndication. 9am completely depends on RSS/ATOM feeds discovered on the web, it uses Argotic Syndication Framework .Net library for parsing the feed, it is able to do the job most of the time, but whenever it encounters an unwanted element in the feed it throws an exception, which is expected. But my question is why these unwanted elements are there at first place? Have a look at these two RSS 2.0 feeds:
<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>Liftoff News</title>
<link>http://liftoff.msfc.nasa.gov/ </link>
<description>Liftoff to Space Exploration.</description>
<language>en-us</language>
<pubDate>Tue, 10 Jun 2003 04:00:00 GMT</pubDate>
<lastBuildDate>Tue, 10 Jun 2003 09:41:01 GMT</lastBuildDate>
<docs>http://blogs.law.harvard.edu/tech/rss </docs>
<generator>Weblog Editor 2.0</generator>
<managingEditor>editor@example.com</managingEditor>
<webMaster>webmaster@example.com</webMaster>
<item>
<title>Star City</title>
<link>http://liftoff.msfc.nasa.gov/news/2003/news-starcity.asp </link>
<description>How do Americans get ready to work with Russians aboard the International Space Station? They take a crash course in culture, language and protocol at Russia's Star City </description>
<pubDate>Tue, 03 Jun 2003 09:39:21 GMT</pubDate>
<guid>http://liftoff.msfc.nasa.gov/2003/06/03.html#item573 </guid>
</item>
</channel>
</rss>
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<item>DDI NEWS</item>
<link>http://www.ddinews.com </link>
<description>The latest news from Doordashan news - India's largest broadcaster</description>
<copyright>Copyright: (C) Doordarshan News</copyright>
<item>
<title>Climate talks make progress, pressure on US </title>
<description>Environment ministers made progress on Tuesday towards a scaled-down climate deal in Copenhagen next month, with Washington facing pressure to promise deep cuts by 2020 in greenhouse gas emissions. </description>
<link>http://www.ddinews.gov.in/Homepage/Homepage+-+Headlines/Climate+talks+make+progress.htm</link>
<pubDate>11/18/2009 1:53:18 PM</pubDate>
</item>
</channel>
</rss>
This is one of the problems which I have observed along with the following:
1. Tag <language> missing or most of the time it has value "en-us" no matter what is the language used in the feed.These are a few problems which I have seen with the web feeds, although I am talking about only RSS 2.0 here, similar problems can be imagined with ATOM/BLOGML and other syndication formats.
2. Tag <pubDate> is missing or having some wrong value.
3. Mismatch between the actual format of the feed and the format declared in <rss version="??"> tag.
4. Description is missing.
5. Feed Title is missing.
6. Item Title is missing ...most stupid and irritating.
7. Incomplete/Relative url in <link> tag




