Hi! I have a HashMap where the key is a word and the value is a number of occurrences of that string in a text. Now I'd like to reduce this HashMap to only 15 most used words (with greatest numbers of occurrences). Do you have any idea to do this efficiently?
"Research code" is often held up as a paragon of what not to do when writing software. Certainly, the kind of code that often results from trying to solve a research problem can end up being poorly-designed, difficult to debug, etc.
But my question is this: does research code have to be this way? Is it possible to write good research code?…
When I run iPhone simulator (SDK 3.1.4, MacOS 10.5.7) standalone or from XCode - I see only black screen.
In the console I see a lot of:
"invalid pixel format"
"invalide context"
Any ideas what happens?
I am authenticating a login via CURL just fine. I have a variable I am using to display the returned HTML, and it is returning my user control panel as if I am logged in.
After authenticating, I want to communicate variables with a form on another page within the site; but for some reason the HTML from that page is returning a…
How can I "say" to SPARQL that ?churchname is in UTF-8 formatting? because response is like:Pražský hrad
PREFIX lgv: <http://linkedgeodata.org/vocabulary#>
PREFIX abc: <http://dbpedia.org/class/yago/>
SELECT ?churchname
WHERE
{
<http://dbpedia.org/resource/Prague> geo:geometry ?gm .
?church a lgv:castle…
I've written a couple of tests for a small web app, but I get an error when I try to run the page specific tests that makes use of WicketTester.
Google sends me to a mailing list for Apache Wicket, where a user experienced the same exception. He/she said the problem was that AnnotApplicationContextMock was initialized before…
Hi,
I need to get a
<rich:modalPanel id="mod1" .../>
component to load an external page on "show" action, defined as:
<a4j:commandButton value="link" id="l1" reRender="mod1" oncomplete="Richfaces.showModalPanel('mod1')">
<f:setPropertyActionListener target="#{mybean.someParam}"…
I'm ramping up on Vaadin and I'm getting this javascript alert whenever I try and run the demo apps.
GWT module 'com.vaadin.terminal.gwt.DefaultWidgetSet' may need to be recompiled
I've tried cleaning the project to no avail.
As I said, I'm ramping up so I'm sure there's some simple step I'm missing…
I want to embed a ShareThis/AddThis button on my site but the site's navigation relies on Hash tags in the url. Each page is assigned a unique hash value (ie, http://domain.com/index.php#products). Changing the navigation/page design isn't an option. Will these service preserve the hash value (both…
I have the following problem : I am given a tree with N apples, for each apple I am given it's weight and height,I can pick apples up to a given height H,each time I pick an apple the height of every apple is increased with U(also given).I have to find out the maximum weight of apples I can pick. …
I've got an application that keeps track of (for the sake of an example) what drinks are available at a given restaurant. My domain model looks like:
class Restaurant {
public IEnumerable<RestaurantDrink> GetRestaurantDrinks() { ... }
//other various properties
}
class…
Hi there.
I'm running a tomcat-6 server on Gentoo. I'm having trouble deploying Nexus to my tomcat server (nexus-war from the sonatype website, and tomcat6 via emerge). The localhost log displays the following when Nexus is started:
May 31, 2010 6:50:52 PM…
I have a local branch foo that started life as a branch off of master. Then I pushed it to my remote, and it's now happily living life with its siblings in remotes/origin
I want pull to automatically pull from remotes/origin/foo, and I want status -sb to show…
Hi,
I am trying to compile the latest Boost c++ libraries for Centos. I 've used bjam install and it has placed the libraries in /usr/lib and /usr/lib64.
The problem is I need the -mt variants for a specific application to run. I cannot understand in the…
This isn't homework, I've got a solution, however it doesn't protect against cheaters.
Three coworkers would like to know
their average salary. However, they
are self-conscious and don't want to
tell each other their own salaries,
for fear of…
You can easily set a stroke on a line series like this:
<mx:LineSeries yField="apple">
<mx:lineStroke>
<mx:Stroke
color="0x6699FF"
weight="4"
alpha=".8"
…
I'm thinking if there is a way to use javascript to pick up ANY ONE sentence from a textarea simply by clicking any position within that sentence.
I'm thinking along the line of
- first, get current cursor position (which I know how)
- second,…
here's my code:
select yr,count(*) from movie
join casting on casting.movieid=movie.id
join actor on casting.actorid = actor.id
where actor.name = 'John Travolta'
group by yr
here's the question
Which were the busiest years for 'John…
Given a Java SE 6 client, I would like to provide a configurable back-end: either directly to a database or through a web service which connects to a centralized DB. To that end, I've created some JPA- and JAXB-annotated entity classes and a…
I am developing an small html5 game, where I have the following code:
if(object.blocks){
var blocks = object.blocks, that = this;
each(blocks,function(index){
that.blocks.push(new Block(this[index]));
});
}
I receive…
How can I easily convert between manually written classes and WSDL-generated equivalents?
I have a Java SE 6 thick client that calls a web service to get and store data. The client has a DAO that works with my entity classes, calls…
Hi, I'm a little confused as to how i can delete a parent node of something which i can find via an xpath search:
$xml = simplexml_load_file($filename);
$data = $xml->xpath('//items/info[item_id="' . $item_id . '"]');
$parent =…