19 Mayıs 2014 Pazartesi

intro. to developing a Facebook app

In order to evaluate my thesis work, i have to prepare a website with a Connect with Facebook button. I am using Spring social api for Facebook functionality.
You have to enter your mobile phone and get a confirmation code to create a Facebook app from https://developers.facebook.com/ Apps tab. Unfortunately, this was a bit problematic for me, i waited more than an hour to get a confirmation code with sms. After creating a Facebook app, you obtain an app id and app secret. They are important for your application to run successfully. Moreover, in development mode, do not enter any app domain, but add your localhost address as a canvas url as explained in http://stackoverflow.com/questions/4532721/facebook-development-in-localhost.
Now, with the help of the app id and app secret, you are able to write your application..

Edit:
Facebook changed policy this month. The default Graph Api version is 1.0 for Facebook apps created before this month and 2.0 for apps created in this month. The facebook issues are summarized in http://www.nextscripts.com/known-issues/facebook-issues/

25 Ocak 2014 Cumartesi

the error: "org.neo4j.graphdb.NotInTransactionException"

The error message is somehing like this:

2014-01-25 16:37:43 ERROR HPAggregateProfile:141 - GRAMY_ERR:
org.neo4j.graphdb.NotInTransactionException
at org.neo4j.kernel.impl.index.IndexConnectionBroker.acquireResourceConnection(IndexConnectionBroker.java:49)
at org.neo4j.index.impl.lucene.LuceneIndex.getConnection(LuceneIndex.java:85)
at org.neo4j.index.impl.lucene.LuceneIndex.add(LuceneIndex.java:138)
at org.springframework.data.neo4j.support.typerepresentation.AbstractIndexingTypeRepresentationStrategy.add(AbstractIndexingTypeRepresentationStrategy.java:124)
at org.springframework.data.neo4j.support.typerepresentation.AbstractIndexingTypeRepresentationStrategy.addToTypesIndex(AbstractIndexingTypeRepresentationStrategy.java:116)
at org.springframework.data.neo4j.support.typerepresentation.AbstractIndexingTypeRepresentationStrategy.writeTypeTo(AbstractIndexingTypeRepresentationStrategy.java:59)
at org.springframework.data.neo4j.support.mapping.TRSTypeAliasAccessor.writeTypeTo(TRSTypeAliasAccessor.java:46)
at org.springframework.data.neo4j.support.mapping.TRSTypeAliasAccessor.writeTypeTo(TRSTypeAliasAccessor.java:26)

The solution is using transactions explicitly..
http://stackoverflow.com/questions/11485090/org-neo4j-graphdb-notintransactionexception

@Autowired
private GraphDatabaseService graphDb;

@Transactional
public void addRelation() {
  Transaction tx = graphDb.beginTx();
  ...
  tx.success(); //or tx.failure();
  tx.finish();
}

18 Ocak 2014 Cumartesi

the error:"Referenced file contains errors (http://www.springframework.org/schema/beans/spring-beans-4.0.xsd)"

The error message is:

Referenced file contains errors (http://www.springframework.org/schema/beans/spring-beans-4.0.xsd).

A related link:  http://stackoverflow.com/questions/7267341/validation-error-of-spring-beans-schema-inside-application-context
In summary, the error may be resolved by doing the following:
" It was caused by some cached files. After removing those items (Preferences -> General -> Network Connections -> Cache) everything worked as expected. "
However, in my condition it was not helpful :( Another cause is using different versions together as stated:
"This error may have appeared because you had a mix of 2.5 xsd and 3.0 xsd in your applicationContext.xml. "
When i removed the version info from every element in xsi:schemaLocation, the project compiled successfully..

8 Aralık 2013 Pazar

dependency injection in .net - ninject

i am spending this cold but bright sunday at home, since my mother had a simple surgery-like operation lately. So i am trying to solve some problems today to facilitate my week. One of those is refactoring my C# project by applying dependency injection.
Here is a short video which clearly explains the concept: http://www.youtube.com/watch?v=IKD2-MAkXyQ
My tool choice is ninject, since it is lightweight and does not require to write an xml for configuration. ( Despite being a SOA developer for several years in the past and dealt with bpel for a while, i still do not like using XML as a programming language. Here is an up-to-date discussion about it: http://programmers.stackexchange.com/questions/213316/xml-based-programming-languages )
Here is Ninject home page: http://www.ninject.org/
a sample chapter named Getting Started with Ninject can be downloaded from Scribd http://tr.scribd.com/doc/170865212/9781782166207-Mastering-Ninject-for-Dependency-Injection-Sample-Chapter
- a practical introduction mini-book: http://www.jeremybytes.com/Downloads/DependencyInjection.pdf
which barely mentions Ninject.