Jun 29, 2012

Best torrent site

1. www.scenetime.com
Initially you will get 3GB as initial UPLOAD credit. One this good here, you can create request for the torrent you can find. :) * THis is now invite sign up.

If you are willing to join to this site, please like their ST facebook page and join to ST facebook community group to get an invite. Just participate, the admin made the community alive and made lot of funs. Good Luck

2. torrenting.com
*Initially you will get 3GB as initial UPLOAD credit. * Still open for sign-up. Hurry
3. blues-brothers.biz Initially you will get 5GB as initial UPLOAD credit. The bad thing here if you go out, maybe get leave your account will be deleted. :(

4. torrentbytes.net
Still Open for new User.
No Initial upload quata, however you can earn upload credit by downloading freeleech torrent and seeds and when you uploading thats the time you are earning UL credit

5. tinym.eu
1Gb Initial Upload Quata

Jun 28, 2012

Struts - How to access Method from your action class to you JSP file.

From you action class
public class YourAction extends ActionSupport{ // NOTE to public this data so you can access in JSP public String name="Winzter"; public String getName() { return this.name; } } // class
From you JSP file.
<c:out value="${action.getName()}" escapeXml="false"></c:out>
If the property name was declare public, you can access by this one.
<c:out value="${name}" escapeXml="false"></c:out>
NOTE:${action.getName()} in only working on Tomcat7.x.x.

Jun 18, 2012

GAE - Handing Custom Error Page

Java

<static-error-handlers>
  <handlerfile="default_error.html" />
  <handlerfile="over_quota.html"error-code="over_quota" />
</static-error-handlers>

Python

error_handlers:
 -file:default_error.html
 -error_code:over_quota
  file:over_quota.html

Jun 14, 2012

YesPayment - Direct Connection Implemtation

Query

Inquire for the transaction Sample code in PHP
$client = new SoapClient('YOUR-WSQL_HERE');
//Query(string,string,int );
$resp = $client->Query(
          "YOUR-MERCHANT-CODE", // STR
          "MERCHANT-REFERENCE", //STR
          YOUR-TRANSACTION-TYPE); //INT
var_dump($resp->QueryResult->any  );

Jun 13, 2012

GAE - JSON implementation

Most of us also looking how to implement JSON on GAE. In one blog, posted how and he made it by create a POJO or maybe this was also called entity. Here's the impementation:
Class Response{
 public enum Status {
  ERROR, OK, WARNING
 }
 private Status status;
 private String message;

 public Response(Status status, String message)
 {
  this.status = status;
  this.message = message;
 }
 public String toJson() {
  Gson gson = new Gson();
  String json = gson.toJson(this);
  return json;
 }
 public static Response constructFromJson(String json)
 {
  Gson gson = new Gson();
  return gson.fromJson(json, Response.class);
 }
}
Here's how he implement:
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException
{
 resp.setContentType("text/plain");
 //do your work here
 ...
 PrintWriter out = resp.getWriter();
 Response response = new Response(Response.Status.OK, "A success!");
 out.print(response.toJson());
}
Here's response looks:
{“status”:”OK”,”message”:”A success”}

TODO: Maybe someone ask. What if I want a array. Maybe try to looks at it and see how the implementation. This maybe we create a ArrayList properity or array it self. :) Give credit to nadacode.com

Jun 4, 2012

Symfony: Get Module Name and Action Name

Get Module or Action name all over the code

sfContext::getInstance()->getModuleName()
sfContext::getInstance()->getActionName()

Get Module or Action name in you action file

$this->getModuleName()
$this->getActionName()

Get Module or Action name in template file

$sf_context->getModuleName()
$sf_context->getModuleName()