Monday, September 28, 2009

Blackberry and Twitter

For a long time RIM, the company behind blackberry, hold back on developing a twitter app. They found that companies like ubertwitter, twitterberry, and such could do the job. And they did the job quite nice however now RIM would like to jump the twitter bandwagon.

Crackberry.com is running a blogpost that RIM will launch a official twitter app. Nice.....

Python database abstraction


Even do I am going cover to cover (when I feel like it) in a Python book I sometimes likes to make a exception. This is one of those exceptions. I already have covered ADOdb in a previous blogpost. As you might recall I wrote a piece on on ADOdb in combination with PHP.

However I discovered that ADOdb is also available for Python. Now you have the option to write ADOdb statements and this abstraction layer will create the correct syntax when you deploy it on your database. Meaning that if you ever switch from a MS-sql database to a Oracle database you will not have to revise all your code. Simply tell the abstraction layer that it now should talk Oracle SQL instead of MS SQL and you are in business.


Thursday, September 24, 2009

Starbucks Iphone

Starbucks is launching a new app for the iPhone. It will be launched on the US version of AppStore first. As we all know strabucks is already a very internet friendly company and me included a lot of people have spend some time with a laptop in a Starbucks to get some work done.

Now Starbucks has launched which can help you enjoy it even more. It can help you locate a starbucks close to you so you will never spend to much time looking for a place to get coffee. You can also give credit points to coffee and in this was indicate what your favorite is. This will help starbucks to do some marketing I guess…..

A second part of the application can be used only in a couple of test starbucks in the US. You can place a amount on your iPhone app and use it to pay for your coffee. It works in the same way as yur starbucks card would do. Only difference is that it is now on your iPhone.

I am really wondering how this will fly. If this is a success and I guess it will be we will see a lot of those applications coming in the upcoming time for other companies. Gas stations for example can come to mind. So you phone will become more and more your wallet. Eventually someone will start to build a new app which is capable of holding all the custom apps. Years ago people where already talking about pay with your phone. Well I guess this is one of the best steps towards that goal. Some pilots and options with SMS pay are already tried and on the run at the moment however I feel personally that this is he first attempt in a way that it can be accepted by the public.

However, security comes to mind. I would love to dive into this to find out what the security is on this thing.

Tuesday, September 15, 2009

Nomee ..... NO!

Just been reading a item about Nomee on mashable.com by christina warren, nomee is a new tool where you can monitor and follow people on all kind of different social networks and channels.

A great app, and something that can help you, however,.... why a app? It is a application I have to download and install on my computer. I can not download it on my phone and why is it not just a web application.

Nomee, it looks great, it looks like fun however for me it is not a usable thing at this moment. Why not, I am on the move most of the time I have time to follow people, read stuff and such. So it has to be mobile. More mobile than Nomee is at the moment. A mashup for social networks is great however not in the form as Nomee envisions.



Saturday, September 12, 2009

IndentationError: expected an indented block

IndentationError: expected an indented block

Indentation is a big part of writing Python code, and it is a good thing in my opinion because it makes you write better and cleaner code. indentation is used to place code more to the right. so instead of writing your code like below;


#!/usr/bin/python
n = 1
i = 1
print "start code"
while n<=10:
i = 1
print "start the table of", n
while i<=10:
print i,"x 8 =", i*8
i=i+1
n=n+1
print "end code"


you have to write your code using indentations to make it work in python. Meaning a functioning code will look like this;


#!/usr/bin/python
n = 1
i = 1
print "start code"
while n<=10:
i = 1
print "start the table of", n
while i<=10:
print i,"x 8 =", i*8
i=i+1
n=n+1
print "end code"


As you can see it will make your code more readable because you can see what is inside a while look and what not. This is directly the reason why it is used in Python coding, not to make your code look nice, it has a functional part to it. In some languages you indicate the begin and end of a codeblock like a while loop with brackets, a { to start and a } to end the while block. In python you use indentations. If you do not make sure your indentation is correct you will most likely end with a " IndentationError: expected an indented block" error. Lucky for you a line number will be given so you can debug your code quickly.

Personaly I think that the use of indentation for codeblocks is great. It will learn you to write your code in a way that it is more readable for other developers. That is at least on this part. I remember re-writing code from other developers and first making sure all the indentation is correct so it becomes more readable, in in python that is no longer needed because if you have your indentation not set correct in your code you will not be able to run it in the first place. Meaning that, if your process is correct, no developer can commit code into production if the indentation is incorrect. That is to say, for the parts where it is needed.

Final word, indentation in Python code,….. a good thing.

Friday, September 11, 2009

Python while loop

As I will go cover to cover in a book about Python coding I will have to touch the loop section. A loop is in basics a repeating command until a criteria is matched. You will see loops in almost every language.

This is what Wikipedia has to say on it:
In most computer programming languages, a do while loop, sometimes just called a do loop, is a control flow statement that allows code to be executed repeatedly based on a given Boolean condition. Note though that unlike most languages, Fortran's do loop is actually analogous to the for loop.

