Daily Archives

Articles indexed Friday April 2 2010

Page 20/105 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • How to determine the (natural) language of a document?

    - by Robert Petermeier
    I have a set of documents in two languages: English and German. There is no usable meta information about these documents, a program can look at the content only. Based on that, the program has to decide which of the two languages the document is written in. Is there any "standard" algorithm for this problem that can be implemented in a few hours' time? Or alternatively, a free .NET library or toolkit that can do this? I know about LingPipe, but it is Java Not free for "semi-commercial" usage This problem seems to be surprisingly hard. I checked out the Google AJAX Language API (which I found by searching this site first), but it was ridiculously bad. For six web pages in German to which I pointed it only one guess was correct. The other guesses were Swedish, English, Danish and French... A simple approach I came up with is to use a list of stop words. My app already uses such a list for German documents in order to analyze them with Lucene.Net. If my app scans the documents for occurrences of stop words from either language the one with more occurrences would win. A very naive approach, to be sure, but it might be good enough. Unfortunately I don't have the time to become an expert at natural-language processing, although it is an intriguing topic.

    Read the article

  • MacOSX + Eclipse: Rename variable function not working

    - by MIsha
    Good day. I have Eclipse PHP Galileo for Mac OSX, 32bit Cocoa version. The problem is the rename function doesn't work properly. While editing PHP file I choose Refactor-Rename menu or a rename hotkey and Eclipse doesn't offer me to rename a variable, instead a rename file dialog appears. Tried to configure hotkeys but no luck. If you do know the solution – please tell. Thank you.

    Read the article

  • Get aspect ratio of a monitor

    - by Alexander Stalt
    I want to get aspect ratio of a monitor as two digits : width and height. For example 4 and 3, 5 and 4, 16 and 9. I wrote some code for that task. Maybe it is any easier way to do that ? For example, some library function =\ /// <summary> /// Aspect ratio. /// </summary> public struct AspectRatio { int _height; /// <summary> /// Height. /// </summary> public int Height { get { return _height; } } int _width; /// <summary> /// Width. /// </summary> public int Width { get { return _width; } } /// <summary> /// Ctor. /// </summary> /// <param name="height">Height of aspect ratio.</param> /// <param name="width">Width of aspect ratio.</param> public AspectRatio(int height, int width) { _height = height; _width = width; } } public sealed class Aux { /// <summary> /// Get aspect ratio. /// </summary> /// <returns>Aspect ratio.</returns> public static AspectRatio GetAspectRatio() { int deskHeight = Screen.PrimaryScreen.Bounds.Height; int deskWidth = Screen.PrimaryScreen.Bounds.Width; int gcd = GCD(deskWidth, deskHeight); return new AspectRatio(deskHeight / gcd, deskWidth / gcd); } /// <summary> /// Greatest Common Denominator (GCD). Euclidean algorithm. /// </summary> /// <param name="a">Width.</param> /// <param name="b">Height.</param> /// <returns>GCD.</returns> static int GCD(int a, int b) { return b == 0 ? a : GCD(b, a % b); } }

    Read the article

  • how can I easily upload outlook contacts into my web application?

    - by Angela
    Hi, I am trying to find a way for our users to very easily upload their outlook contacts into our web application (mysql database). I'm not sure where to begin. I've seen various tools which are pretty complex. I am open to existing third-party solutions, but my hope is that there is something which is very simple to use or build. Thanks. PS: Ideally, it would not involve using visual basic.

    Read the article

  • How to put foreign key constraints on a computed fields in sql server?

    - by Asaf R
    Table A has a computed field called Computed1. It's persisted and not null. Also, it always computes to an expression which is char(50). It's also unique and has a unique key constraint on it. Table B has a field RefersToComputed1, which should refer to a valid Computed1 value. Trying to create a foreign key constraint on B's RefersToComputed1 that references A' Computed1 leads to the following error: Error SQL01268: .Net SqlClient Data Provider: Msg 1753, Level 16, State 0, Line 1 Column 'B.RefersToComputed1' is not the same length or scale as referencing column 'A.Computed1' in foreign key 'FK_B_A'. Columns participating in a foreign key relationship must be defined with the same length and scale. Q: Why is this error created? Are there special measures needed for foreign keys for computed columns, and if so what are they? Summary: The specific problem rises from computed, char based, fields being varchar. Hence, Computed1 is varchar(50) and not char(50). It's best to have a cast surrounding a computed field's expression to force it to a specific type. Credit goes to Cade Roux for this tip.

    Read the article

  • .NET: Best way to execute a lambda on UI thread after a delay?

    - by Scott Bussinger
    I had a situation come up that required running a lambda expression on the UI thread after a delay. I thought of several ways to do this and finally settled on this approach Task.Factory.StartNew(() => Thread.Sleep(1000)) .ContinueWith((t) => textBlock.Text="Done",TaskScheduler.FromCurrentSynchronizationContext()); But I'm wondering if there's an easier way that I missed. Any suggestions for a shorter, simpler or easier technique? Assume .NET 4 is available.

    Read the article

  • How to call a method in init method ?

    - by srikanth rongali
    My program looks like this: -(id)init { if ( (self = [super init]) ) { //TargetWithActions *targetActions= [[TargetWithActions alloc] init]; [self countDownSpeed123]; } return self; } -(void)countDownSpeed123 { countDownSpeed = 5.0f; } @end warning: 'TargetWithActions' may not respond to '-countDownSpeed123' I am getting the warning in this way. Where I am wrong in my program. Please explain ? Thank You.

    Read the article

  • how to make a website look professional in google search results

    - by altvali
    Hi all! There are a lot of websites that look professional in Google results. Try searching for 'stackoverflow' and you'll see at the top a result with a title, a description and a table of 8 links to stackoverflow categories. That's what i'm interested in producing for future websites. So what must be done? Does it depend on the number of visitors? how long does it take until the results start looking like that?

    Read the article

  • How do I start a second console application in Visual Studio when one is already running

    - by Kettenbach
    Hi All, I am working through some examples in a WCF book. There is a Host project and Client project within a single solution. Both are console applications. The Host is the startup app, but the Client app doesn't seem to open the Console like the book says. Book says while the Host is running, run the Client. The Run button is disabled tho as it is already running. The book example definitely has them in the same solution and a single instance of Visual Studio. Anyways, what am I missing here? I have done this with two instances of VS, but I truly have never does this in a single instance. Any help is always appreciated. Cheers, ~ck in San Diego

    Read the article

  • How do I develop browser plugins with cross-platform and cross-browser compatibility in mind?

    - by Schnapple
    My company currently has a product which relies on a custom, in-house ActiveX control. The technology it employs (TWAIN) is itself cross-platform by design, but our solution is obviously limited to Internet Explorer on Windows. Long term we would like to become cross-browser and cross-platform (i.e., support other browsers on Windows, support the Macintosh or Linux). Obviously if we wanted to support Firefox on Windows I would need to write a plugin for it. But if we wanted to support the Macintosh, how do I attack that? Is it possible to compile a version of the Firefox plugin that runs on the Mac? Would I be remiss to not also support Safari on the Mac? Are there any plugins which are cross-browser on a platform? (i.e., can any browsers run plugins for other browsers) Since TWAIN is so low-level to the operating system, I do not think Java would be a solution in any capacity, but I could be wrong. What do people generally do when they want to support multiple platforms with a process that will need to be cross-platform and cross-browser compatible?

    Read the article

  • What is the life cycle of the XNA GraphicsDevice on the Xbox 360?

    - by David Brown
    I'm working on an XNA project that doesn't use the built-in Game class, mostly for learning purposes (so I can mess with different game loop types, etc). It's only designed for the Xbox 360, because the hardware is consistent and I don't have to worry about compatibility among different PC hardware configurations. So far, it's working well and I can clear the screen to a color, but I'd like to make sure I handle the GraphicsDevice correctly before moving on. What exactly is the life cycle for the GraphicsDevice on the Xbox 360? Is it ever lost or reset automatically? I know that on Windows, it's lost when the window loses focus, but the Xbox obviously doesn't manage focus. It appears to even keep the graphics device when the Guide pops up, which is the closest thing I can find to "losing focus" on the Xbox. I'd like to think it's simply a matter of "fire and forget," which would make a lot of other things much easier (only needing to load content once, for instance). But I want to make sure.

    Read the article

  • FlashRadioButon

    - by ganesh
    var opt1_MC = ansr.createClassObject(mx.controls.RadioButton, "choice_Mc", ansr.getNextHighestDepth(), {label"test",data:"test",groupName:"questionChoiceGroup"}); opt1_MC.setStyle("fontWeight", "bold"); here font weight i had changed as italic , but it not set .. flash cs2 --? why.. any one can help me ?.thanks

    Read the article

  • Get HTTP header fields only on iPhone

    - by amit
    I want to get only the headers of an URL request. I have been using stringWithContentsOfURL() for all downloading so far, but now I am only interested in the headers and downloading the entire file is not feasible as it is too large. I have found solutions which show how to read the headers after the response has been receieved, but how do I specify in the request that I only wish to download headers. Skip the body! Thanks.

    Read the article

  • Use an environment variable in a launchd script

    - by sirlancelot
    I'm curious if it's possible to specify an envrionment variable in the ProgramArguments portion of a luanchd script on Mac OS X Leopard. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>me.mpietz.MountDevRoot</string> <key>ProgramArguments</key> <array> <string>/bin/sh</string> <string>$HOME/bin/attach-devroot.sh</string> <!-- Instead of using... <string>/Users/mpietz/bin/attach-devroot.sh</string --> </array> <key>RunAtLoad</key> <true/> </dict> </plist>

    Read the article

  • Adjust OSX System Audio Volume in Python

    - by Benson
    I would like to adjust the system audio volume in OSX from a python script. This question about implementing keyboard shortcuts tells me how to do it in applescript, but I'd really like to do it from my python script without using os.system, popen, etc. Ideally I'd like to ramp up the volume slowly with some python code like this: set_volume(0) for i in range(50): set_volume(i*2) time.sleep(1)

    Read the article

  • Convert.ToSingle() for float dat Type

    - by Asim Sajjad
    I have used many of the Convert.To..... functions for conversion , but I didn't understand one thing that for every datatype they have provide a Convert.To function but not for float datatype, in order to convert to float you need to use Convert.ToSingle() , why is this so ?

    Read the article

  • MS AJAX Library 4.0 Sys.create.dataView

    - by azamsharp
    One again Microsoft poor documentation has left me confused. I am trying to use the new features of the .NET 4.0 framework. I am using the following code to populate the Title and Director but it keeps getting blank. <script language="javascript" type="text/javascript"> Sys.require([Sys.components.dataView, Sys.components.dataContext,Sys.scripts.WebServices], function () { Sys.create.dataView("#moviesView", { dataProvider: "MovieService.svc", fetchOperation: "GetMovies", autoFetch: true }); }); </script> And here it the HTML code: <ul id="moviesView"> <li> {{Title}} - {{Director}} </li> </ul> IS THIS THE LATEST URL TO Start.js file. Here is the Ajax-Enabled WCF Service: [ServiceContract(Namespace = "")] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class MovieService { [OperationContract] public Movie GetMovies() { return new Movie() { Title = "SS", Director = "SSSSS" }; } } [DataContract] public class Movie { [DataMember] public string Title { get; set; } [DataMember] public string Director { get; set; } }

    Read the article

  • WxPython Incompatible With Snow Leopard?

    - by Alex
    Hello all, Recently I upgraded to Snow Leopard, and now I can't run programs built with wxPython. The errors I get are (from Eclipse + PyDev): import wx File "/var/tmp/wxWidgets/wxWidgets-13~231/2.6/DSTROOT/System/Library/Frameworks /Python.framework/Versions/2.6/Extras/lib/ python/wx-2.8-mac-unicode/wx/__init__.py", line 45, in <module> File "/var/tmp/wxWidgets/wxWidgets-13~231/2.6/DSTROOT /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib /python/wx-2.8-mac-unicode/wx/_core.py", line 4, in <module> ImportError:/System/Library/Frameworks /Python.framework/Versions/2.6/Extras/lib/python /wx-2.8-mac-unicode/wx/_core_.so: no appropriate 64-bit architecture (see "man python" for running in 32-bit mode) I don't really understand them and would appreciate if you could help me to do so, also, if you do know what's going on, how can I go about fixing them? Maybe this has something to do with the fact that Snow Leopard is 64-bit? Thanks!!

    Read the article

  • copy the item with the metadata that user just added to a folder called "NativeFiles". this folder i

    - by James
    I need to copy the item that user just added (for example. myresume.doc or financial.xls) with the metadata (doc lib obtains the columns from content type, ct obtains the columns from site colum) and copy the item with metadata in a folder called "NativeFile". Every doc library has this folder. I know itemadded can be used but then I heard itemadded fires before user have a chance to complete the metadata for the item they just added. What are my options? (new to sp, so some sample code would greatly help. or some good link similar to this issue) Sharepoint 2007, itemadded or itemadding or itemupdating or itemupdated....

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >