Sergeonclear

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Tuesday, January 25, 2011

jquery IE AJAX issues

Posted on 4:31 AM by Unknown
The list of issues when working with jquery IE AJAX issues are so huge and painful that I plan to maintain a log here :

1. trim() javascript function is not implemented in IE.
 Solution: Use $.trim('str ') instead of javascript trim()

2. Use javascript stacktrace jquery plugin. This is a life savior for identifying IE issues..
http://eriwen.com/javascript/js-stack-trace/
Open source in git here



Read More
Posted in jquery IE AJAX issues | No comments

Friday, January 21, 2011

Spring mvc 3 junit test

Posted on 3:03 AM by Unknown
Below is a code snippet to easily test a spring annotated web controller


public abstract class BaseWebControllerTest {
    @Autowired
    protected ApplicationContext context;
    protected MockHttpServletRequest request;
    protected MockHttpServletResponse response;
    protected HandlerAdapter handlerAdapter;

    public void before() {
        handlerAdapter = context.getBean(HandlerAdapter.class);
    }
   
    void handle(HttpServletRequest request, HttpServletResponse response) throws Exception {
        final HandlerMapping handlerMapping = context.getBean(HandlerMapping.class);
        final HandlerExecutionChain handler = handlerMapping.getHandler(request);
        assertNotNull("No handler found for request, check you request mapping", handler);

        final Object controller = handler.getHandler();

        final HandlerInterceptor[] interceptors = handlerMapping.getHandler(request).getInterceptors();
        for (HandlerInterceptor interceptor : interceptors) {
            final boolean carryOn = interceptor.preHandle(request, response, controller);
            if (!carryOn) {
                return;
            }
        }

        handlerAdapter.handle(request, response, controller);
    }

}


@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("/spring/test-app-config.xml")

public class MyControllerTest extends BaseWebControllerTest{
    MyController controller;

    @Before
    public void before() {
        super.before();
        controller = context.getBean(MyController.class);
    }

    @Test
    public void testGetRestRequest() throws Exception {
        request = new MockHttpServletRequest();
        response = new MockHttpServletResponse();
       
        request.setContentType("application/json");
        request.setMethod("GET");
        request.setRequestURI("/rule/"+id);

        handle(request, response);
       
        String result =response.getContentAsString();
        logger.info("RESULT : "+result);
        //assert json response is right.
    }
}

Reference:
http://efreedom.com/Question/1-2314377/Testing-Spring-MVC-Annotations

Read More
Posted in | No comments

Thursday, January 13, 2011

Batch scripts

Posted on 8:33 AM by Unknown
Context : If you are a java programmer? and you use tomcat  on windows? and you do not want repeated stress injury?
If yes then below are the scripts:

#1# Script to shutdown tomcat, deploy app, and startup ##
set tomcat_home=C:\..\apache-tomcat-6.0.20
set CATALINA_HOME = %tomcat_home%
cmd /c %tomcat_home%\bin\shutdown.bat

cmd /c mvn clean package -Dmaven.test.skip
rmdir /s /q %tomcat_home%\webapps\coacs

copy target\myhotapp.war %tomcat_home%\webapps
cmd /c %tomcat_home%\bin\startup.bat

#2# Run tomcat in debug mode  - store this under tomcat/bin as tomcat-debug.bat ##
set CATALINA_HOME=C:\Apps\apache-tomcat-6.0.20
set JPDA_ADDRESS=8000
set JPDA_TRANSPORT=dt_socket
%CATALINA_HOME%\bin\catalina.bat jpda start




Read More
Posted in | No comments

Friday, January 7, 2011

Oracle fix for schema table prefix and running scripts from sql developer

Posted on 8:04 AM by Unknown
In oracle it appears like a NON_OWNER user though granted access(select, insert, delete, update) to tables created by OWNER of the table cannot directly view them without the schema prefix.

This would mean all the queries in the java application will have to have this table owner user name prefix.

The possible options to drop this prefix :

1. ALTER SESSION SET CURRENT_SCHEMA= OWNER_SCHEMA ; (AFTER LOGON trigger as mentioned here )
But this works only for the current session unless we have a logon trigger. This seems like a preferred approach as per various forum threads.

2. Create views/synonyms from the NON_OWNER current user per table. So the tables can be accessed without prefix.

3. It could be something simpler as well (I am no DB expert) like setting the default current schema for the NON_OWNER user in some other way.


Running scripts from SQL developer:


To run this from sqldeveloper :
1. Set a default Path: Tools menu > Preferences > Database > Worksheet > Select default path to look for scripts
2. open run.sql from sqldeveloper File > Open
3. Run script.

Read More
Posted in oracle table previlege | No comments

Tuesday, January 4, 2011

iPhone apps - App-le a day

Posted on 3:18 AM by Unknown
iPhone apps seems like the new trend and what else should a developer be doing in his spare time?



My motivation:

1. Millions of users. You can share apps with the world and make a small earning till iphone user base exists. Isn't that cool

