Daily Archives

Articles indexed Friday May 28 2010

Page 2/107 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Algorithm for sentence analysis and tokenization

    - by Andrea Nagar
    I need to analyze a document and compile statistics as to how many times each a sequence of words is used (so the analysis is not on single words but of batch of recurring words). I read that compression algorithms do something similar to what I want - creating dictionaries of blocks of text with a piece of information reporting its frequency. It should be something similar to http://www.codeproject.com/KB/recipes/Patterns.aspx Do you have anything written in C#?

    Read the article

  • Page navigation in silverlight 4 using MVVM pattern

    - by Archie
    Hello, I have a a navigation application developed in Silverlight 4. It has a main page which contains a frame. I load a particualr view in that frame and I know that I can use NavigationService to navigate to other page which would be loaded in the same frame. But my question is how it can be done using MVVM? To get the frame do I need to pass the reference of the page? Also, as per my knowledge one view is not aware of any other views. So what is the best way to make them aware of each other? I have heard of Controller and Mediator but how shall I implement them so as to get the Frame of the mainpage? It would be very helpful if anyone can give me the example or probably sample code for this. Thanks in advance.

    Read the article

  • Can this be done with single SQL query

    - by Ghostrider
    I'm using MySQL. I have a table Type SubType 1 1 1 5 1 6 1 8 2 2 2 3 3 1 3 2 3 3 For each type there is some number of subtypes. For every subtype in a type there is a corresponding subtype in the next type: (1,1) => (2,2) (1,5) => (2,3) (1,6) => (2,2) (1,8) => (2,3) (2,2) => (3,1) (2,3) => (3,2) In case you haven't seen the pattern, here it is: you sort both current and next types by subtype, then in the next type you get subtype in the same position as your current subtype in current type is. If there are more subtypes in the current type that in the next one, you warp around and start from the first subtype in the next type. Is it possible to construct a query that takes current type and subtype and returns corresponding subtype in the next type?

    Read the article

  • Unit Tests in Visual Studio 2010

    - by Ben
    Hi, i am trying to create a Unit test for a WinForm in a Visual Studio 2010 project. I add a new "Coded UI Test" to my project, open up the code file, then right click and select "Generate Code for Coded UI Test" - "Use Coded UI Test builder". I then start my application up, select "Record" on the UI Map control. I run my tests (in this case simply select a textbox, type in a random value, them click a button). I then select "Generate Code" from the UI Map control which generates the code which the test will use. When running this test, i get the error: Test method HelloWorldTest.CodedUITest1.CodedUITestMethod1 threw exception: Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties. Additional Details: TechnologyName: 'MSAA' ControlType: 'Window' Name: 'Form1' ClassName: 'WindowsForms10.Window' --- System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component. Does anyone know where i am going wrong? Thanks

    Read the article

  • jquery hover menu question

    - by vondip
    Hi all, I am developing a small web app that uses jquery quite a lot. In my app a user can hover an image, which becomes bigger after a few seconds, giving him more details. The problem is that when the image enlarges the image, it takes over the area of the nearby images as well. Now, if the user goes over the second red square (numbered as 2) I would like the currently enlarged image to disappear and instead enlarge the image pictured below as square two. I am not much of a painter, but I have attached a small image to help illustrate the problem. In short, How can I tell jquery to detect when the mouse is over red square number two, yet not raising the event if the mouse is over green square. [in my demo picture, hovering on point]

    Read the article

  • How can I decrease the time spent reformatting / restoring user's workstations?

    - by CT
    I just working for a medium sized company (approx. 150 users). When user's workstations need to be reformatted for any variety of reasons, we reformat, reinstall windows from an oem disk, install drivers, install shop desired software, and restore user's documents from latest backup. While the process isn't very difficult it is very time consuming. What are some options simplify / speed up this process? Mostly a complete Windows shop with most servers running Win2k3 Enterprise and workstations running a variety of XP, Vista, and 7. Workstations are purchased through a variety of OEMs mostly Dell.

    Read the article

  • Oracle Database 11g Helps Control Exponential Data Growth

    - by [email protected]
    The 2010 ESG annual customer survey is now available. As part of it, ESG interviewed 300 customers about their IT priorities and, unsurprisingly, "Manage Data Growth" is top of the list. Perhaps less self-evident is the proposed solution to target this prime concern: "Often overlooked because it is a database platform, Oracle Database 11g offers additional capabilities such as automatic storage management (ASM), advanced data compression, and data protection that make managing data growth much easier for organizations of any size." The paper goes on to discuss these capabilities and highlights their potential benefits. Oracle Database 11g Helps Control Exponential Database Growth - a worthwhile read for anyone having to deal with rapidly increasing amounts of data. Download your free copy here.

    Read the article

  • Elegant Disjunctive Normal Form in Django

    - by Mike
    Let's say I've defined this model: class Identifier(models.Model): user = models.ForeignKey(User) key = models.CharField(max_length=64) value = models.CharField(max_length=255) Each user will have multiple identifiers, each with a key and a value. I am 100% sure I want to keep the design like this, there are external reasons why I'm doing it that I won't go through here, so I'm not interested in changing this. I'd like to develop a function of this sort: def get_users_by_identifiers(**kwargs): # something goes here return users The function will return all users that have one of the key=value pairs specified in **kwargs. Here's an example usage: get_users_by_identifiers(a=1, b=2) This should return all users for whom a=1 or b=2. I've noticed that the way I've set this up, this amounts to a disjunctive normal form...the SQL query would be something like: SELECT DISTINCT(user_id) FROM app_identifier WHERE (key = "a" AND value = "1") OR (key = "b" AND value = "2") ... I feel like there's got to be some elegant way to take the **kwargs input and do a Django filter on it, in just 1-2 lines, to produce this result. I'm new to Django though, so I'm just not sure how to do it. Here's my function now, and I'm completely sure it's not the best way to do it :) def get_users_by_identifiers(**identifiers): users = [] for key, value in identifiers.items(): for identifier in Identifier.objects.filter(key=key, value=value): if not identifier.user in users: users.append(identifier.user) return users Any ideas? :) Thanks!

    Read the article

  • jquery code not working in chrome

    - by Paul
    This code works is FF and IE but not in Chrome. Any help would be greatly appreciated. Thank You! here is the html Item One Item Two Item Three Item Four Item Five Item Six Item Seven Item Eight Item Nine Item ten here is the css popularsearches { border-bottom: 1px solid #D4D4D4; border-left: 1px solid #D4D4D4; border-right: 1px solid #D4D4D4; overflow:hidden; height: 130px; width:248px; margin-bottom:20px; } popularsearches ul { padding:0 5px 0 0; margin:0; } popularsearches ul li { list-style-type:none; list-style-position:inside; border-bottom: solid 1px #D4D4D4; font-size:14px; padding:3px 0 3px 0; margin:0 0 0 10px; text-align:left; } popularsearches ul li a { text-decoration:none; } popularsearches ul li a:hover, a:link, a:visited { text-decoration:none; } popularsearches-inside { width: 500px; } popularsearches-left { float:left; width:250px; height:100px; } popularsearches-right { float:left; width:250px; height:100px; } here is the jQuery var closeinterval = 0; function scrollContent() { //Toggle left between 250 and 0 var top = jQuery("#popularsearches").scrollLeft() == 0 ? 250 : 0; jQuery("#popularsearches").animate({ scrollLeft: top }, "slow"); } // Call scrollContent function every 6 secs closeinterval = setInterval("scrollContent()", 6000); jQuery(document).ready(function() { jQuery("#popular-button-left").bind("click", function() { if (closeinterval) { window.clearInterval(closeinterval); closeinterval = null; } jQuery("#popularsearches").animate({ scrollLeft: 0 }, 1000); }); jQuery("#popular-button-right").bind("click", function() { if (closeinterval) { window.clearInterval(closeinterval) closeinterval = null; } jQuery("#popularsearches").animate({ scrollLeft: 250 }, 1000); }); });

    Read the article

  • Weird behavior of std::vector

    - by Nima
    I have a class like this: class OBJ{...}; class A { public: vector<OBJ> v; A(int SZ){v.clear(); v.reserve(SZ);} }; A *a = new A(123); OBJ something; a->v.push_back(something); This is a simplified version of my code. The problem is in debug mode it works perfect. But in release mode it crashes at "push_back" line. (with all optimization flags OFF) I debugged it in release mode and the problem is in the constructor of A. the size of the vector is something really big with dummy values and when I clear it, it doesn't change... Do you know why? Thanks,

    Read the article

  • How does one advance in programming?

    - by Joe Barr
    I really have the felling as if I'm stuck in my own craft. I've been developing and learning for a while now and keep having the feeling that I should advance more, or even be more knowledgeable. I've started projects I didn't finish because I thought I lacked the knowledge and the skill to make that feature work just right, or to make that code magically appear on my screen. I've read books I didn't finish, thinking I wasn't advanced enough for the subjects they covered. I've been around long enough to know that everything comes with experience, hard work and dedication. Having said this, I just want to be able to work without getting stuck on a particular problem that involves my cluelessness of a language or a tool feature. My question to you would be, how does one advance in programming? What are the secrets (if any) to advance to the point of fluency in a particular language or a task. Thank you!

    Read the article

  • algorithm to make easy my job

    - by gcc
    Iwill tell part of study material task but, dont afraid, I dont want write all of them , I will ask just specific question.okey; User will give me a function with three unknown. example: sin(a+b)+ln(5)*(log(ab)-32/sqrt(abc)) another example for function atan(23/a)-exp(a,b)*(123+asin(ac)) and there are some another input with funtion but in all input a,b and c, are doesnot determined, Anyway,I wont tell the other part,I just asking how I should take the fuction such that I can do my job with easy?

    Read the article

  • jQuery: How to fire event when all asynchronous calls return?

    - by Jeremy
    I have a jQuery application that loads data from five asynchronous server calls. I do not want to display any data until all five calls return. (I plan on displaying a Loading message until that happens.) How can I detect when all five calls have returned? I considered having each callback method increment a variable (using jQuery's data() method, perhaps) and then waiting for the value to become 5. (I am not sure yet how I would listen for that event.) I do not think this is a very good solution, however. What would happen if two calls return at the same time? Is there a better way to do this?

    Read the article

  • SyntaxError using gdata-python-client to access Google Book Search Data API

    - by isbadawi
    >>> import gdata.books.service >>> service = gdata.books.service.BookService() >>> results = service.search_by_keyword(isbn='0434003484') Traceback (most recent call last): File "<pyshell#4>", line 1, in <module> results = service.search_by_keyword(isbn='0434003484') ... snip ... File "C:\Python26\lib\site-packages\atom\__init__.py", line 127, in CreateClassFromXMLString tree = ElementTree.fromstring(xml_string) File "<string>", line 85, in XML SyntaxError: syntax error: line 1, column 0 This is a minimal example -- in particular, the book service unit tests included in the package also fail with the exact same error. I've looked at the wiki and open issue tickets on Google Code to no avail (and this seems to me more apt to be a silly error on my end rather than a problem with the library). I'm not sure how to interpret the error message. If it matters, I'm using python 2.6.5.

    Read the article

  • javascript setTimeout function out of scope.

    - by Keyo
    I am trying to call showUpload(); from within two setTimeouts. Neither works. It seems to be out of scope and I'm not sure why. I tried this.showUpload() which didn't work either. $(document).ready(function(){ var progress_key = $('#progress_key').val(); // this sets up the progress bar $('#uploadform').submit(function() { setTimeout("showUpload()",1500); $("#progressbar").progressbar({ value:0}).fadeIn(); }); // uses ajax to poll the uploadprogress.php page with the id // deserializes the json string, and computes the percentage (integer) // update the jQuery progress bar // sets a timer for the next poll in 750ms function showUpload() { $.get("/myid/videos/uploadprogress/" + progress_key, function(data) { if (!data) return; var response; eval ("response = " + data); if (!response) return; var percentage = Math.floor(100 * parseInt(response['bytes_uploaded']) / parseInt(response['bytes_total'])); $("#progressbar").progressbar({ value:percentage}) }); setTimeout("showUpload()", 750); } }); Thank you for your time.

    Read the article

  • Android Template Application?

    - by stormin986
    I have built an application that I want to use as the foundation for a few other variants. The variants will come from assets / resource files and a unique AndroidManifest.xml. However, I want to be able to leave all the application code alone (modifying the package of all my classes, etc). I'm having a hard time figuring out how to do so. My first thought was to simply have my main application in its own package, and then specify the specific application package in the manifest. However, this gives me issues with the generated R.java class, since it is generated to be in the main application's package. Anyone have any thoughts on how to accomplish this? To have a code baseline, and the application variants happen in resources/assets and the manifest?

    Read the article

  • Object Oriented Programming in AS3

    - by Jordan
    I'm building a game in as3 that has balls moving and bouncing off the walls. When the user clicks an explosion appears and any ball that hits that explosion explodes too. Any ball that then hits that explosion explodes and so on. My question is what would be the best class structure for the balls. I have a level system to control levels and such and I've already come up with working ways to code the balls. Here's what I've done. My first attempt was to create a class for Movement, Bounce, Explosion and finally Orb. These all extended each other in the order I just named them. I got it working but having Bounce extend Movement and Explosion extend Bounce, it just doesn't seem very object oriented because what if I wanted to add a box class that didn't move, but did explode? I would need a separate class for that explosion. My second attempt was to create Movement, Bounce and Explosion without extending anything. Instead I passed in a reference to the Orb class to each. Then the class stores that reference and does what it needs to do based on events that are dispatched by the Orb such as update, which was broadcast from Orb every enter frame. This would drive the movement and bounce and also the explosion when the time came. This attempt worked as well but it just doesn't seem right. I've also thought about using Interfaces but because they are more of an outline for classes, I feel like code reuse goes out the window as each class would need its own code for a specific task even if that task is exactly the same. I feel as if I'm searching for some form of multiple inheritance for classes that as3 does not support. Can someone explain to me a better way of doing what I'm attempting to do? Am I being to "Object Oriented" by having classed for Movement, Bounce, Explosion and Orb? Are Interfaces the way to go? Any feedback is appreciated!

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >