Search Results

Search found 4 results on 1 pages for 'bball'.

Page 1/1 | 1 

  • Complex string matching with fuzzywuzzy

    - by That1Guy
    I'm attempting to write a process that matches obscure strings to a single 'master string' for further processing. I have a lot of data that looks something like this: Basketball Basket Ball Football BasketBallR BBall BBall - r FootB ...and so on. These need to be mapped to a master record like so: Basketball = Basket Ball, BBall Basketball - R = BasketBallR, BBall - r I also have instances of data resembling this format: Football -r FootBall - r-g/H,Q,HH These situations need to be separated into different categories before being mapped. For example FootBall - r-g/H,Q,HH should be: Football - r Football - g Football - H Football - Q Football - HH At this point, it still needs to be mapped to a master record... I've tried several different combinations of fuzzywuzzy matching methods, Levenshtein Distance measurements, regex, etc. and can't seem to find a reliable method to logically associate different naming styles of a single item with a master name. I'm throwing my hands up in desperation. Are there any existing python resources than can help sort out my problem? Are there other options? Can anybody point out an obvious option that I might have overlooked? Basically, any suggestion, solution, resource or alternative method is greatly appreciated.

    Read the article

  • Beginner question: ArrayList can't seem to get it right! Pls help

    - by elementz
    I have been staring at this code all day now, but just can't get it right. ATM I am just pushing codeblocks around without being able to concentrate anymore, with the due time being within almost an hour... So you guys are my last resort here. I am supposed to create a few random balls on a canvas, those balls being stored within an ArrayList (I hope an ArrayList is suitable here: the alternative options to choose from were HashSet and HashMap). Now, whatever I do, I get the differently colored balls at the top of my canvas, but they just get stuck there and refuse to move at all. Apart from that I now get a ConcurrentModificationException, when running the code: java.util.ConcurrentModificationException at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372) at java.util.AbstractList$Itr.next(AbstractList.java:343) at BallDemo.bounce(BallDemo.java:109) Reading up on that exception, I found out that one can make sure ArrayList is accessed in a threadsafe manner by somehow synchronizing access. But since I have remember fellow students doing without synchronizing, my guess is, that it would actually be the wrong path to go. Maybe you guys could help me get this to work, I at least need those stupid balls to move ;-) /** * Simulate random bouncing balls */ public void bounce(int count) { int ground = 400; // position of the ground line System.out.println(count); myCanvas.setVisible(true); // draw the ground myCanvas.drawLine(50, ground, 550, ground); // Create an ArrayList of type BouncingBalls ArrayList<BouncingBall>balls = new ArrayList<BouncingBall>(); for (int i = 0; i < count; i++){ Random numGen = new Random(); // Creating a random color. Color col = new Color(numGen.nextInt(256), numGen.nextInt(256), numGen.nextInt(256)); // creating a random x-coordinate for the balls int ballXpos = numGen.nextInt(550); BouncingBall bBall = new BouncingBall(ballXpos, 80, 20, col, ground, myCanvas); // adding balls to the ArrayList balls.add(bBall); bBall.draw(); boolean finished = false; } for (BouncingBall bBall : balls){ bBall.move(); } } This would be the original unmodified method we got from our teacher, which only creates two balls: /** * Simulate two bouncing balls */ public void bounce() { int ground = 400; // position of the ground line myCanvas.setVisible(true); myCanvas.drawLine(50, ground, 550, ground); // draw the ground // crate and show the balls BouncingBall ball = new BouncingBall(50, 50, 16, Color.blue, ground, myCanvas); ball.draw(); BouncingBall ball2 = new BouncingBall(70, 80, 20, Color.red, ground, myCanvas); ball2.draw(); // make them bounce boolean finished = false; while(!finished) { myCanvas.wait(50); // small delay ball.move(); ball2.move(); // stop once ball has travelled a certain distance on x axis if(ball.getXPosition() >= 550 && ball2.getXPosition() >= 550) { finished = true; } } ball.erase(); ball2.erase(); } }

    Read the article

  • Python GUI Scraper hanging issues.

    - by bball
    I wrote a scraper using python a while back, and it worked fine in the command line. I have made a GUI for the application now, but I am having trouble with one issue. When I attempt to update text inside the gui (e.g. 'fetching URL 12/50'), I am unable seeing as the function within the scraper is grabbing 100+ links. Also when going from one scraping function, to a function that should update the gui, to another function, the gui update function seems to be skipped over while the next scrape function is run. An example would be: scrapeLinksA() #takes 20 seconds updateInfo("LinksA done") scrapeLinksB() #takes another 20 seconds in the above example, updateInfo is never executed, unless I end the program with a KeyboardInterrupt. I'm thinking my solution is threading, but I'm not sure. What can I do to fix this? I am using: PyQt4 urllib2 BeautifulSoup

    Read the article

  • Visual Studio Generating Code in Release mode

    - by bball
    I am using Visual Studio to compile some C++ Code. When I compile my program in Debug mode it works perfectly, but when I try compiling it in Release mode, VS halts when Generating Code (ie: took 20 mins and still didn't finish). After I forced VS to stop the build process, the executable generated was huge 2MB while it should be about 304KB. Please can you help figure this out. How should I setup the configuration parameters for Release mode to work? Thanks,

    Read the article

1