2. Its market place is excellent

3. One of the best integration of technology man possesses - all in the palms of your hand.

4. Good way to know more about Apple & their products.





Few iPhone apps that I have been churning are now live on itunes:




1. AutoSignIn(free) - formerly called LogMeIn.




An auto login app to help you login to most of the popular sites -like gmail, admob, ebay, yahoo, gdocs, etc.. As iphone has no provision to store your password/email this should be handy. I use most of the time.
The idea is that you dont need an app for every popular website on the internet. Just an autologin app should do as most websites are mobile friendly these days.
Was formerly called
LogMeIn. Due to copyright issues had to rename to AutoSignIn with a better icon. Hope we enjoy.

2. gDox (free)



An auto login app for gDocs. Live now.




3. Radio players (free)



Has a very intuitive interface for couple of iphone radio apps i have been spamming itunes store with (until they said no more). Some are regional. Below is the list.
  • Radio kannada
  • Tamil Hits
  • Telugu hits
  • Radio Eye - English radio stations organized based on top stations and genre
  • Hindi hits




4. aMaze!! (free)



An attempt to use Chipmunk physics engine and sparrow framework to build a maze game with balls moved into target square through iphone movement. Its a free app with some nice music and interface (except that the physics engine is not that great).
Learnings:
Chipmunk C library is free but hard to code(its objective C library costs 200 bucks and i didn't wanted to shell out a $). Though this was a good experience with physics engine, i found it to be unstable and not so easy to work around memory and timer issues of chipmunk C library. Would not recommend anyone to use chipmunk c library (don't know if the paid objective C bundle is better). Better go for cocos 2d. Its more popular.



5. Java JEE IQ (Was $1. Now free)



Java/j2ee quick notes for revision etc esp. during interview. It consists of notes from an industry perspective- has spring/hibernate/struts/JSR's/core java/ etc and some useful pdfs. This was my first app and i spent a lot of time learning objective c/buying macbook & ipod touch/installing snow leopard/xml parsing library/xcode/interface builder/ and understanding how to make a release to itunes. I am charging a $ for all that effort of mine. Hope it is acceptable.




All the above apps can be found by searching 'bri8' on itunes store or following this link:
http://itunes.apple.com/us/artist/bri8-ltd/id396468155



Read More
Posted in iphone apps bri8 apple | No comments

OpenID

Posted on 2:27 AM by Unknown
It is so convenient to pull out information from account which user already has instead of making the user key in the boring registration form. In a way it follows DRY(do no repeat yourself) principle.

Here comes OpenID. You can also auto register the user with this php script. Cool stuff for my community site..

Open ID +PHP : http://devzone.zend.com/article/3581

Read More
Posted in | No comments
Newer Posts Older Posts Home
Subscribe to: Comments (Atom)

Popular Posts

  • LinuxPerformance Tuning(apache,tomcat,linux) and related
    Web profiling -- HTTPAnalyzer -- -- YSlow --CSS,Javascript report , time/size measurement for individual component is good. -- F...
  • (no title)
    Hardware/Software stack:  iPhone 3Gs having iOS 5.1.1(latest as of today).  The Xcdode 4.2 failed to detect this iphone as it has support on...
  • Spring interceptor ordering
    SimpleUrlHandlerMapping uses a hashMap to hold the interceptors. Ordering can only be guaranteed by setting  order property.. By default it ...
  • SVN/ Subversion Tips and traps
    SVN could be tricky and waste a hell lot of time. Case Issue : Normally we run SVN server in linux. Our dev env will be in windows NT. Windo...
  • Liferay CMS/ web content management/ workflow/ staging
    Liferay out of the box has a web content management system. The web pages can mostly have these web content (articles) as web pages. The web...
  • Cobertura- junit coverage tool
    First, you need to add a task definition to the build.xml file. This top-level taskdef element specifies that the cobertura.jar file is i...
  • XSLT caching Transformers
     The usage of cached transformer objects is recommended here A sample implementation of CachingTransformerFactory is here The above code abs...
  • Rewrite rules in apache and IIS
    Well we can control how the server serves stuff to clients by defining rewrite rules. As servers are dumb, its important to explain well abo...
  • Real-Time Tracking and Tuning for Busy Tomcat Servers
    A very nice article which details on possible options for tomcat server monitoring to tweak its performance. http://www.devx.com/Java/Articl...
  • External Javascript from Java Servlets
    Copied from http://myappsecurity.blogspot.com/2007/01 Like to thank anurag for the content. /breaking-same-origin-barrier-of.html External ...