The do while construct consists of a block of code and a condition. First, the code within the block is executed, and then the condition is evaluated. If the condition is true the code within the block is executed again. This repeats until the condition becomes false. Because do while loops check the condition after the block is executed, the control structure is often also known as a post-test loop. Contrast with the while loop, which tests the condition before the code within the block is executed.

It is possible, and in some cases desirable, for the condition to always evaluate to true, creating an infinite loop. When such a loop is created intentionally, there is usually another control structure (such as a break statement) that allows termination of the loop.

Some languages may use a different naming convention for this type of loop. For example, the Pascal language has a "repeat until" loop, which continues to run until the control expression is true (and then terminates) — whereas a "do-while" loop runs while the control expression is true (and terminates once the expression becomes false).




As can be seen below you can also nest a loop inside a loop:


#!/usr/bin/python
n = 1
i = 1
print "start code"
while n<=10:
i = 1
print "start the table of", n
while i<=10:
print i,"x 8 =", i*8
i=i+1
n=n+1
print "end code"




Wednesday, September 09, 2009

ORABPEL-05002

Recently I encounter a project where they used Oracle BPEL on a Oracle Application server 10G. It turned out that some of the BPEL processes suddenly stopped when waiting for a asynchronous callback method in BPEL.

After some searching I finally found a usable error message in one of the error logs. You can see it at the end of this blogpost. It turned out that this could be solved by changing some settings in XML configurtaion files. We found that by changing the transaction-timeout settings the problem is solved.

If you ever encounter a error like below you might want to check the "Setting Properties for BPEL Processes to Successfully Complete and Catch Exception Errors" section in this Oracle manual.

You will have to change some settings in $SOA_Oracle_Home\j2ee\home\config\transaction-manager.xml and in $SOA_Oracle_Home\j2ee\home\application-deployments\orabpel\ejb_ob_engine\orion-ejb-jar.xml . After this rememeber to stop and start to have the new settings activated.



<2009-09-03 14:05:07,617> failed to handle message
javax.ejb.EJBException: An exception occurred during transaction completion: ; nested exception is: javax.transaction.RollbackException: Timed out
javax.transaction.RollbackException: Timed out
--
at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
at oracle.j2ee.connector.messageinflow.MessageEndpointImpl.OC4J_invokeMethod(MessageEndpointImpl.java:297)
at WorkerBean_EndPointProxy_4bin6i8.onMessage(Unknown Source)
at oracle.j2ee.ra.jms.generic.WorkConsumer.run(WorkConsumer.java:266)
at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242)
at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215)
at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:814)
at java.lang.Thread.run(Thread.java:595)
javax.ejb.EJBException: An exception occurred during transaction completion: ; nested exception is: javax.transaction.RollbackException: Timed out
--
at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:35)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:119)
at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:55)
at oracle.j2ee.connector.messageinflow.MessageEndpointImpl.OC4J_invokeMethod(MessageEndpointImpl.java:297)
at WorkerBean_EndPointProxy_4bin6i8.onMessage(Unknown Source)
at oracle.j2ee.ra.jms.generic.WorkConsumer.run(WorkConsumer.java:266)
at oracle.j2ee.connector.work.WorkWrapper.runTargetWork(WorkWrapper.java:242)
at oracle.j2ee.connector.work.WorkWrapper.doWork(WorkWrapper.java:215)
at oracle.j2ee.connector.work.WorkWrapper.run(WorkWrapper.java:190)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:814)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.transaction.RollbackException: Timed out
at com.evermind.server.ApplicationServerTransaction.checkForRollbackOnlyWhileInCommit(ApplicationServerTransaction.java:633)
at com.evermind.server.ApplicationServerTransaction.doCommit(ApplicationServerTransaction.java:273)
at com.evermind.server.ApplicationServerTransaction.commit(ApplicationServerTransaction.java:162)
at com.evermind.server.ApplicationServerTransactionManager.commit(ApplicationServerTransactionManager.java:472)
at com.evermind.server.ejb.EJBTransactionManager.end(EJBTransactionManager.java:132)
... 29 more
<2009-09-03 14:05:07,618> Failed to handle dispatch message ... exception ORABPEL-05002

Message handle error.
An exception occurred while attempting to process the message "com.collaxa.cube.engine.dispatch.message.instance.PerformMessage"; the exception is: An exception occurred during transaction completion: ; nested exception is: javax.transaction.RollbackException: Timed out

ORABPEL-05002

Message handle error.
An exception occurred while attempting to process the message "com.collaxa.cube.engine.dispatch.message.instance.PerformMessage"; the exception is: An exception occurred during transaction completion: ; nested exception is: javax.transaction.RollbackException: Timed out


Tuesday, September 08, 2009

Twestival in Amsterdam

Looking for a party, hoping to meet all the people you know from twitter? Go and have fun at Twestival. Twestival is a festival which is organized and promoted using twitter. Between 10 and 13 September you will be able to find Twestival’s all over the world.

Twestival is not only about having fun, it is also about helping. The way it is done is you have to pay a small amount when you want to join a party and by this you give the money to a charity of your choice. For example in Amsterdam a party will be held in Odeon which is promoted and organized by @AncillaTilia.

So if you are looking for a great party, like to meet your twitter friends and help a good cause… go and find a local Twestival event and have a great party.