How to modify the twitter4j code and rebuild a new jar? - twitter4j

When I was using Twitter4j streaming api, I always ended up with memory usage problem.
I searched the Internet and someone provided a method which requires modifying original code.
I don't know how to do it, so if anyone knows, please help me.
Detailed step will be appreciated.

In theory, you can build Twitter4J using Maven.
But in most cases, you don't need to build it by yourself.
My assumption is that the problem is that you're storing all coming tweets to memory.
Try storing them outside the heap such as file system or RDBMS.

Related

WordprocessingDocument.Close() throwing IsolatedStorageException

I am building up a chart with 582 literal data points. When I call WordprocessingDocument.Close() I get an IsolatedStorageException.
This doesn't make sense to me because the OpenXML SDK, as I understand it, is totally self contained writing data to a stream. There's no calls to Office or anything else that could hit this issue.
Be that as it may, is there anything I can do to avoid this issue?
thanks - dave
I did some research into the IsolatedStorageException related to large XLSX files and found solutions to your problem.
According to Eric White's blog, when legacy OpenXml generates a file larger than 10M it needs to take advantage of Isolated Storage. If mulitple threads access the Isolated Storage during report generation System.IO.Packaging will throw the IsolatedStorageException.
This is because the System.IO.Packaging that is baked into .NET was not written well enough to handle these scenarios. That System.IO.Packaging can't be changed.
To remedy this issue, you can try one of these solutions:
Refactor your code to use a new OpenXml built on a System.IO.Packaging that Eric White refactored to remove the Isolated Storage depedency. Check this chart for reference and use the correct NuGet command to bring in the new version without the WindowsBase dependency.
Don't refactor your OpenXml code, but change your report generation user interface to prohibit (if possible) or discourage generating files larger than 10M.
If your OpenXml code is embedded inside an IIS based web solution and refactoring your code is not feasible, try one of the solutions provided by this blog. These techniques aim to provide permissions needed by IIS to try and get around this exception and might not be related to Eric White's concern.
Without more information about your solution architecture, these are the solutions I can recommend at this time. Hope they help.

Datanuclues With Hbase Not Working With Collections Via JPA

Has anybody any experience with HBase usage with Datanucleus via JPA. I'm struggling to get Datanucleus to fetch collections for me from the Datastore. Any pointers would be much appreciated!
Dependencies:
https://github.com/ravindranathakila/www.ilikeplaces.com/blob/master/pom.xml
persistance.xml:
https://github.com/ravindranathakila/www.ilikeplaces.com/blob/master/src/main/resources/META-INF/persistence.xml
orm.xml:(with or without didn't make a difference though)
https://github.com/ravindranathakila/www.ilikeplaces.com/blob/master/src/main/resources/META-INF/orm.xml
The code works fine with OpenJPA and Apache Derby database, so I should say with respect to JPA, there are no big flaws.
Once again, some help or failure cases would be much appreciated!
The best approach in case you are using maven to build on datanucleus is to download the bundled libraries and give system paths to them(go for the HBase full bundle, and a release version). This will save a lot of your time resolving conflicts and missing jars.
Next comes enhancing the classes. This can be done as mentioned here. Try different approaches mentioned there if you keep hitting dependency issues (theoretically, you shouldn't be since you are using the downloaded libraries, unless there are version conflicts with different versions of the same file or HBase-Zookeeper versions)
While this does not solve the above problem, I'm endorsing the question with this answer to help others jump ahead in narrowing down issues pertaining to this.

Quickfixj :i need to know what is the limitations and the problems for QuickFixJ

i need to know what is the limitations and the problems for QuickFixJ since i want to start development on it and i want to know if there's any problems with
This is the jira page for QuickfixJ. You can see the list of bugs other people have discovered in QuickfixJ. But problems which are going to affect you depends on what you are doing with the library. But you do have the source code with you, so you can tweak as you want. If you want a better FIX engine, you have to get a commercial one rather than an open source one.

How do you evaluate a framework, library, or tool before adding it to your project?

There's so many cool ideas out there (ninject, automapper, specflow, etc) that look like they would help but I don't want to add something, tell others about it, and try using it just for it to be added to the growing heap of ideas that didn't quite work out. How can I determine if the promised benefits will happen and that it won't end up as something to be ignored or worked around?
Have a problem
Identify the cost of having the problem, or the value to solving it
Prioritize it against other problems
When it's the top priority, look for a solution that solves the problem with a proportional cost
Do you have the problem that ninject solves? Is it an important problem to solve? Is it the most important? What value will you get from solving it?
I don't think that you can tell whether any framework will deliver your expectations until you try it, and try it in anger and in context. This is usually time consuming and inevitably you'll have a few misses before you get any hits. Don't commit yourself by working through a simple sample from the authors website or howto files; these will always work and may impress but until you try to use the framework in the context of your billion user, multi-lingual, real-time on- and off- line application you're not going to find it's shortcomings.

understanding an API

I know that there are many API's like json,Facebook,twitter etc for developing related applications on iphone....but how to understand an API?This might be scilly question but I want to know how? what would you suggest for for a beginner?
You should find relevant documentation and read through some code examples utilizing the API.
If you are looking for information about the iphone, as the tag suggests, then read through the information here. There is an entire section dedicated to sample code. If you really can't understand how to make something work after some effort and some googling, then you can always ask on StackOverflow.
When ever I came through adding new API in my project I usually scan though documentation to find relevant topic to my project then after looking at the some sample code I usually start experimenting with the code to get the desired results and thats it because API is for short term use, you should not waste your precious time on just one API. So steps are, 1) find the relevant topic then 2) read sample code and 3) write your own code to get the desired results. 4) through away that API.
Cheers
Ayaz Alavi
If it's open source, read the code from beginning to end. Or to see why things were designed in a certain way, maybe try reimplementing parts of the API.