Search Results

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

Page 14/556 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Need Help with Consolidating RoR Google Map Results

    - by Kevin
    I have a project that returns geocoded results within 20 miles of the user. I want these results grouped on the map by zip code, then within the info window show the individual results. The code posted below works, but for some reason it only displays the 1.png rather than looking at the results and using the correct .png icon associated with the number. When I look at the infowindows, it displays the correct png like "/images/2.png" or "/images/5.png" but the actual image is always 1. @ziptickets = Ticket.find(:all, :origin => coords, :select => 'DISTINCT zip, lat, lng', :within => @user.distance_to_travel, :conditions => "status_id = 1") for t in @ziptickets zips = Ticket.find(:all, :conditions => ["zip = ?", t.zip]) currentzip = t.zip.to_s tixinzip = zips.size.to_s imagelocation = "/images/" + tixinzip + ".png" shadowlocation = "/images/" + tixinzip + "s.png" @map.icon_global_init(GIcon.new(:image => imagelocation, :shadow => shadowlocation, :shadow_size => GSize.new(60,40), :icon_anchor => GPoint.new(20,20), :info_window_anchor => GPoint.new(9,2)), "test") newicon = Variable.new("test") new_marker = GMarker.new([t.lat, t.lng], :icon => newicon, :title => imagelocation, :info_window => currentzip) @map.overlay_init(new_marker) end I tried changing the last part of the mapicon from: :info_window_anchor => GPoint.new(9,2)), "test") newicon = Variable.new("test") to: :info_window_anchor => GPoint.new(9,2)), currentzip) newicon = Variable.new(currentzip) but the strangest thing is that any string that has numbers in it causes the map to fail to render in the view and just show a blank screen... same if I replace it with :info_window_anchor => GPoint.new(9,2)), "123") newicon = Variable.new("123") Any advice would be helpful... also it runs a bit slower than my previous code which just set up 4 standard icons and used them outside of the loop so any hints as to speed up execution would be appreciated greatly. Thanks!

    Read the article

  • How do I get javascript results using selenium?

    - by Seth
    I have the following code: from selenium import selenium selenium = selenium("localhost", 4444, "*chrome", "http://some_site.com/") selenium.start() sel = selenium sel.open("/") sel.type("ctl00_ContentPlaceHolder1_SuburbTownTextBox", "Adelaide,SA,5000") sel.click("ctl00_ContentPlaceHolder1_SearchImageButton") #text = sel.get_body_text() text = sel.get_html_source() print(text) The click executes a javascript file which then produces results on the same page. Obviously print(text) will only print the orignal html source. How do I get to the results of the javascript?

    Read the article

  • Remove deleted page from Google search results

    - by Steven
    So I have a website that I recently made changes to, and one of the changes was removing a page from the site. I deleted the page, it doesn't exist anymore. However, when you search for my site, one of the results is the page that I deleted. People are clicking on the page and getting an error. How do I remove that page from the search results?

    Read the article

  • Updating UISearchDisplayController with Core Data results using GCD

    - by Brian Halpin
    I'm having trouble displaying the results from Core Data in my UISearchDisplayController when I implement GCD. Without it, it works, but obviously blocks the UI. In my SearchTableViewController I have the following two methods: - (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString { // Tell the table data source to reload when text changes [self filterContentForSearchText:searchString]; // Return YES to cause the search result table view to be reloaded. return YES; } // Update the filtered array based on the search text -(void)filterContentForSearchText:(NSString*)searchText { // Remove all objects from the filtered search array [self.filteredLocationsArray removeAllObjects]; NSPredicate *predicate = [CoreDataMaster predicateForLocationUsingSearchText:@"Limerick"]; CoreDataMaster *coreDataMaster = [[CoreDataMaster alloc] init]; // Filter the array using NSPredicate self.filteredLocationsArray = [NSMutableArray arrayWithArray: [coreDataMaster fetchResultsFromCoreDataEntity:@"City" UsingPredicate:predicate]]; } You can probably guess that my problem is with returning the array from [coreDataMaster fetchResultsFromCoreDataEntity]. Below is the method: - (NSArray *)fetchResultsFromCoreDataEntity:(NSString *)entity UsingPredicate:(NSPredicate *)predicate { NSMutableArray *fetchedResults = [[NSMutableArray alloc] init]; dispatch_queue_t coreDataQueue = dispatch_queue_create("com.coredata.queue", DISPATCH_QUEUE_SERIAL); dispatch_async(coreDataQueue, ^{ NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; NSEntityDescription *entityDescription = [NSEntityDescription entityForName:entity inManagedObjectContext:self.managedObjectContext]; NSSortDescriptor *nameSort = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES]; NSArray *sortDescriptors = [NSArray arrayWithObjects:nameSort, nil]; [fetchRequest setEntity:entityDescription]; [fetchRequest setSortDescriptors:sortDescriptors]; // Check if predicate is set if (predicate) { [fetchRequest setPredicate:predicate]; } NSError *error = nil; NSArray *fetchedManagedObjects = [self.managedObjectContext executeFetchRequest:fetchRequest error:&error]; for (City *city in fetchedManagedObjects) { [fetchedResults addObject:city]; } NSDictionary *userInfo = [NSDictionary dictionaryWithObject:[NSArray arrayWithArray:fetchedResults] forKey:@"results"]; [[NSNotificationCenter defaultCenter] postNotificationName:@"fetchResultsComplete" object:nil userInfo:userInfo]; }); return [NSArray arrayWithArray:fetchedResults]; } So the thread hasn't finished executing by the time it returns the results to self.filteredLocationsArray. I've tried added a NSNotification which passes the NSDictionary to this method: - (void)updateSearchResults:(NSNotification *)notification { NSDictionary *userInfo = notification.userInfo; NSArray *array = [userInfo objectForKey:@"results"]; self.filteredLocationsArray = [NSMutableArray arrayWithArray:array]; [self.tableView reloadData]; } I've also tried refreshing the searchViewController like [self.searchDisplayController.searchResultsTableView reloadData]; but to no avail. I'd really appreciate it if someone could point me in the right direction and show me where I might be going wrong. Thanks

    Read the article

  • how to remove repeated record's from results linq to sql

    - by Sadegh
    hi, i want to remove repeated record's from results but distinct don't do this for me! why??? var results = (from words in _Xplorium.Words join wordFiles in _Xplorium.WordFiles on words.WordId equals wordFiles.WordId join files in _Xplorium.Files on wordFiles.FileId equals files.FileId join urls in _Xplorium.Urls on files.UrlId equals urls.UrlId where files.Title.Contains(query) || files.Description.Contains(query) orderby wordFiles.Count descending select new SearchResultItem() { Title = files.Title, Url = urls.Address, Count = wordFiles.Count, CrawledOn = files.CrawledOn, Description = files.Description, Lenght = files.Lenght, UniqueKey = words.WordId + "-" + files.FileId + "-" + urls.UrlId }).Distinct();

    Read the article

  • Realtime MySQL search results on an advanced search page

    - by Andrew Heath
    I'm a hobbyist, and started learning PHP last September solely to build a hobby website that I had always wished and dreamed another more competent person might make. I enjoy programming, but I have little free time and enjoy a wide range of other interests and activities. I feel learning PHP alone can probably allow me to create 98% of the desired features for my site, but that last 2% is awfully appealing: The most powerful tool of the site is an advanced search page that picks through a 1000+ record game scenario database. Users can data-mine to tremendous depths - this advanced page has upwards of 50 different potential variables. It's designed to allow the hardcore user to search on almost any possible combination of data in our database and it works well. Those who aren't interested in wading through the sea of options may use the Basic Search, which is comprised of the most popular parts of the Advanced search. Because the advanced search is so comprehensive, and because the database is rather small (less than 1,200 potential hits maximum), with each variable you choose to include the likelihood of getting any qualifying results at all drops dramatically. In my fantasy land where I can wield AJAX as if it were Excalibur, my users would have a realtime Total Results counter in the corner of their screen as they used this page, which would automatically update its query structure and report how many results will be displayed with the addition of each variable. In this way it would be effortless to know just how many variables are enough, and when you've gone and added one that zeroes out the results set. A somewhat similar implementation, at least visually, would be the Subtotal sidebar when building a new custom computer on IBuyPower.com For those of you actually still reading this, my question is really rather simple: Given the time & ability constraints outlined above, would I be able to learn just enough AJAX (or whatever) needed to pull this one feature off without too much trouble? would I be able to more or less drop-in a pre-written code snippet and tweak to fit? or should I consider opening my code up to a trusted & capable individual in the future for this implementation? (assuming I can find one...) Thank you.

    Read the article

  • Serialize ASP.NET Web Service HTTP POST request results

    - by nigative
    I am trying to serialize my webmethod output (rename XML element with results), So far [return: System.Xml.Serialization.SoapElementAttribute("results")] before method declaration works fine with soap requests, but I am looking for something that would work the same way with HTTP POST/GET requests as well (right now I get return class name as element name)

    Read the article

  • Drupal return number of results in a View

    - by Linda
    I have a view in Drupal that filters my content. It brings back 7 rows. All I want to return is the number or results returned(7). Is this possible? I tried using the View result counter but it returns a number for each results 1 2 3 4 5 6 7 I just need the 7 part. So in SQL I would do a select count(*)

    Read the article

  • Indexing over the results returned by selenium

    - by Guy
    Hi I try to index over results returned by an xpath. For example: xpath = '//a[@id="someID"]' can return a few results. I want to get a list of them. I thought that doing: numOfResults = sel.get_xpath_count(xpath) l = [] for i in range(1,numOfResults+1): l.append(sel.get_text('(%s)[%d]'%(xpath, i))) would work because doing something similar with firefox's Xpath checker works: (//a[@id='someID'])[2] returns the 2nd result. Ideas why the behavior would be different and how to do such a thing with selenium Thanks

    Read the article

  • SQL Oracle Combining Multiple Results Rows

    - by Stuav
    I have the below query Select case upper(device_model) when 'IPHONE' then 'iOS - iPhone' when 'IPAD' then 'iOS - iPad' when 'IPOD TOUCH' then 'iOS - iPod Touch' Else 'Android' End As Device_Model, count(create_dtime) as Installs_Oct17_Oct30 From Player Where Create_Dtime >= To_Date('2012-Oct-17','yyyy-mon-dd') And Create_Dtime <= To_Date('2012-Oct-30','yyyy-mon-dd') Group By Device_Model Order By Device_Model This spits out multiple rows of results that read "Android"....I would like there to be only 4 results rows, one for each case....so it comes out like this: Device_Model Installs_Oct17_Oct30 Android 987 iOS - iPad 12003 iOS - iPhone 8563 iOS- iPod Touch 3482

    Read the article

  • Combining HBase and HDFS results in Exception in makeDirOnFileSystem

    - by utrecht
    Introduction An attempt to combine HBase and HDFS results in the following: 2014-06-09 00:15:14,777 WARN org.apache.hadoop.hbase.HBaseFileSystem: Create Dir ectory, retries exhausted 2014-06-09 00:15:14,780 FATAL org.apache.hadoop.hbase.master.HMaster: Unhandled exception. Starting shutdown. java.io.IOException: Exception in makeDirOnFileSystem at org.apache.hadoop.hbase.HBaseFileSystem.makeDirOnFileSystem(HBaseFile System.java:136) at org.apache.hadoop.hbase.master.MasterFileSystem.checkRootDir(MasterFi leSystem.java:428) at org.apache.hadoop.hbase.master.MasterFileSystem.createInitialFileSyst emLayout(MasterFileSystem.java:148) at org.apache.hadoop.hbase.master.MasterFileSystem.<init>(MasterFileSyst em.java:133) at org.apache.hadoop.hbase.master.HMaster.finishInitialization(HMaster.j ava:572) at org.apache.hadoop.hbase.master.HMaster.run(HMaster.java:432) at java.lang.Thread.run(Thread.java:744) Caused by: org.apache.hadoop.security.AccessControlException: Permission denied: user=hbase, access=WRITE, inode="/":vagrant:supergroup:drwxr-xr-x at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.check(FSPe rmissionChecker.java:224) at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.check(FSPe rmissionChecker.java:204) at org.apache.hadoop.hdfs.server.namenode.FSPermissionChecker.checkPermi ssion(FSPermissionChecker.java:149) at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.checkPermission(F SNamesystem.java:4891) at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.checkPermission(F SNamesystem.java:4873) at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.checkAncestorAcce ss(FSNamesystem.java:4847) at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.mkdirsInternal(FS Namesystem.java:3192) at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.mkdirsInt(FSNames ystem.java:3156) at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.mkdirs(FSNamesyst em.java:3137) at org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.mkdirs(NameN odeRpcServer.java:669) at org.apache.hadoop.hdfs.protocolPB.ClientNamenodeProtocolServerSideTra nslatorPB.mkdirs(ClientNamenodeProtocolServerSideTranslatorPB.java:419) at org.apache.hadoop.hdfs.protocol.proto.ClientNamenodeProtocolProtos$Cl ientNamenodeProtocol$2.callBlockingMethod(ClientNamenodeProtocolProtos.java:4497 0) at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.cal l(ProtobufRpcEngine.java:453) at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:1002) at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1752) at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1748) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:422) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInforma tion.java:1438) at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1746) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct orAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC onstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:408) at org.apache.hadoop.ipc.RemoteException.instantiateException(RemoteExce ption.java:90) at org.apache.hadoop.ipc.RemoteException.unwrapRemoteException(RemoteExc eption.java:57) at org.apache.hadoop.hdfs.DFSClient.primitiveMkdir(DFSClient.java:2153) at org.apache.hadoop.hdfs.DFSClient.mkdirs(DFSClient.java:2122) at org.apache.hadoop.hdfs.DistributedFileSystem.mkdirs(DistributedFileSy stem.java:545) at org.apache.hadoop.fs.FileSystem.mkdirs(FileSystem.java:1915) at org.apache.hadoop.hbase.HBaseFileSystem.makeDirOnFileSystem(HBaseFile System.java:129) ... 6 more while configuration and system settings are as follows: [vagrant@localhost hadoop-hdfs]$ hadoop fs -ls hdfs://localhost/ Found 1 items -rw-r--r-- 3 vagrant supergroup 1010827264 2014-06-08 19:01 hdfs://localhost/u buntu-14.04-desktop-amd64.iso [vagrant@localhost hadoop-hdfs]$ /etc/hadoop/conf/core-site.xml <configuration> <property> <name>fs.defaultFS</name> <value>hdfs://localhost:8020</value> </property> </configuration> /etc/hbase/conf/hbase-site.xml <configuration> <property> <name>hbase.rootdir</name> <value>hdfs://localhost:8020/hbase</value> </property> <property> <name>hbase.cluster.distributed</name> <value>true</value> </property> </configuration> /etc/hadoop/conf/hdfs-site.xml <configuration> <property> <name>dfs.name.dir</name> <value>/var/lib/hadoop-hdfs/cache</value> </property> <property> <name>dfs.data.dir</name> <value>/tmp/hellodatanode</value> </property> </configuration> NameNode directory permissions [vagrant@localhost hadoop-hdfs]$ ls -ltr /var/lib/hadoop-hdfs/cache total 8 -rwxrwxrwx. 1 hbase hdfs 15 Jun 8 23:43 in_use.lock drwxrwxrwx. 2 hbase hdfs 4096 Jun 8 23:43 current [vagrant@localhost hadoop-hdfs]$ HMaster is able to start if fs.defaultFS property has been commented in core-site.xml NameNode is listening [vagrant@localhost hadoop-hdfs]$ netstat -nato | grep 50070 tcp 0 0 0.0.0.0:50070 0.0.0.0:* LIST EN off (0.00/0/0) tcp 0 0 33.33.33.33:50070 33.33.33.1:57493 ESTA BLISHED off (0.00/0/0) and accessible by navigating to http://33.33.33.33:50070/dfshealth.jsp. Question How to solve makeDirOnFileSystem exception and let HBase connect to HDFS?

    Read the article

  • Styling a result set

    - by aepheus
    Perhaps this is not the proper place to ask this question, if that is the case, please direct me to the correct venue. I'm looking for research, guides, any kind of information pertaining to the structuring and styling of results sets; data which comes back from a search, or when looking at content in a list view. Links would be appreciated, but opinion and commentary are also valued.

    Read the article

  • Youtube API - How to limit results for pagination?

    - by worchyld
    I want to grab a user's uploads (ie: BBC) and limit the output to 10 per page. Whilst I can use the following URL: http://gdata.youtube.com/feeds/api/users/bbc/uploads/?start-index=1&max-results=10 The above works okay. I want to use the query method instead: The Zend Framework docs: http://framework.zend.com/manual/en/zend.gdata.youtube.html State that I can retrieve videos uploaded by a user, but ideally I want to use the query method to limit the results for a pagination. The query method is on the Zend framework docs (same page as before under the title 'Searching for videos by metadata') and is similar to this: [code] $yt = new Zend_Gdata_YouTube(); $query = $yt-newVideoQuery(); $query-setTime('today'); $query-setMaxResults(10); $videoFeed = $yt-getUserUploads( NULL, $query ); // Output print ''; foreach($videoFeed as $video): print '' . $video-title . ''; endforeach; print ''; [/code] The problem is I can't do $query-setUser('bbc'). I tried setAuthor but this returns a totally different result. Ideally, I want to use the query method to grab the results in a paginated fashion. How do I use the $query method to set my limits for pagination? Thanks.

    Read the article

  • Iphone SQLite Databse with german umlauts results in NULL value

    - by Daniel
    Hi guys, I'm quite new to the Iphone development and after search for an answer for 3 hours now, I hope that you guys can give me a hand. My problem is that I have a SQLite Database with german umlauts. Looking at it with a SQLite browser tool shows me that the data is stored with german umlauts, correctly. But selecting fields with german umlauts in it results in a NULL value. I'm already using "stringWithUTF8String", so I don't get the point where the problem is placed. Here is my code: -(void) readSearchFromDatabase { searchFlag = YES; // Setup the database object sqlite3 *database; // Init the SCode Array searchSCodes = [[NSMutableArray alloc] init]; // Open the database from the users filessytem if(sqlite3_open([databasePath UTF8String], &database) == SQLITE_OK) { NSString *wildcard =@"%"; // Setup the SQL Statement and compile it NSString *sql = [NSString stringWithFormat:@"SELECT * FROM scode WHERE ta LIKE '%@%@%@' OR descriptionde LIKE '%@%@%@' OR descriptionen LIKE '%@%@%@'", wildcard, searchBar.text, wildcard, wildcard, searchBar.text, wildcard, wildcard, searchBar.text, wildcard, wildcard, searchBar.text, wildcard]; //Creating a const char SQL Statement especially for SQLite const char *sqlStatement = [sql UTF8String]; sqlite3_stmt *compiledStatement; if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK) { // Loop through the results and add them to the feeds array while(sqlite3_step(compiledStatement) == SQLITE_ROW) { // Read the data from the result row NSString *aTa = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 0)]; NSString *aReport = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 1)]; NSString *aDescriptionDE = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 2)]; NSString *aDescriptionEN = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 3)]; //Results a NULL value NSLog(@"Output: %@", aDescriptionDE); // Create a new SCode object with the data from the database SCode *searchSCode = [[SCode alloc] initWithTa:aTa report:aReport descriptionDE:aDescriptionDE descriptionEN:aDescriptionEN]; // Add the SCode object to the SCodes Array [searchSCodes addObject:searchSCode]; [searchSCode release]; } } // Release the compiled statement from memory sqlite3_finalize(compiledStatement); } sqlite3_close(database); }

    Read the article

  • Adding database results to array

    - by Jason
    Hi all, I am having a mental blank here and cannot for the life of me figure out a solution. My scenario is that I am programming in PHP and MySQL. I have a database table returning the results for a specific orderid. The query can return a maximum of 4 rows per order and a minimum of 1 row. Here is an image of how I want to return the results. I have all the orderdetails (Name, address) ect stored in a table named "orders". I have all the packages for that order stored in a table named "packages". What I need to do is using a loop I need to have access to each specific element of the database results (IE package1, itemstype1, package2, itemtype2) ect I am using a query like this to try and get hold of just the "number of items: $sql = "SELECT * FROM bookings_onetime_packages WHERE orderid = '".$orderid."' ORDER BY packageid DESC"; $total = $db-database_num_rows($db-database_query($sql)); $query = $db-database_query($sql); $noitems = ''; while($info = $db-database_fetch_assoc($query)){ $numberitems = $info['numberofitems']; for($i=0; $i $noitems .= $numberitems[$i]; } } print $noitems; I need to have access to each specific element because I them need to create fill out a pdf template using "fpdf". I hope this makes sense. Any direction would be greatly appreciated.

    Read the article

  • Anomalous results getting color components of some UIColors

    - by hkatz
    I'm trying to extract the rgb components of a UIColor in order to hand-build the pixels in a CGBitmapContext. The following sample code works fine for most of the UIColor constants but, confusingly, not all. To wit: CGColorRef color = [[UIColor yellowColor] CGColor]; const float* rgba = CGColorGetComponents(color); float r = rgba[0]; float g = rgba[1]; float b = rgba[2]; float a = rgba[3]; NSLog( @"r=%f g=%f b=%f a=%f", r, g, b, a); The results for [UIColor yellowColor] above are r=1.000000 g=1.000000 b=0.000000 a=1.000000, as expected. [UIColor redColor] gives r=1.000000 g=0.000000 b=0.000000 a=1.000000, again as expected. Similarly for blueColor and greenColor. However, the results for [UIColor blackColor] and [UIColor whiteColor] seem completely anomalous, and I don't know what I'm doing wrong (if indeed I am). To wit, [UIColor blackColor] gives r=0.000000 g=1.000000 b=0.000000 a=0.000000, which is a tranparent green, and [UIColor whiteColor] gives r=1.000000 g=1.000000 b=0.000000 a=0.000000, which is a transparent yellow. I'd appreciate it if somebody could either: (1) explain what I'm doing wrong (2) replicate my anomalous results and tell me it's not me, or (3) hit me over the head with a big hammer so it stops hurting so much. Howard

    Read the article

  • Merging sql queries to get different results by date

    - by pedalpete
    I am trying to build a 'recent events' feed and can't seem to get either my query correct, or figure out how to possible merge the results from two queries to sort them by date. One table holds games/, and another table holds the actions of these games/. I am trying to get the recent events to show users 1) the actions taken on games that are publicly visible (published) 2) when a new game is created and published. So, my actions table has actionId, gameid, userid, actiontype, lastupdate My games table has gameid, startDate, createdby, published, lastupdate I currently have a query like this (simplified for easy understanding I hope). SELECT actionId, actions.gameid, userid, actiontype, actions.lastupdate FROM actions JOIN ( SELECT games.gameid, startDate, createdby, published, games.lastupdate FROM games WHERE published=1 AND lastupdate>today-2 ) publishedGames on actions.gameid=games.gameid WHERE actions.type IN (0,4,5,6,7) AND actions.lastupdate>games.lastupdate and published=1 OR games.lastupdate>today-2 AND published=1 This query is looking for actions from published games where the action took place after the game was published. That pretty much takes care of the first thing that needs to be shown. However, I also need to get the results of the SELECT games.gameid, startDate, createdby, published, games.lastupdate FROM games WHERE published=1 AND startDate>today-2 so I can include in the actions list, when a new game has been published. When I run the query as I've got it written, I get all the actionids, and their gameids, but I don't get a row which shows the gameid when it was published. I understand that it may be possible that I need to run two seperate queries, and then somehow merge the results afterword with php, but I'm completely lost on where to start with that as well.

    Read the article

  • Linq is returning too many results when joined

    - by KallDrexx
    In my schema I have two database tables. relationships and relationship_memberships. I am attempting to retrieve all the entries from the relationship table that have a specific member in it, thus having to join it with the relationship_memberships table. I have the following method in my business object: public IList<DBMappings.relationships> GetRelationshipsByObjectId(int objId) { var results = from r in _context.Repository<DBMappings.relationships>() join m in _context.Repository<DBMappings.relationship_memberships>() on r.rel_id equals m.rel_id where m.obj_id == objId select r; return results.ToList<DBMappings.relationships>(); } _Context is my generic repository using code based on the code outlined here. The problem is I have 3 records in the relationships table, and 3 records in the memberships table, each membership tied to a different relationship. 2 membership records have an obj_id value of 2 and the other is 3. I am trying to retrieve a list of all relationships related to object #2. When this linq runs, _context.Repository<DBMappings.relationships>() returns the correct 3 records and _context.Repository<DBMappings.relationship_memberships>() returns 3 records. However, when the results.ToList() executes, the resulting list has 2 issues: 1) The resulting list contains 6 records, all of type DBMappings.relationships(). Upon further inspection there are 2 for each real relationship record, both are an exact copy of each other. 2) All relationships are returned, even if m.obj_id == 3, even though objId variable is correctly passed in as 2. Can anyone see what's going on because I've spent 2 days looking at this code and I am unable to understand what is wrong. I have joins in other linq queries that seem to be working great, and my unit tests show that they are still working, so I must be doing something wrong with this. It seems like I need an extra pair of eyes on this one :)

    Read the article

  • Geolocation and jQuery - Can't post results using ajax

    - by etombaugh
    I'm currently working on a project to make a location-aware site. In essence, the user comes to the page, and their location is found using the HTML5 method and then using jQuery, the location is posted to a page which saves the location/address to a codeigniter session, but if they want to update their location, or change to a different location(IE they want to use their work address as the location instead of their present address), theres a jQuery colorbox that displays and lets them type in a custom address. Everything works flawlessly to get the initial location, but when I try and get the updated location saved, I receive the error "Uncaught TypeError: Object [object DOMWindow] has no method 'lat'" which then Google Chrome references as being an error not in jQuery, but in the file for Google Maps API. Any suggestions? jQuery('.inputsubmit').click(function() { //Takes values from user submitted fields and parses them into an address string var street = jQuery('.inputaddress').val(); var city = jQuery('.inputcity').val(); var state = jQuery('.inputstate').val(); var address = street +" "+ city +", " +state; geocoder = new google.maps.Geocoder(); var geocoderresult= geocoder.geocode({'address': address}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { var newlocation = results[0].geometry.location; //Posts coordinates and address string to a CodeIgniter function to update users session information jQuery.post("somepage", {location: newlocation, address: address},function(data) { alert("Data Loaded: " + data); }); } else { alert("Geocoder failed due to: " + status); } }); }); I've tried everything I can think of to get the post to work. All of the code works up till the point, and I've commented out the post line and everything works correctly. This is one of our main website's features, to provide instant and quick results based off of location. Thanks!

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >