Daily Archives

Articles indexed Sunday March 21 2010

Page 11/85 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Clever way of building a tag cloud? - Python

    - by RadiantHex
    Hi folks, I've built a content aggregator and would like to add a tag cloud representing the current trends. Unfortunately this is quite complex, as I have to look for keywords that represent the context of each article. For example words such as I, was, the, amazing, nice have no relation to context. Help would be much appreciated! :)

    Read the article

  • A strong case for WF

    - by Pita.O
    Hi guys, I have struggled for so long to find a compelling use case for workflow (ie: WF) as against regular imperative programming. Each time I fall back to the conclusion that I should just leave WF out or defer getting into it until later. But I keep having this nagging feeling that there's something am missing. Does anyone know any book that truly makes a strong case for the Workflow way? The book has to (i) teach WF well, and (ii) show using appropriate use cases that WF made an implementation easy to do than if we just did our regular straight coding. I will appreciate it.

    Read the article

  • Parsing ISO-8859-1 w/ NSXmlParser

    - by Travis
    I am usin the nsxmlparser and am wondering how I can parse ISO-8859-1 correctly into an NSString. Currently, I am getting results w/ Â for two-byte characters. The XML I'm using (not created by me) starts with <?xml version="1.0" encoding="ISO-8859-1"?> Here are the basic calls I'm using (omitted the NSThread calls). NSString *xmlFilePath = [[NSBundle mainBundle] pathForResource:sampleFileName ofType:@"xml"]; NSString *xmlFileContents = [NSString stringWithContentsOfFile:xmlFilePath encoding:NSUTF8StringEncoding error:nil]; NSData *data = [xmlFileContents dataUsingEncoding:NSUTF8StringEncoding]; NSXMLParser *parser = [[NSXMLParser alloc] initWithData:data]; [parser setDelegate:self]; [parser parse];

    Read the article

  • What objects would get defined in a Bridge scoring app (Javascript)

    - by Alex Mcp
    I'm writing a Bridge (card game) scoring application as practice in javascript, and am looking for suggestions on how to set up my objects. I'm pretty new to OO in general, and would love a survey of how and why people would structure a program to do this (the "survey" begets the CW mark. Additionally, I'll happily close this if it's out of range of typical SO discussion). The platform is going to be a web-app for webkit on the iPhone, so local storage is an option. My basic structure is like this: var Team = { player1: , player2: , vulnerable: , //this is a flag for whether or //not you've lost a game yet, affects scoring scoreAboveLine: , scoreBelowLine: gamesWon: }; var Game = { init: ,//function to get old scores and teams from DB currentBid: , score: , //function to accept whether bid was made and apply to Teams{} save: //auto-run that is called after each game to commit to DB }; So basically I'll instantiate two teams, and then run loops of game.currentBid() and game.score. Functionally the scoring is working fine, but I'm wondering if this is how someone else would choose to break down the scoring of Bridge, and if there are any oversights I've made with regards to OO-ness and how I've abstracted the game. Thanks!

    Read the article

  • Jquery getJSON to external PHP page

    - by Pmarcoen
    I've been trying to make an ajax request to an external server. I've learned so far that I need to use getJSON to do this because of security reasons ? Now, I can't seem to make a simple call to an external page. I've tried to simplify it down as much as I can but it's still not working. I have 2 files, test.html & test.php my test.html makes a call like this, to localhost for testing : $.getJSON("http://localhost/OutVoice/services/test.php", function(json){ alert("JSON Data: " + json); }); and I want my test.php to return a simple 'test' : $results = "test"; echo json_encode($results); I'm probably making some incredible rookie mistake but I can't seem to figure it out. Also, if this works, how can I send data to my test.php page, like you would do like test.php?id=15 ? The test.html page is calling the test.php page on localhost, same directory I don't get any errors, just no alert ..

    Read the article

  • How do I usb tether my Cyanogen modded G1's internet connection to my Toshiba Tecra 8000 running Xub

    - by atticus
    I have usb-tethering enabled in my phone. It works fine with Vista. When I plug my phone into my Tecra 8000 laptop running Xubuntu, dmesg shows: "usb 1-1: new full speed USB device using uhci_hcd and address 8". I see that the OS has detected it as a storage device, but I can't get it to function correctly as a network device. /dev/us* shows no usb0, but it does show /dev/usbdev1.1_ep00 /dev/usbdev1.1_ep81 /dev/usbdev1.8_ep00 ... usbdev1.8_ep83. I could just use the wireless tether app for android, but I can't get my Netgear wg511 v2 (made in China) wireless card to work in this laptop either. But that's another post for later.

    Read the article

  • SMS reminder for Windows Mobile?

    - by Sam
    A lot of mobile phones can be setup to emit a reminder beep every few minutes if you have an unread SMS. So when you miss the receive signal of the sms (because you've been in the restroom) you'll hear a gentle beep every few minutes, so you know you received an sms while you've been busy. Is there a way to get this behaviour on windows mobile (6.5)? I found nothing to activate this in the menu, but maybe it's hidden somewhere. Or do I need an extra software (but where could I find this?)? Thanks, Sam

    Read the article

  • Pressure Washer vs Power Washer

    We all know (or at least suspect) that "pressure" and "power" can be used interchangeably with respect to high-pressure cleaning equipment and services, but which one is more commonly used? This knowledge can be relevant to businesses for their online marketing campaigns and to consumers in their search for information.

    Read the article

  • Regular expression for a phone number

    - by Zerobu
    Hello, I would like a regular expression in this format. It Must match one of the following formats: * (###)###-#### * ###-###-#### * ###.###.#### * ########## Strip all whitespace. Make sure it's a valid phone number, then (if necessary) translate it to the first format listed above.

    Read the article

  • Debugging asp.net with firefox and visual studio.net - very slow compared to IE

    - by john
    Debugging asp.net websites/web projects in visual studio.net 2005 with Firefox is loads slower than using IE. I've read something somewhere that there is a way of fixing this but i can't for the life of me find it again. Does anyone know what i'm on about and can point me in the right direction please? Cheers John edit sorry rob i haven't explained myself very well(again). I prefer Firefox for debugging (firebug etc) hitting F5 when debugging with IE the browser launches really quickly and clicking around my web application is almost instant and when a breakpont is hit i get to my code straight away with no delays. hitting F5 when debugging with FireFox the browser launches really slowly (ok i have plugins that slow FF loading) but clicking around my web application is really really slow and when a breakpoint is hit it takes ages to break into code. i swear i've read something somewhere that there is a setting in Firefox (about:config maybe?) that when changed to some magic setting sorts all this out.

    Read the article

  • Connecting repeatable and non-repeatble backgrounds without a seam

    - by Stiggler
    I have a 700x300 background repeating seamlessly inside of the main content-div. Now I'd like to attach a div at the bottom of the content-div, containing a different background image that isn't repeatable, connecting seamlessly with the repeatable background above it. Essentially, the non-repeatable image will look like the end piece of the repeatable image. Due to the nature of the pattern, unless the full 300px height of the background image is visible in the last repeat of the content-div's backround, the background in the div below won't seamlessly connect. Basically, I need the content div's height to be a multiple of 300px under all circumstances. What's a good approach to this sort of problem? I've tried resizing the content-div on loading the page, but this only works as long as the content div doesn't contain any resizing, dynamic content, which is not my case: function adjustContentHeight() { // Setting content div's height to nearest upper multiple of column backgrounds height, // forcing it not to be cut-off when repeated. var contentBgHeight = 300; var contentHeight = $("#content").height(); var adjustedHeight = Math.ceil(contentHeight / contentBgHeight); $("#content").height(adjustedHeight * contentBgHeight); } $(document).ready(adjustContentHeight); What I'm looking for there is a way to respond to a div resizing event, but there doesn't seem to be such a thing. Also, please assume I have no access to the JS controlling the resizing of content in the content-div, though this is potentially a way of solving the problem. Another potential solution I was thinking off was to offset the background image in the bottom div by a certain amount depending on the height of the content-div. Again, the missing piece seems to be the ability to respond to a resize event.

    Read the article

  • disable SSL on MAMP

    - by morktron
    Hi I'm used to editing sites locally on my MAMP to test out changes before going live. In this case though the site has a SSL certificate and wants to use it when I go to admin. So I can't go to admin. The error message says: (Error code: ssl_error_rx_record_too_long) It's a Joomla site I'm trying to log into locally ie: http://localhost:8888/site/administrator/ I've tried https as well, but same thing. Also same thing is Safari. I just need to turn off ssl, it must be a file somewhere in the site I downloaded.

    Read the article

  • Converting JSON into Python dict

    - by GrumpyCanuck
    I've been searching around trying to find an answer to this question, and I can't seem to track it down. Maybe it's too late in the evening to figure the answer out, so I turn to the excellent readers here. I have the following bit of JSON data that I am pulling out of a CouchDB record: "{\"description\":\"fdsafsa\",\"order\":\"1\",\"place\":\"22 Plainsman Rd, Mississauga, ON, Canada\",\"lat\":43.5969175,\"lng\":-79.7248744,\"locationDate\":\"03/24/2010\"},{\"description\":\"sadfdsa\",\"order\":\"2\",\"place\":\"50 Dawnridge Trail, Brampton, ON, Canada\",\"lat\":43.7304774,\"lng\":-79.8055435,\"locationDate\":\"03/26/2010\"}," This data is stored inside a Python dict under the key 'locations' in a dict called 'my_plan'. I want to covert this data from CouchDB into a Python dict so I can do the following in a Django template: {% for location in my_plan.locations %} <tr> <td>{{ location.place }}</td> <td>{{ location.locationDate }}</td> </tr> {% endfor %} I've found lots of info on converting dicts to JSON, but nothing on going back the other way Thanks in advance for the help!

    Read the article

  • How can you save Cocos2D window output as Video?

    - by crunchyt
    I am considering using the excellent looking Cocos2d for a motion graphics project. However, Cocos2d is intended for games, rather than producing an MPEG stream. Is it possible to save the output from a Cocos2d script to a MOV or MPG file? Ideally this needs to be done in a direct manner, not using a screen capture as this would not meet the requirements of the project. Hopefully there are some cocos2d gurus out there :D Thanks!

    Read the article

  • Tricky string transformation (hopefully) in LINQ

    - by Larsenal
    I'm hoping for a concise way to perform the following transformation. I want to transform song lyrics. The input will look something like this: Verse 1 lyrics line 1 Verse 1 lyrics line 2 Verse 1 lyrics line 3 Verse 1 lyrics line 4 Verse 2 lyrics line 1 Verse 2 lyrics line 2 Verse 2 lyrics line 3 Verse 2 lyrics line 4 And I want to transform them so the first line of each verse is grouped together as in: Verse 1 lyrics line 1 Verse 2 lyrics line 1 Verse 1 lyrics line 2 Verse 2 lyrics line 2 Verse 1 lyrics line 3 Verse 2 lyrics line 3 Verse 1 lyrics line 4 Verse 2 lyrics line 4 Lyrics will obviously be unknown, but the blank line marks a division between verses in the input.

    Read the article

  • Determining URLs updated via a series of commit logs

    - by adamrubin
    I'm working on a project where I programmatically need to know when a URL has been changed by a developer, post or during deploy. The obvious answer may be to curl the URL one day, save the output, then curl and in x days then do a diff. That won't work in my case, as I'm only looking for changes the developer mande. If the site is a blog, new comments, user submitted photos, etc would make that curl diff useless. RoR example, using github. Let's assume I have access to the entire repository and all commit logs between iterations. Is there a way I could see that "/views/people/show.html.erb" was commited, then backtrack from there (maybe by inspecting routes.rb), to come up with the URL I can then hit via a browser?

    Read the article

  • FlexNativeMenu Problem in Air Application

    - by glatour
    I am trying to add a flexnativemenu to my air application and I have some problems... When I set it in the windowApplication, I get null errors in child controls so I tried to set this.menu = myMainMenu (which is my flexnativemenu) in the creation complete event but the menu doesn't show up... I tried to show an alert message before setting the menu and the menu appeared in the application. Is there a method I can call to force the application to "redraw" itself in the creationComplete event??? Thanks!

    Read the article

  • C++ How do I properly use getline for ifstream members.

    - by John
    Ok so I have a problem with getline. I have a file that contains a couple strings. I created it by myself and I have each string on a seperate line. Ex. textfile.txt Line 1 Line 2 Line 3 Line 4 //Little snip of code ifstream inFile("textfile.txt"); getline(inFile, string1); When I debug the program and ask it to print out string1 it shows that "Line 1\r" is saved into string1. I understand that it's from me actually hitting enter when I created the file. This problem causes my program to have a segmentation fault. I know my code works because if I use ofstream to write the file first and then i read it in, it works. So for my quesiton, is their anyway to use the getline function without it picking up the escape sequence \r? If i am not clear just let me know.

    Read the article

  • Unable to uninstall SQL Server express

    - by Joel Martinez
    When I try, I receive the following error message: A computer restart is required. You must restart this computer before installing SQL Server. Of course, I have restarted the computer :-) I'm not really sure how to proceed. The version that sql server reports when I query it is: SQL Server 10.0.1600.22 - RTM (Express Edition with Advanced ) Solved: As it turns out, I had to end up uninstalling logitech's quick cam pro software. Although the fix below did not directly resolve it, the value of that registry key led me to discovering the solution by querying for it online :-) thanks!!!

    Read the article

  • WinForm partial classes

    - by nivlam
    I have a WinForm project that contains a form called MainUI. You can see that the automatically generated partial class shows up as a node under MainUI.cs. Is there a way to "move" my self created partial class MainUI.Other.cs under MainUI.cs so that it'll show as another node?

    Read the article

  • jQuery Validation, multiple form ids for same function

    - by George
    Hi have two forms with the exact same validation rules, but different ids that I'd like to combine into just one function. How can I do that? var validator = $("#ValidateForm1").validate({ errorPlacement: function(error, element) { if ( element.is(":radio") ) error.appendTo( element.parent().next().next() ); else if ( element.is(":checkbox") ) error.appendTo ( element.next() ); else error.appendTo( element.parent().next() ); } }); var validator = $("#validateForm2").validate({ errorPlacement: function(error, element) { if ( element.is(":radio") ) error.appendTo( element.parent().next().next() ); else if ( element.is(":checkbox") ) error.appendTo ( element.next() ); else error.appendTo( element.parent().next() ); } });

    Read the article

  • speed up the speed of a sql query to mysql?

    - by fayer
    in my mysql database i've got the geonames database, containing all countries, states and cities. i am using this to create a cascading menu so the user could select where he is from: country - state - county - city. but the main problem is that the query will search through all the 7 millions rows in that table each time i want to get the list of children rows, and that is taking a while 10-15 seconds. i wonder how i could speed this up: caching? table views? reorganizing table structure somehow? and most important, how do i do these things? are there good tutorials you could link to me? i appreciate all help and feedback discussing smart ways of handling this issue!

    Read the article

  • What to put as the Provider for a mocked IQueryable

    - by Vaccano
    I am working with Moles and mocking a System.Data.Linq.Table. I got it constructing fine, but when I use it, it wants IQueryable.Provider to be mocked (moled) as well. I just want it to use normal Linq To Objects. Any idea what that would be? Here is the syntax I can use: MTable<User> userTable = new System.Data.Linq.Moles.MTable<User>(); userTable.Bind(new List<User> { UserObjectHelper.TestUser() }); // this is the line that needs help MolesDelegates.Func<IQueryProvider> provider = //Insert provider here! ^ userTable.ProviderSystemLinqIQueryableget = provider | | | what can I put here? ----------------------------------------+

    Read the article

  • AudioFileWriteBytes fails with error code -40

    - by alexbw
    I'm trying to write raw audio bytes to a file using AudioFileWriteBytes(). Here's what I'm doing: void writeSingleChannelRingBufferDataToFileAsSInt16(AudioFileID audioFileID, AudioConverterRef audioConverter, ringBuffer *rb, SInt16 *holdingBuffer) { // First, figure out which bits of audio we'll be // writing to file from the ring buffer UInt32 lastFreshSample = rb->lastWrittenIndex; OSStatus status; int numSamplesToWrite; UInt32 numBytesToWrite; if (lastFreshSample < rb->lastReadIndex) { numSamplesToWrite = kNumPointsInWave + lastFreshSample - rb->lastReadIndex - 1; } else { numSamplesToWrite = lastFreshSample - rb->lastReadIndex; } numBytesToWrite = numSamplesToWrite*sizeof(SInt16); Then we copy the audio data (stored as floats) to a holding buffer (SInt16) that will be written directly to the file. The copying looks funky because it's from a ring buffer. UInt32 buffLen = rb->sizeOfBuffer - 1; for (int i=0; i < numSamplesToWrite; ++i) { holdingBuffer[i] = rb->data[(i + rb->lastReadIndex) & buffLen]; } Okay, now we actually try to write the audio from the SInt16 buffer "holdingBuffer" to the audio file. The NSLog will spit out an error -40, but also claims that it's writing bytes. No data is written to file. status = AudioFileWriteBytes(audioFileID, NO, 0, &numBytesToWrite, &holdingBuffer); rb->lastReadIndex = lastFreshSample; NSLog(@"Error = %d, wrote %d bytes", status, numBytesToWrite); return;

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >