Daily Archives

Articles indexed Tuesday March 23 2010

Page 31/130 | < Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >

  • free geolocation geoip, are they viable?

    - by brett
    I'm trying to get a visitor's location based on their IP, pretty common stuff. My research so far shows that there's a database from MaxMind that costs $370 + $90/month... not the type of cost I can afford. Then there's a free version called GeoLite City. Anyone used these before? Drop a quick line here please. Why is one free and the answer so expensive. Is the free one usable, is it not as accurate, what's the catch? P.S. Any other suggestions are welcome.

    Read the article

  • crossword algorithm....

    - by teddy
    I'm making algorithm like crossword, but i dont know how to design d algorith. for example, there are words like 'car', 'apple' in the dictionary. and the 'app' words is given on the board. and there are letters like 'l' 'e' 'c' 'r'....for making words. so the algorithm work is making correct words which are stored in dictionary. app - lapp- leapp- lecapp- .... - lappe - eappc - ... - appl - apple(correct answer) what is the best solution for this algorithm?

    Read the article

  • Editing a row in a gridview

    - by chaitanya
    I have a two text boxes named region id and region name..and a button control I enter some values into those text boxes and click the button to insert those values into the "gridview"and a "data table" associated with the gridview. The gridview has the "enable editing" set to true..but when i click the "edit" button of a particular row in a gridview i get no response...i.e i do not get editable textboxes as it happens normally... What is the solution for this?

    Read the article

  • Selecting Entity Data Model Laguage -- Visual C# source file generated even when i select VB

    - by Nickson
    Am adding an Entity Data Model to an ASP.NET website. When i Add New Item to the website and select ADO.NET Entity Data Model, am asked for the model name and language. I go a head and select Visual Basic as the language, the model is added and the site can compile with out any issues. however, the model it adds a ModelName.Designer.cs source file, instead of a ModelName.Designer.vb source file. am thinking this is strange as its happening with only one of my website. my other sites have .vb designer source file for their Entity Data Models. The site still compiles with out any errors but am afraid some thing is not right. any one experienced this?, is this normal behavior?

    Read the article

  • contentEditable javascript caret placement in div

    - by Ben Mc
    I have a contentEditable div. Let's say the user clicks a button that inserts HTML into the editable area. So, they click a button and the following is added to the innerHTML of the contentEditable div: <div id="outside"><div id="inside"></div></div> How do I automatically place the cursor (ie caret) IN the "inside" div? Worse. How can this work in IE and FF?

    Read the article

  • Anti-aliasing not working when resizing a UIWebView

    - by nickcartwright
    I'd like to add a Web View to my app at 60% scale (like seen in Safari in the browse other windows view): Notice how the content looks nice and Aliased! If I try and add the same Web view to my app: NSURL *url = [NSURL URLWithString:@"http://www.google.co.uk?q=hello"]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 400)]; webView.delegate=self; [webView loadRequest:request]; [self.view addSubview:webView]; Using the following transformation: [webView setTransform:CGAffineTransformMakeScale(0.6, 0.6)]; ..the scale is really bad quality and there appears to be no anti-aliasing. Does anyone know why this is happening or have a suggestion on how it could be fixed? Thanks! Nick.

    Read the article

  • creating matrix with probabilities

    - by John Chan
    Hi all, I want to generate a matrix of NxN to test some code that I have where each row contains floats as the elements and has to add up to 1 (i.e. a row with a set of probabilities). Where it gets tricky is that I want to make sure that randomly some of the elements should be 0 (in fact most of the elements should be 0 except for some random ones to be the probabilities). I need the probabilities to be 1/m where m is the number of elements that are not 0 within a single row. I tried to think of ways to output this, but essentially I would need this stored in a C++ array. So even if I output to a file I would still have the issue of not having it in array as I need it. At the end of it all I need that array because I want to generate a Market Matrix file. I found an implementation in C++ to take an array and convert it to the market matrix file, so this is what I am basing my findings on. My input for the rest of the code takes in this market matrix file so I need that to be the primary form of output. The language does not matter, I just want to generate the file at the end (I found a way mmwrite and mmread in python as well) Please help, I am stuck and not really sure how to implement this.

    Read the article

  • UITableViewController not redrawing new cell text label after popViewControllerAnimated

    - by crunchyt
    I have a problemetic UITableViewController fails to redraw an updated cell after a child view is removed. Here's what's happening. After changing data in a child view, the parent view controller reloads the source data array and runs [tableView reloadData] via a PostNotification. After this triggers, I use popViewControllerAnimated to return to the parent UITableViewController (this pops the child view off the stack, and reveals the controller one level up). However, my updated data does not appear in the parent view controller! According to the debugger, the cell's label has been updated, but the visible label does not change. However, if I scroll-flick the table, momentarily moving the updated cell out of view, when it reappears the label is updated! I also try calling [tableView reloadData] via viewWillAppear but the issue still persists. Here is some additional info that may be helpful. I have a 3 views structured like this: 1/ SettingsViewController : UITableViewController 2/ -- UserView : UITableViewController 3/ ---- UserDetailsView : UIViewController <UIActionSheetDelegate> I am calling UserDetailsView from inside UserView as follows: UserDetailsView *userDetailsView = [[UserDetailsView alloc] init]; [self.navigationController pushViewController:userDetailsView animated:YES]; If I return to the top-most controller (SettingsViewController) and then load the problematic controller (UserView), everything is drawn correctly. It is only when returning from a child view that this issue occurs. Thank you in advance for your suggestions.

    Read the article

  • C#, Linq, Dynamic Query: Code to filter a Dynamic query outside of the Repository

    - by Dr. Zim
    If you do something like this in your Repository: IQueryable<CarClass> GetCars(string condition, params object[] values) { return db.Cars.Where(condition, values); } And you set the condition and values outside of the repository: string condition = "CarMake == @Make"; object[] values = new string[] { Make = "Ford" }; var result = myRepo.GetCars( condition, values); How would you be able to sort the result outside of the repository with Dynamic Query? return View( "myView", result.OrderBy("Price")); Somehow I am losing the DynamicQuery nature when the data exits from the repository. And yes, I haven't worked out how to return the CarClass type where you would normally do a Select new Carclass { fieldName = m.fieldName, ... }

    Read the article

  • Oracle SELECT TOP 10 records

    - by ArneRie
    Hi, i have an big problem with an SQL Statement in Oracle. I want to select The TOP 10 Records ordered by STORAGE_DB wich arent in a list from an other select statement. This one works fine for all records: SELECT DISTINCT APP_ID, NAME, STORAGE_GB, HISTORY_CREATED, TO_CHAR(HISTORY_DATE, 'DD.MM.YYYY') AS HISTORY_DATE FROM HISTORY WHERE STORAGE_GB IS NOT NULL AND APP_ID NOT IN (SELECT APP_ID FROM HISTORY WHERE TO_CHAR(HISTORY_DATE, 'DD.MM.YYYY') = '06.02.2009') But when i am adding AND ROWNUM <= 10 ORDER BY STORAGE_GB DESC im getting some kind of "random" Records. I think because the limit takes in place before the order. Does someone has an good solution? The other problem: This query is realy slow (10k+ records)

    Read the article

  • Problem at JUnit test with generics

    - by Tom Brito
    In my utility method: public static <T> T getField(Object obj, Class c, String fieldName) { try { Field field = c.getDeclaredField(fieldName); field.setAccessible(true); return (T) field.get(obj); } catch (Exception e) { e.printStackTrace(); fail(); return null; } } The line return (T) field.get(obj); gives the warning "Type safety: Unchecked cast from Object to T"; but I cannot perform instanceof check against type parameter T, so what am I suppose to do here?

    Read the article

  • Outstanding issues with jQuery.ajax() in IE8?

    - by RyanV
    I am loading feed-items into a ul using this jQuery .ajax() call, which I basically lifted from http://www.makemineatriple.com/2007/10/bbcnewsticker/ var timestamp = true; //set whether timestamp is displayed in $.ajax({ type: "GET", url: "sample-feed.xml", dataType: "xml", success: function(xml) { $(xml).find('item').each(function(){ var title = $(this).find('title').text(); var link = $(this).find('link').text(); if(title.length >=57){ title = title.substring(0,54) + "..."; } var addItem = '<li class="tickerTitle"><a href="'+link+'">'+title+'</a>'; if (Boolean(timestamp)== true){ var time = new Date(Date.parse($(this).find('pubDate').text())); addItem +='<span class="timestamp">' + makestamp(time) +'</span></li>'; } $('ul#news').append(addItem); }); It works in Chrome 4 and Firefox 3.6, but I load it up in IE8 and somehow the ajax call fails. I have tried to use IE8's Developer tools to see where exactly it fails, but I haven't been successful yet. So two questions Is there anything blatantly wrong with my ajax call here that could be preventing me from seeing it in IE where it works in FF/Chrome? Are there any special considerations I have to make for the Internet Explorer family of browsers with regards to this particular jQuery method? I've done some googling on this but nothing obvious is coming up. One other note: I am currently using jQuery 1.3.2 due to some legacy scripts on the same site. I did try loading 1.4.2 and it had the same results on IE8

    Read the article

  • What are some funny loading statements to keep users amused?

    - by Oli
    Nobody likes waiting but unfortunately in the Ajax application I'm working on at the moment, there is one fair-sized pause (1-2 seconds a go) that users have to undergo each and every time they want to load up a chunk of data. I've tried to make the load as interactive as possible. There's an animated GIF alongside a very plain, very dull "Loading..." message. So I thought it might be quite fun to come up with a batch of 50-or-so funny-looking messages and pick from them randomly so the user never knows what they're going to see. The time they would have spent growing impatient is fruitfully used. Here's what I've come up with so far, just to give you an idea. var randomLoadingMessage = function() { var lines = new Array( "Locating the required gigapixels to render...", "Spinning up the hamster...", "Shovelling coal into the server...", "Programming the flux capacitor" ); return lines[Math.round(Math.random()*(lines.length-1))]; } (Yes -- I know some of those are pretty lame -- That's why I'm here :) The funniest I see today will get the prestigious "Accepted Answer" award. Others get votes for participation. Enjoy!!

    Read the article

  • File Upload Validator always show error message

    - by Space Cracker
    i add asp.net file upload control as following <asp:FileUpload ID="filesFileUpload" runat="server" /> <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ErrorMessage="file types not supported" ValidationExpression="\.(zip.rar|jpg|gif|png|eps|ai|psd|pdf)$" ControlToValidate="filesFileUpload"></asp:RegularExpressionValidator> and always when i upload file that match the reg expression it show the error .. could any help me why this done ?

    Read the article

  • Is it possible to do AJAX calls in a liquid template?

    - by Brian Armstrong
    I'm looking at the liquid templating language for Rails apps: http://wiki.github.com/tobi/liquid/ I'd like my users to also be able to make AJAX calls (just like the ones in rails for periodically_call_remote, observe_field, etc). Is this possible? Assuming the rails helpers can be added as filters, how will the user be able to modify what gets returned by the AJAX call? They cannot modify an rjs file on the server or anything like that. I suppose the AJAX call could return JSON (instead of rendered html) and then the javascript could use that to render something. But I'm having a little trouble envisioning how it would work exactly. If anyone can point me to an example of this or clarify it'd be much appreciated. Thanks!

    Read the article

  • CakePHP: Custom Function in bootstrap that uses $ajax->link not working

    - by nekko
    Hello I have two questions: (1) Is it best practice to create global custom functions in the bootstrap file? Is there a better place to store them? (2) I am unable use the following line of code in my custom function located in my bootstrap.php file: $url = $ajax->link ( 'Delete', array ('controller' => 'events', 'action' => 'delete', 22 ), array ('update' => 'event' ), 'Do you want to delete this event?' ); echo $url; I receive the following error: Notice (8): Undefined variable: ajax [APP\config\bootstrap.php, line 271] Code } function testAjax () { $url = $ajax->link ( 'Delete', array ('controller' => 'events', 'action' => 'delete', 22 ), array ('update' => 'event' ), 'Do you want to delete this event?' ); testAjax - APP\config\bootstrap.php, line 271 include - APP\views\event\queue.ctp, line 19 View::_render() - CORE\cake\libs\view\view.php, line 649 View::render() - CORE\cake\libs\view\view.php, line 372 Controller::render() - CORE\cake\libs\controller\controller.php, line 766 Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 211 Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 181 [main] - APP\webroot\index.php, line 91 However it works as intended if I place that same code in my view: <a onclick=" event.returnValue = false; return false;" id="link1656170149" href="/shout/events/delete/22">Delete</a> Please help :) Thanks in advance!!

    Read the article

  • TeamCity stopped working once I added NUnit to the mix

    - by Dave
    I'm struggling a lot trying to get our build server going. I am currently running tests in a Windows XP virtual machine, and have installed TeamCity v5.0.3, build 10821. I am using NUnit v2.5.3. I finished the initial setup with TeamCity without any issues at all, provided that I use the sln2008 build runner that makes the entire process almost brainless. It's really quite nice that way, and very satisfying to see your first successful automated build. Now it's time to kick it up a notch and I wanted to get NUnit working. I keep the NUnit 2.5.3 assemblies in an external libs folder in SVN, so I checked that out onto the test system. I selected NUnit 2.5.3 from the build runner options, as the online instructions had recommended. But when I build, I get the following error: Window1.xaml.cs(14,7): error CS0246: The type or namespace name ‘NUnit’ could not be found (are you missing a using directive or an assembly reference?) Window1.xaml.cs(28,10): error CS0246: The type or namespace name ‘Test’ could not be found (are you missing a using directive or an assembly reference?) Window1.xaml.cs(28,10): error CS0246: The type or namespace name ‘TestAttribute’ could not be found (are you missing a using directive or an assembly reference?) Everything compiles great in the IDE. From finding blog posts and submitting comments, I got some advice and confirmed the following: I have the HintPath value set properly in my project file (points to the external lib) I can also do a full Release and Debug build from the command line using msbuild I have tried do use the NUnit installer so nunit.framework.dll gets registered into the GAC I have changed the build agent's logon account to be a user on the test system, rather than LOCAL SYSTEM. Nothing seems to help... can anyone else here offer me some advice on what to try next?

    Read the article

< Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >