If you ever have to create cron expressions (I do while working with the Quartz Scheduler) these links may be helpful to you.
Firstly a basic cron expression tutorial for quartz (what they are, the basics and some examples)
http://www.quartz-scheduler.org/documentation/quartz-1.x/tutorials/crontrigger
some more examples of working with the cron format
http://www.nncron.ru/help/EN/working/cron-format.htm
And finally a useful website which can generate basic cron expressions for you and can be used to check that cron expression you have written do what you think they do.
http://www.cronmaker.com/
Hope this helps
Tuesday, 31 July 2012
Tuesday, 24 July 2012
Using Anchors in oracle apex
When creating an apex chart I put in a feature where the user could refresh the page after changing a select list value. This left me with a problem as the chart was at the bottom of the page and when the page reloaded the focus was repositioned at the top meaning the user would have to scroll down. To fix this I used an anchor in the page and then navigated to the anchor in the branch of my page.
I thought I'd blog this as I only saw how to do it as a throw away comment on a forum post and if like me you didn't know how to do this you may find this entry useful.
The technique is simple really create an anchor in the location I want the page to scroll to. In apex this would most likely be the top of a region so you can put it in the title of the region e.g.
<a name ="CHART" ></a>Hourly Report
CHART will be the anchor and Hourly Report the title of your region
Now if you have a branch that submits the page to refresh the graph then you can use the value of the anchor to navigate to that region.
To do this add #CHART (or # followed by your anchor value) to the "with these values" field under actions (branch to page in this application with the page set to the current page). Now that branch will take you to the anchor. this technique will work for anchors on other pages as well.
Note: if you look at the branch later it will redirect to a url like
f?p=&APP_ID.:39:&SESSION.::&DEBUG.:::#CHART
Hope this helps
Wednesday, 11 July 2012
Finding Duplicate and similar records in Oracle Table
One of the things I have recently learnt is a way to find duplicates in Oracle tables. I have seen ways to do this but have not come across the method I am going to put in this blog so hopefully some of you will find it useful.
The technique is to use aliases rather than counts (which I have seen on other forums) to select from the table twice.
The basic query is
SELECT t1.column_name,
FROM table t1, table t2
where t1.column_name = t2.column_name,
and t1.column_ID <> t2.column_ID
This means that we are checking if there exist records that share the column value we are testing (column_name) but have a different ID/primary key.
The real problem I faced however was finding records where part of the value was a duplicate. In this case I needed to identify values such as example_xxx and example_yyy with the yyy ending being an incorrect entry.
To do this I used the replace function so the query looks like this
SELECT t1.column_name, t2.column_name
FROM table t1, table t2
where replace(t1.column_name, '_xxx', '') = replace(t2.column_name,'_yyy',''),
and t1.column_ID <> t2.column_ID
The technique is to use aliases rather than counts (which I have seen on other forums) to select from the table twice.
The basic query is
SELECT t1.column_name,
FROM table t1, table t2
where t1.column_name = t2.column_name,
and t1.column_ID <> t2.column_ID
This means that we are checking if there exist records that share the column value we are testing (column_name) but have a different ID/primary key.
The real problem I faced however was finding records where part of the value was a duplicate. In this case I needed to identify values such as example_xxx and example_yyy with the yyy ending being an incorrect entry.
To do this I used the replace function so the query looks like this
SELECT t1.column_name, t2.column_name
FROM table t1, table t2
where replace(t1.column_name, '_xxx', '') = replace(t2.column_name,'_yyy',''),
and t1.column_ID <> t2.column_ID
Friday, 1 June 2012
how to stop skype sound transferring from headphones to speakers
While working I like to use my headphones to listen to music etc. It can be quite annoying however when I receive a skype message or call and the sound transfers to my computers loud speakers . In order to resolve this go to
Tools > Options > Audio settings
set Speakers to Speakers/Headphones
set Ringing to use selected speakers
save the settings
This worked for me, hope it helps
Tools > Options > Audio settings
set Speakers to Speakers/Headphones
set Ringing to use selected speakers
save the settings
This worked for me, hope it helps
Thursday, 17 May 2012
No unique bean of type [javax.persistence.EntityManagerFactory] is defined: expected single bean but found 0
If you come across the error
No unique bean of type [javax.persistence.EntityManagerFactory] is defined: expected single bean but found 0
while using rest web services add the configuration
<import resource="classpath:upgrade-downgrade-business-context.xml"/>
to your servlet.xml file
hope this helps, it worked for me
No unique bean of type [javax.persistence.EntityManagerFactory] is defined: expected single bean but found 0
while using rest web services add the configuration
<import resource="classpath:upgrade-downgrade-business-context.xml"/>
to your servlet.xml file
hope this helps, it worked for me
@RequestMapping - A quick tutorial on Multiple and Conditional Parameters
I've been doing some work with recently creating Java rest web services. In doing this I've learnt a couple of nifty things about the @RequestMapping annotation. This information seems to be spread around quite a lot of forums etc so I thought it would be good to compile it into one tutorial.
The @RequestMapping annotation is used to define the URL pattern that will trigger your code when the web service is called.
So an annotation Like this
@RequestMapping(value = "/example/{id}", method = RequestMethod.GET)
public Example exampleMethod(@PathVariable("id") Long id){
...Code goes here
}
means that the method exampleMethod will be triggered by a URL like this
http://llocalhost:8080/example-ws/example/13
Two things I've seen asked on the internet quite a lot is how can I have multiple mappings and conditional mappings.
Multiple Mappings
The value parameter of @RequestMapping is of type String [] so an annotation of the form
@RequestMapping(value = {"/example", "/example/{id}"}, method = RequestMethod.GET)
Will allow both the urls
http://llocalhost:8080/example-ws/example/13 and http://llocalhost:8080/example-ws/example
to execute the code that follows the annotation.
Conditional Mappings
If you want to execute different code based on what url is sent then simply have multiple methods using different @RequestMapping parameters
so in the same class you would have
@RequestMapping(value = "/example1/{id}", method = RequestMethod.GET)
...Method 1 goes here
and
@RequestMapping(value = "/example2/{id}", method = RequestMethod.GET)
...Method 2 goes here
this would allow you to call method 1 with
http://llocalhost:8080/example-ws/example1/13
and method 2 with
http://llocalhost:8080/example-ws/example2/13
Hopefully you find this tutorial helpful as it took me a while to find this information
The @RequestMapping annotation is used to define the URL pattern that will trigger your code when the web service is called.
So an annotation Like this
@RequestMapping(value = "/example/{id}", method = RequestMethod.GET)
public Example exampleMethod(@PathVariable("id") Long id){
...Code goes here
}
means that the method exampleMethod will be triggered by a URL like this
http://llocalhost:8080/example-ws/example/13
Two things I've seen asked on the internet quite a lot is how can I have multiple mappings and conditional mappings.
Multiple Mappings
The value parameter of @RequestMapping is of type String [] so an annotation of the form
@RequestMapping(value = {"/example", "/example/{id}"}, method = RequestMethod.GET)
Will allow both the urls
http://llocalhost:8080/example-ws/example/13 and http://llocalhost:8080/example-ws/example
to execute the code that follows the annotation.
Conditional Mappings
If you want to execute different code based on what url is sent then simply have multiple methods using different @RequestMapping parameters
so in the same class you would have
@RequestMapping(value = "/example1/{id}", method = RequestMethod.GET)
...Method 1 goes here
and
@RequestMapping(value = "/example2/{id}", method = RequestMethod.GET)
...Method 2 goes here
this would allow you to call method 1 with
http://llocalhost:8080/example-ws/example1/13
and method 2 with
http://llocalhost:8080/example-ws/example2/13
Hopefully you find this tutorial helpful as it took me a while to find this information
Monday, 9 April 2012
Scenario Workflow Failure [cor:999995] - sky go
The error Scenario Workflow Failure [cor:999995] seems to occur if your computer loses power while watching sky go.
If anyone has experienced the error
Scenario Workflow Failure [cor:999995] on sky go here's how to fix it
http://helpforum.sky.com/t5/Using-Sky-Go/Scenario-Workflow-Failure-cor-999995/td-p/238639/page/2
hope this helps.
Also Sky go won't work with ad block enabled.
If anyone has experienced the error
Scenario Workflow Failure [cor:999995] on sky go here's how to fix it
- Right click on the video play area
- Click silverlight then go to the application storage tab
- Delete all lines that reference sky
- Make sure the download check box under the play back tab is checked
- refresh the browser
http://helpforum.sky.com/t5/Using-Sky-Go/Scenario-Workflow-Failure-cor-999995/td-p/238639/page/2
hope this helps.
Also Sky go won't work with ad block enabled.
Subscribe to:
Posts (Atom)