Categories

  • AJAX javascript
  • All about UK Visa HSMP VS H1
  • All about UK Visa HSMP VS H1 hsmp assistance
  • amazon
  • android apps ship control radio hindi
  • Apache 2.x setup Quick guide for Linux
  • apache commons configurator usage
  • apache commons usage
  • arsenals for developers
  • article
  • Batch script to load developer environment
  • Blind folded chess
  • Castor castor convert dtd to xsd
  • cloud comparision price
  • cloud comparison blog
  • cloud computing monthly price
  • cloud usage
  • Cobertura- junit coverage tool
  • Code generators
  • cron jobs expressions
  • cruisecontrol cruise control
  • debugging eclipse tips
  • developer tools
  • document library
  • easy mock jmock vs mocking java tdd
  • External Javascript from Java Servlets
  • fedora 9 lenovo 3000 n200 windows xp dual boot problem
  • Fire fox plugins and tweaks
  • Free PHP hosting
  • gods debris the religion war scott adams dilbert
  • google app engine
  • gwt javascript
  • hibernate second level cache
  • i18n locale localization internationalization spring liferay portlet locale
  • ibatis sybase mapping
  • image gallery
  • iphone apps bri8 apple
  • iphone shsh 3gs ipsw downgrade ifaith tinyumbrella ios5.1.1 to ios5.0
  • java
  • java JDBC
  • javascript junit testing
  • Javascript trouble shooting tool
  • Jboss overview
  • jmeter load testing custom java sampler javasamplerclient xml test
  • JNDI test JSP page
  • Joomla CMS
  • JProfiler setup jprofiler on linux
  • jquery IE AJAX issues
  • jquery spring AJAX
  • keyboard music java typing soothing notes auto suggest
  • liferay kids version
  • liferay web 2.0 java/j2ee
  • linux - the difference between hard and soft links
  • linux mysql
  • linux mysql setup quick start
  • Linux ssh autologin with putty
  • LINUX usefuls
  • linux)
  • LinuxPerformance Tuning(apache
  • log4j setup useful
  • lucene solr
  • mac m701 android skype not working crash
  • maven
  • maven cut reduce build time
  • microsoft ODBC oracle dll connection issues
  • Mobile Ad Services (adwhirl)
  • opsourcecloud
  • oracle connect by hierarchy
  • oracle table previlege
  • Oracle thin vs OCI(type II/thick) drivers
  • pdf 2 text
  • Pega PRPC
  • php
  • rackspacecloud
  • Rewrite rules in apache and IIS
  • scaffold
  • setting up a static ip on SKY broadband
  • setup quick start
  • Single Sign on - OpenSSO with Liferay
  • smart gwt
  • smtp email test mock server james
  • SMTP MAIL telnet windows
  • Software tools mind map freemind j2ee tools
  • Speed typing tips.
  • Spring + Hibernate Usefuls BaseDAOHibernate
  • Spring annotations with spring-mock not working 2.0 2.5.6
  • spring jndi datasource lookup
  • Spring portlet mvc and spring servlet mvc validation
  • Spyware trojan and virus removal tools
  • struts magic
  • SVN/ Subversion Tips and traps
  • tabbed ms dos console cygwin console
  • Texter - An auto text expander autotyper
  • Textpad tricks
  • The art of debugging
  • tomcat
  • Tomcat Exploded war - cut deployment time
  • Tomcat on linux tips
  • Tomcat on linux tips commands
  • TypeIt4Me
  • Typinator
  • Useful Eclipse Plugins
  • Useful Eclipse Plugins eclipse shortcuts keys
  • Useful tools
  • web content
  • xcode cocos2d iphone box2d
  • xpath xml xquery

Blog Archive

  • ►  2013 (19)
    • ►  August (17)
    • ►  July (1)
    • ►  January (1)
  • ►  2012 (7)
    • ►  August (1)
    • ►  June (4)
    • ►  April (2)
  • ▼  2011 (20)
    • ►  November (1)
    • ►  October (1)
    • ►  August (1)
    • ►  July (3)
    • ►  June (1)
    • ►  April (2)
    • ►  March (4)
    • ►  February (1)
    • ▼  January (6)
      • jquery IE AJAX issues
      • Spring mvc 3 junit test
      • Batch scripts
      • Oracle fix for schema table prefix and running scr...
      • iPhone apps - App-le a day
      • OpenID
  • ►  2010 (27)
    • ►  December (3)
    • ►  July (2)
    • ►  May (3)
    • ►  April (2)
    • ►  March (5)
    • ►  February (10)
    • ►  January (2)
  • ►  2009 (32)
    • ►  December (5)
    • ►  November (2)
    • ►  September (3)
    • ►  August (6)
    • ►  June (4)
    • ►  May (4)
    • ►  April (3)
    • ►  March (2)
    • ►  February (3)
  • ►  2008 (28)
    • ►  December (1)
    • ►  October (2)
    • ►  September (2)
    • ►  August (4)
    • ►  July (7)
    • ►  June (1)
    • ►  April (2)
    • ►  March (2)
    • ►  February (2)
    • ►  January (5)
  • ►  2007 (24)
    • ►  December (3)
    • ►  November (2)
    • ►  October (6)
    • ►  September (1)
    • ►  August (3)
    • ►  July (8)
    • ►  June (1)
Powered by Blogger.

About Me

Unknown
View my complete profile