Search Results

Search found 13889 results on 556 pages for 'results'.

Page 78/556 | < Previous Page | 74 75 76 77 78 79 80 81 82 83 84 85  | Next Page >

  • How do I display two different objects in a search?

    - by JZ
    github url I am using a simple search that displays search results: @adds = Add.search(params[:search]) In addition to the search results I'm trying to utilize a method, nearbys(), which displays objects that are close in proximity to the search result. The following method displays objects which are close to 2, but it does not display object 2. How do I display object 2 in conjunction with the nearby objects? @adds = Add.find(2).nearbys(10) While the above code functions, when I use search, @adds = Add.search(params[:search]).nearbys(10) a no method error is returned, undefined methodnearbys' for Array:0x30c3278` How can I search the model for an object AND use the nearbys() method AND display all results returned? Model: def self.search(search) if search find(:all, :conditions => ['address LIKE ?', "%#{search}%"]) # where('address LIKE ?', "%#{search}") else find(:all) end end

    Read the article

  • XML Output is Truncated in SQL

    - by Muhammad Akhtar
    Hi, I need to return my result set in XML and this works fine, but if the number of records are increased, my xml output is truncated here is my query select t.id,t.name,t.address from test FOR XML AUTO, ROOT('Response'), ELEMENTS However I have set some option to increase the output result set like.. Tools --> Options --> Query Results --> SQL Server --> Results to Text --> Maximum number of characters displayed in each column Tools --> Options --> Results --> Maximum characters per column but still I am unable to get my desired result. please suggest my solution Thanks....

    Read the article

  • Django CSRF failure when form posts to a different frame

    - by Leopd
    I'm building a page where I want to have a form that posts to an iframe on the same page. The Template looks like this: <form action="form-results" method="post" target="resultspane" > {% csrf_token %} <input name="query"> <input type=submit> </form> <iframe src="form-results" name="resultspane" width="100%" height="70%"> </iframe> The view behind form-results is getting CSRF errors. Is there something special needed for cross-frame posting?

    Read the article

  • PHP JSON encode output number as string

    - by mitch
    I am trying to output a JSON string using PHP and MySQL but the latitude and longitude is outputting as a string with quotes around the values. This causes an issue when I am trying to add the markers to a google map. Here is my code: $sql = mysql_query('SELECT * FROM markers WHERE address !=""'); $results = array(); while($row = mysql_fetch_array($sql)) { $results[] = array( 'latitude' =>$row['lat'], 'longitude' => $row['lng'], 'address' => $row['address'], 'project_ID' => $row['project_ID'], 'marker_id' => $row['marker_id'] ); } $json = json_encode($results); echo "{\"markers\":"; echo $json; echo "}"; Here is the expected output: {"markers":[{"latitude":0.000000,"longitude":0.000000,"address":"2234 2nd Ave, Seattle, WA","project_ID":"7","marker_id":"21"}]} Here is the output that I am getting: {"markers":[{"latitude":"0.000000","longitude":"0.000000","address":"2234 2nd Ave, Seattle, WA","project_ID":"7","marker_id":"21"}]} Notice the quotes around the latitude and longitude values.

    Read the article

  • jQuery: detecting reaching bottom of scroll doesn't work, only detects the top! :(

    - by Jack Webb-Heller
    Hi folks! So basically my problem is a seemingly simple one. You can see it in action at http://furnace.howcode.com (please note that data is returned via Ajax, so if nothing happens give it a few moments!). What's MEANT to happen, is in the second column when you reach the bottom of scrolling, the next 5 results are returned. But what actually happens is it only returns the 5 results when you hit the TOP of the scroll area. Try it: scroll down, nothing happens. Scroll back up to the top, the results are returned. What's going wrong? Here's my code I'm using: $('#col2').scroll(function(){ if ($('#col2').scrollTop() == $('#col2').height() - $('#col2').height()){ loadMore(); } }); loadMore(); is the function that gets the data and appends it. So what's going wrong here? Thanks for your help! Jack

    Read the article

  • ERRNO: 2 Division by zero error

    - by chupinette
    I am getting this error : ERRNO: 2 TEXT: Division by zero I have the following function in my class Customer public static function GetQuotationDetails($string) { $sql = 'SELECT I.name, I.discounted_price, I.other_name FROM item I WHERE ( I.name LIKE CONCAT( '%', :string, '%' )) AND T.item_name=:string'; $parameters = array(':string' => $string); DB::GetAll($sql,$parameters); } Then, $this->results = Customer::GetQuotationDetails('grinder'); and i echo the results by echo $obj_quotations->results; Can anyone help me?

    Read the article

  • Drupal Views pulling Data Fields

    - by askon
    I'm a little new to drupal but have been using things like devel module and theme developer to speed up the learning process. My question, is it possible to theme an entire views BLOCK from a single views tpl.php page OR even a preprocess? When I'm grabbing the $view object I can see results $node-result, it has all of the results, but it doesn't have all my views fields. I'm missing things like, node path, taxonomy titles and paths, etc. From my understanding, Drupal wants you to individually theme EACH output field. It seems rather superfluous to create so many extra templates when I've already got over HALF of my results coming through the $view object Would outputting node over field make this easier? Or am going in the wrong direction with $view-result? Thanks!

    Read the article

  • Core Data inserting objects

    - by Joe
    I'm trying to get my head around Core Data on the iphone. This is code from Apple's 'Navigation based app using Core data' template (method - insertNewObject) // Create a new instance of the entity managed by the fetched results controller. NSManagedObjectContext *context = [fetchedResultsController managedObjectContext]; NSEntityDescription *entity = [[fetchedResultsController fetchRequest] entity]; NSManagedObject *newManagedObject = [NSEntityDescription insertNewObjectForEntityForName:[entity name] inManagedObjectContext:context]; It seems completely counter intuitive to me that the fetched results controller is used when inserting a new object. I changed the code to this: NSEntityDescription *entity = [NSEntityDescription entityForName:@"Event" inManagedObjectContext:managedObjectContext]; NSManagedObject *newManagedObject = [NSEntityDescription insertNewObjectForEntityForName:[entity name] inManagedObjectContext:managedObjectContext]; which works just as well and does not require access to the fetch request. Am I missing something here? Is there any good reason to use the fetched results controller in the insert method?

    Read the article

  • Using recode in R

    - by celenius
    I'm trying to use 'recode' in R (from the 'cars' package) and it is not working. I read in data from a .csv file into a data frame called 'results'. Then, I replace the values in the column 'Built_year', according to the following logic. recode(results$Built_year, "2 ='1950s';3='1960s';4='1970s';5='1980s';6='1990s';7='2000 or later'") When I check results$Built_year after doing this step, it appears to have worked. However, it does not store this value, and returns to its previous value. I don't understand why. Thanks. (at the moment something is going wrong and I can't see any of the icons for formatting)

    Read the article

  • Using django-haystack, how do I perform a search with only partial terms?

    - by Sri Raghavan
    I've got a Haystack/xapian search index for django.contrib.auth.models.User. The template is simply {{object.get_full_name}} as I intend for a user to type in a name and be able to search for it. My issue is this: if I search, say, Sri (my full first name) I come up with a result for the user object pertaining to my name. However, if I search Sri Ragh - that is, my full name, and part of my last name, I get no results. How can I set Haystack up so that I can get the appropriate results for partial queries? (I essentially want it to search *Sri Ragh*, but I don't know if wildcards would actually do the trick, or how to implement them). This is my search query: results = SearchQuerySet().filter(content='Sri Ragh')

    Read the article

  • How to change out-of-focus text selection color in Xcode?

    - by Jackson
    Okay, I'll bite. I've got really pleasant code/window colors set up in Xcode. Ordinarily, my selection color is very visible. When I am doing a project search and iterating through the results, however, the results list stays in focus and the found text remains out of focus, using a different background color. This color is extremely hard to detect, especially when the text is embedded in a larger code block and the view is shifting around as it scrolls to the results. Here's an example: Left side is in focus (just normal selection), right side is out of focus (during project find) Often it takes a few seconds to find where the heck the selected text is. Unless I'm just missing it, Xcode seems to offer no way to change this particular selection color. Interestingly, it also doesn't seem to follow the selection color from the Appearance panel. Does anyone know a way to change this color or force it to be more visible, short of changing my entire color scheme around?

    Read the article

  • How can I return a sql select into a sql variable

    - by Matt
    Hi, I'm trying to put the results of a SELECT into a variable and loop through the results to manipulate that data, all in the same stored proceedure... Here's what I have so far: DECLARE @i int @Result = (SELECT * FROM UserImport) SET @i = 0 WHILE @i < (SELECT Count(@Result) As Count) BEGIN /* Do Stuff */ END I know I'm way off because it's saying @Result was not declared, but I'm not sure how to declare a variable to be able to hold the results of a SELECT statement. Can anyone tell me where i'm going wrong and how to fix it? Thanks, Matt

    Read the article

  • Adding ID's to google map markers

    - by Nick
    I have a script that loops and adds markers one at a time. I am trying to get the current marker to have an info window and and only have 5 markers on a map at a time (4 without info windows and 1 with) How would i add an id to each marker so that i can delete and close info windows as needed. this is the function i am using to set the marker function codeAddress(address, contentString) { var infowindow = new google.maps.InfoWindow({ content: contentString }); if (geocoder) { geocoder.geocode( { 'address': address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { map.setCenter(results[0].geometry.location); var marker = new google.maps.Marker({ map: map, position: results[0].geometry.location }); infowindow.open(map,marker); } else { alert("Geocode was not successful for the following reason: " + status); } }); } }

    Read the article

  • Django: How do I position a page when using Django templates

    - by swisstony
    I have a web page where the user enters some data and then clicks a submit button. I process the data and then use the same Django template to display the original data, the submit button, and the results. When I am using the Django template to display results, I would like the page to be automatically scrolled down to the part of the page where the results begin. This allows the user to scroll back up the page if she wants to change her original data and click submit again. Hopefully, there's some simple way of doing this that I can't see at the moment.

    Read the article

  • Rails3. How do I display two different objects in a search?

    - by JZ
    I am using a simple search that displays search results: @adds = Add.search(params[:search]) In addition to the search results I'm trying to utilize a method, nearbys(), which displays objects that are close in proximity to the search result. The following method displays objects which are close to 2, but it does not display object 2. How do I display object 2 in conjunction with the nearby objects? @adds = Add.find(2).nearbys(10) While the above code functions, when I use search, @adds = Add.search(params[:search]).nearbys(10) a no method error is returned, undefined methodnearbys' for Array:0x30c3278` How can I search the model for an object AND use the nearbys() method AND display all results returned?

    Read the article

  • calculate intersection between two segments in a symmetric way

    - by Elazar Leibovich
    When using the usual formulas to calculate intersection between two 2D segments, ie here, if you round the result to an integer, you get non-symmetric results. That is, sometimes, due to rounding errors, I get that intersection(A,B)!=intersection(B,A). The best solution is to keep working with floats, and compare the results up to a certain precision. However, I must round the results to integers after calculating the intersection, I cannot keep working with floats. My best solution so far was to use some full order on the segments in the plane, and have intersection to always compare the smaller segment to the larger segment. Is there a better method? Am I missing something?

    Read the article

  • Rails relation select

    - by Dimitar Vouldjeff
    Hi, I have the following models: class User < ActiveRecord::Base has_many :results, :dependent => :destroy has_many :participants, :dependent => :destroy has_many :courses, :through => :participants end class Course < ActiveRecord::Base has_many :tests, :dependent => :destroy has_many :participants, :dependent => :destroy has_many :users, :through => :participants end class Result < ActiveRecord::Base belongs_to :test belongs_to :user end class Test < ActiveRecord::Base belongs_to :course has_many :results, :dependent => :destroy end The Idea is that a user has_and_belongs_to_many courses, the course has_many tests, and every test has_and_belongs_to_many users (results). So what is the best query to select every Result from a single Course (not test), and also the query to select every Result from a single Course, but from one user. Thanks!

    Read the article

  • MySql - Select from - Don't Show Duplicate Words - maybe "on duplicate key"?

    - by ali
    hi, how can I insert "on duplicate key" in this Code to remove duplicate words? or is there a better method that you know? thank you!! this is my code: function sm_list_recent_searches($before = '', $after = '', $count = 20) { // List the most recent successful searches. global $wpdb, $table_prefix; $count = intval($count); $results = $wpdb->get_results( "SELECT `terms`, `datetime` FROM `{$table_prefix}searchmeter_recent` WHERE 3 < `hits` AND CHAR_LENGTH(`terms`) > 4 ORDER BY `datetime` DESC LIMIT $count"); if (count($results)) { foreach ($results as $result) { echo '<a href="'. get_settings('home') . '/search/' . urlencode($result->terms) . '">'. htmlspecialchars($result->terms) .'</a>'.", "; } } }

    Read the article

  • Help writing emacs lisp for emacs etags search

    - by user535707
    I'm looking for some help developing what I think should be an easy program. I want something similar to Emacs tags-search command, but I want to collect all search results into a buffer. (I want to see all results of M-,) I'm thinking this python style pseudo code should work, but I have no idea how to do this in emacs lisp? Any help would be greatly appreciated. def myTagsGrep(searchValue): for aFile in the tag list: result = grep aFile seachValue if len(result) > 0: print aFile # to the buffer print result # to the buffer I would like to be able to browse through the buffer with the same features tags-apropos does. Note that a similar question has been asked before: Is there a way to get emacs tag-search command to output all results to a buffer?

    Read the article

  • Python MySQLdb LOAD LOCAL INFILE problems

    - by belvoir
    The problem is a simple one. When I execute the following I get different results depending on whether I run it from the MySQL console and from inside a Python Script using MySQLdb: LOAD DATA LOCAL INFILE '/tmp/source.csv' INTO TABLE test FIELDS TERMINATED BY '|' IGNORE 1 LINES; Console gives the following results: Records: 35002 Deleted: 0 Skipped: 0 Warnings: 0 Python (via .info()) returns the following: Records: 34977 Deleted: 0 Skipped: 0 Warnings: 8 So in summary, same source file, same SQL request, different results. From the console I can 'SHOW WARNINGS' an get a better handle on which records are causing the problems and why but from Python I can't idenitify how to do this or more importantly what the cause of the problem could be. Any suggestions? MySQL Server '5.1.41-3ubuntu12.1' Python '2.6.5' Tables are MyISAM

    Read the article

  • How do I call functions of an object inside the same object?

    - by Roly
    I have the following Javascript code add_num = { f: function(html, num) { alert(this.page); }, page : function() { return parseInt(this.gup('page')); }, gup : function(name) { name = name.replace(/[\[]/,'\\\[').replace(/[\]]/,'\\\]'); var regex = new RegExp('[\\?&]'+name+'=([^&#]*)'); var results = regex.exec(window.location.href); if(results == null) return ''; else return results[1]; } } But when I call add_num.f() what I get from alert() is the actual code of page. That is, it returns function() { return parseInt(this.gup('page')); } I was expecting a numeric value and not any code at all.

    Read the article

  • SQL Server 2008 full-text search doesn't find word in words?

    - by Martijn
    In the database I have a field with a .mht file. I want to use FTS to search in this document. I got this working, but I'm not satisfied with the result. For example (sorry it's in dutch, but I think you get my point) I will use 2 words: zieken and ziekenhuis. As you can see, the phrase 'zieken' is in the word 'ziekenhuis'. When I search on 'ziekenhuis' I get about 20 results. When I search on 'zieken' I get 7 results. How is this possible? I mean, why doesn't the FTS resturn the minimal results which I get from 'ziekenhuis'? Here's the query I use: SELECT DISTINCT d.DocID 'Id', d.Titel, (SELECT afbeeldinglokatie FROM tbl_Afbeelding WHERE soort = 'beleid') as Pic, 'belDoc' as DocType FROM docs d JOIN kpl_Document_Lokatie dl ON d.DocID = dl.DocID JOIN HandboekLokaties hb ON dl.LokatieID = hb.LokatieID WHERE hb.InstellingID = @instellingId AND ( FREETEXT(d.Doel, @searchstring) OR FREETEXT(d.Toepassingsgebied, @searchstring) OR FREETEXT(d.HtmlDocument, @searchstring) OR FREETEXT (d.extraTabblad, @searchstring) ) AND d.StatusID NOT IN( 1, 5)

    Read the article

  • How to get methods list in scala

    - by skyde
    In language like python and ruby to ask the language what index-related methods its string class supports (which methods’ names contain the word “index”) you can do “”.methods.sort.grep /index/i And in java List results = new ArrayList(); Method[] methods = String.class.getMethods(); for (int i = 0; i < methods.length; i++) { Method m = methods[i]; if (m.getName().toLowerCase().indexOf(“index”) != -1) { results.add(m.getName()); } } String[] names = (String[]) results.toArray(); Arrays.sort(names); return names; How would you do the same thing in Scala?

    Read the article

  • Testing a (big) collection retrieved from a db

    - by Bas
    I'm currently doing integration testing on a live database and I have the following sql statement: var date = DateTime.Parse("01-01-2010 20:30:00"); var result = datacontext.Repository<IObject>().Where(r => r.DateTime > date).First(); Assert.IsFalse(result.Finished); I need to test if the results retrieved from the statement, where the given date is less then the date of the object, have Finished set to False. I do not know how many results I get back and currently I'm getting the first object of the list and check if that object has Finished set to false. I know testing only the first item of the list is not valid testing, as a solution for that I could iterate through the list and check all items on Finished, but putting logic in a Test is kinda going against the concept of writing 'good' tests. So my question is: Does anyone have a good solution of how to properly test the results of this list?

    Read the article

  • Lucene.NET - sorting by int

    - by Judah Himango
    In the latest version of Lucene (or Lucene.NET), what is the proper way to get the search results back in sorted order? I have a document like this: var document = new Lucene.Document(); document.AddField("Text", "foobar"); document.AddField("CreationDate", DateTime.Now.Ticks.ToString()); // store the date as an int lucene.AddDocument(document); Now I want do a search and get my results back in order of most recent. How can I do a search that orders results by CreationDate? All the documentation I see is for old Lucene versions that use now-deprecated APIs.

    Read the article

< Previous Page | 74 75 76 77 78 79 80 81 82 83 84 85  | Next Page >