Search Results

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

Page 118/556 | < Previous Page | 114 115 116 117 118 119 120 121 122 123 124 125  | Next Page >

  • How to UNION ALL two SELECT statements?

    - by Lisa
    I have 2 tables, one looks like this: TABLE ONE id | Last Name | First Name | Username | Password | Secret Question and another that looks like this: TABLE TWO id | Hobby | Country | I want to combine a Select statement that grabs data from both tables and output the results. The following code: $select = mysql_query(" SELECT * FROM table_one WHERE Username = 'Bob' UNION ALL SELECT * FROM table_two WHERE Hobby = 'Baseball' "); while ($return = mysql_fetch_assoc($select)) { $userName = $return['Username']; $hobby = $return['Hobby']; } echo "$userName likes $hobby"; results in a The used SELECT statements have a different number of columns error, what am I doing wrong?

    Read the article

  • newline in Rackspace Cron Job email

    - by senloe
    I'm running backups against multiple databases hosted at Rackspace. This is working fine. The problem I'm running into is with the results email. I'm using Response.Write to write a message to the web page which is used for logging and is also consumed by the results mail sent out by the job. The problem is I can't seem to get newlines to appear between log messages. The logfile stored on the server is correct, but only the first newline shows up in the email. The mail is in Plain Text format so I tried using "\n" and System.Environment.Newline and neither work. I also tried using <br/> with no luck. Does anybody have any ideas?

    Read the article

  • Controlling when SQL UPDATE is executing on ehcache 'd classes

    - by thomers
    We are using Hibernate and ehcache as 2nd level cache. If I load an entity that is cached (e.g. cache-usage="read-write") and update it, it seems that this immediately results in an SQL UPDATE. (How) Can I influence when this SQL UPDATE happens? hibSession = HibernateUtil.getReadWriteSession(); tx = hibSession.beginTransaction(); User u = (User) hibSession.load(User.class, user_id); u.modify(); hibSession.update(u); tx.commit(); Edit: It seems that setting a CacheMode should have an effect, but each hibSession.update() results in an immediate SQL UPDATE, regardless which CacheMode I set.

    Read the article

  • nodejs, mongodb - How do I operate on data from multiple queries?

    - by Ryan
    Hi all, I'm new to JS in general, but I am trying to query some data from MongoDB. Basically, my first query retrieves information for the session with the specified session id. The second query does a simple geospacial query for documents with a location near the specified location. I'm using the mongodb-native javascript driver. All of these query methods return their results in callbacks, so they're non-blocking. This is the root of my troubles. What I'm needing to do is retrieve the results of the second query, and create an Array of sessionIds of all the returned documents. Then I'm going to pass those to a function later. But, I can't generate this array and use it anywhere outside the callback. Does anyone have any idea how to properly do this? http://dpaste.org/wXiE/

    Read the article

  • MySQL Hibernate sort on 2 columns

    - by sammichy
    I have a table as follows Table item { ID - Primary Key content - String published_date - When the content was published create_date - When this database entry was created } Every hour (or specified time interval) I run a process to update this table with data from different sources (websites). I want to display the results according to the following rules. 1. The entries created each time the process runs should be grouped together. So the entries from the 2nd process run will always be after the entries from the first process run even if the published_date of an entry from the first run is after the published_date of an entry from the 2nd run. 2. Within the grouping by run, the entries by sorted by published_date 3. Another restriction is that I prefer that data from the same source not be grouped together. If I do the sort by create_date, published_date I will end up with data from source a, data from source b etc. I prefer that the data within each hour be mixed up for better presentation If I add a column to this table and store a counter which increments each time the process is run, it is possible to create a query to sort first by counter and then by published_dt. Is there a way to do it without adding a field? I'm using Hibernate over MySQL. e.g. Hour 1 (run 1) 4 rows collected from site a (rows 1-4) 3 rows collected from site b (rows 5-7) hour 2 (run 2) 2 row collected from site a (rows 8-9) 3 rows collected from site b (rows 10-12) ... After each run, new records are added to the database from each website. The create date is the time when the record was created in the database. The published date is part of the content and is read in from the external source. When the results are displayed I would like rows to be grouped together based on the hour they were published in. So rows 1-7 would be displayed before rows 8-12. Within each hourly grouping, I would like to sort the results by published date (timestamp). This is necessary so that the posts from all the sites collected in that hour are not grouped together but rather mixed in with each other.

    Read the article

  • Send 404 when requesting index.php through .htaccess?

    - by Daniel
    I've recently refactored an existing CodeIgniter application to use url segments instead of query strings, and I'm using a rewriterule in htaccess to rewrite stuff to index.php: RewriteRule ^(.*)$ /index.php/$1 [L] My problem right now is that a lot of this website's pages are indexed by google with a link to index.php. Since I made the change to use url segments instead, I don't care about these google results anymore and I want to send a 404 (no need to use 301 Move permanently, there have been enough changes, it'll just have to recrawl everything). To get to the point: How do I redirect requests to /index.php?whatever to a 404 page? I was thinking of rewriting to a non-existent file that would cause apache to send a 404. Would this be an acceptable solution? How would the rewriterule for that look like? edit: Currently, existing google results will just cause the following error: An Error Was Encountered The URI you submitted has disallowed characters.

    Read the article

  • Two parameters in asp.net mvc route

    - by olst
    Hi. This is a modification to a question I've asked before on this forum. My controller action: public ActionResult SearchResults(string searchTerm, int page)... My view: <%= Html.PageLinks((int)ViewData["CurrentPage"], (int)ViewData["TotalPages"], i => Url.Action("SearchResults", new { page = i }))%>... The route entries: routes.MapRoute( null, "SearchResults", new { controller = "Search", action = "SearchResults", page = 1 } // Defaults ); routes.MapRoute( "Search", "SearchResults/Page{page}", new { controller = "Search", action = "SearchResults" }, new { page = @"\d+" } ); My goal is to have paging links for the search results. The problem is that when I click any page in the paging links, it gives me the search results of an empty serach term. How can I pass the search term parameter which is a string in addition to the page number parameter ? What should I put in the routing ?

    Read the article

  • jQuery mobile swipe spamming and animation

    - by halliewuud
    I have say 5 list items with images inside placed 200px from eachother. I am trying to animate these list items to slide horizontally left if one presses a link with the id = #next or if one swipes left. And vice versa for sliding the list items right. Every click or swipe results in a slide animation of 200px on every list item. I ran into a problem where spamming the #next or #prev button would cancel the current animation and start a new one. This results in list items not sliding 200px+200px+200... but something like this 200px+140px+120... This because like I said the animation is cut and therefore the sliding distance will be shorter. Now I solved this for the clicking event by disabling the button before the animation starts and then re'enabling it on the end callbak function. But this problem is remaining for the swipe event. How can I solve this problem for the swipe event?

    Read the article

  • unable to set href inside click event of Jquery

    - by akshatrautela
    Hi I am trying to set href using Jquery inside click event of RadioButtonList but that doesnt work If I take the same code to document.ready event it works fine but not in click event. Please advice. $(document).ready(function() { url = "Results.aspx?latitude=" +latitude + "&Longitude=" + longitude; $("a[href='http://www.google.com/']").attr("href", url); // this works.. } $('.rbl input').click(function() { id = $(this).parent().children("input").val(); url = "Results.aspx?latitude=" + latitude + "&Longitude=" + longitude + "&ServiceCenterProductTypeId=" + id; //alert(url); $("a[href='http://www.google.com/']").attr("href", url); //this doesnt work.... }); });

    Read the article

  • Wordpress parses wp_posts.post_content before rendering?

    - by John
    I noticed that when I call the the_post() or the_content() function from my wordpress template, it automatically parses the database data to replace new lines with <br/>, wraps the text with <p> tags etc...There's probably some kind of "format" function within the_post() or the_content(). I wrote a query to directly get posts from the wp_posts. I then print it out like <?php $results = $wp->get_results($sql) foreach($results as $row) echo $row->post_content; ?> Clearly, this data is not parsed by wordpress' "format" function. What is the proper way to output this content such that it undergoes the same "formatting" functions as the_post() or the_content()?

    Read the article

  • NVIDIA graphics driver in Ubuntu 12.04

    - by user924501
    So my overall goal is that I want to be able to code with CUDA enabled applications. However, upon many days of searching, using installation walkthroughs, and reinstalling countless times after driver failure... I'm now here as a last resort. I cannot get Ubuntu 12.04 LTS to install the NVIDIA 295.59 driver for my GeForce GT 540M NVIDIA graphics card. My main system specs is as follows... (I believe having the Intel processor may be the problem) DELL Laptop XPS L502X Intel® Core™ i7-2620M CPU @ 2.70GHz × 4 Intel Integrated Graphics 64 bit NVIDIA GeForce GT 540M Ubuntu 12.04 LTS All other specs are irrelevant unless I forgot something? Methods Tried: aptitude install nvidia-current (all packages) Results: Nothing really happened. Nothing in the additional drivers menu appeared, nor was the NVIDIA X Server settings application allowing access because it thought there was no NVIDIA X Server installed. Downloaded driver from nvidia.com. Set nomodeset in the grub boot menu through /boot/grub/grub.cfg Went to console and turned off lightdm. Installed the driver, but it said the pre-install failed? (mean anything?) Started up lightdm again. Results: NVIDIA X Server settings still didn't notice it. Even tried to do nvidia-xconfig multiple times. I also went into the config file to make sure the driver setting said "nvidia". aptitude install nvidia-173 (all packages) Results: Couldn't find the xorg-video-abi-10 virtual package. It was nowhere to be found and the ubuntu forums everywhere had no answers. Lots of people were having this problem. This is easily done in windows, simply download the driver and debug in visual studio with no problems at all. I'd like clear step-by-step instructions on how I should go about this. I'm relatively new to linux but I can find my way around pretty well so you aren't talking to a straight-up beginner. Also, if you think another thread may have the answer please post because I was having a hard time looking for my specific type of problem. TL;DR I want to have access to my GPU so I can code with CUDA while in Ubuntu 12.04 on my 64 bit laptop that also has Intel integrated graphics on the processor. Solution: sudo apt-add-repository ppa:ubuntu-x-swat/x-updates && sudo apt-get update && sudo apt-get upgrade && sudo apt-get install nvidia-current

    Read the article

  • How to display how many times each records in a table used by other table

    - by Fredy
    I have a problem with my query, below are two tables that tbl_tag and tbl_tag_usedby. I want to show how much of each record in tbl_tag used by record in tbl_tag_usedby. Here is a query that I use: SELECT t.*, COUNT(u.tagid) AS totale FROM tbl_tag t LEFT JOIN tbl_tag_usedby u ON u.tagid = t.id AND t.status =1 GROUP BY u.tagid and the results are as below: In this case the record id from 2 to 6 do not appear in the query results, I want record id from 2 to 6 are also shown and on the field "totale" its value is 0. Can anyone help me?

    Read the article

  • How to handle feedback from background threads if the user uses the back button?

    - by Janusz
    I have the following problem: I have an Activity where a user can start a web search showing a new activity to show a progress bar until the results are shown. Now the user can either wait for the results or maybe think about the search parameters, hit the back button and triggering a new search. The search is running in an Async Task and therefor still running if the user hits back. At the moment the thread finishes it calls some methods on the old activity causing the activity to show a dialog. This causes the system to crash because the dialog tries to show itself with a reference to an activity that is not longer present on the screen. How can I achieve a dialog that is only shown if the activity is still active?

    Read the article

  • Rails Active Record find(:all, :order => ) issue.

    - by CodingWithoutComments
    I seem to be unable to use :order_by for more than one column at a time. For example, I have a "Show" model with date and attending columns. If I run the following code: @shows = Show.find(:all, :order => "date") I get the following results: [#<Show id: 7, date: "2009-04-18", attending: 2>, #<Show id: 1, date: "2009-04-18", attending: 78>, #<Show id: 2, date: "2009-04-19", attending: 91>, #<Show id: 3, date: "2009-04-20", attending: 16>, #<Show id: 4, date: "2009-04-21", attending: 136>] If I run the following code: @shows = Show.find(:all, :order => "attending DESC") [#<Show id: 4, date: "2009-04-21", attending: 136>, #<Show id: 2, date: "2009-04-19", attending: 91>, #<Show id: 1, date: "2009-04-18", attending: 78>, #<Show id: 3, date: "2009-04-20", attending: 16>, #<Show id: 7, date: "2009-04-18", attending: 2>] But, if I run: @shows = Show.find(:all, :order => "date, attending DESC") OR @shows = Show.find(:all, :order => "date, attending ASC") OR @shows = Show.find(:all, :order => "date ASC, attending DESC") I get the same results as only sorting by date: [#<Show id: 7, date: "2009-04-18", attending: 2>, #<Show id: 1, date: "2009-04-18", attending: 78>, #<Show id: 2, date: "2009-04-19", attending: 91>, #<Show id: 3, date: "2009-04-20", attending: 16>, #<Show id: 4, date: "2009-04-21", attending: 136>] Where as, I want to get these results: [#<Show id: 1, date: "2009-04-18", attending: 78>, #<Show id: 7, date: "2009-04-18", attending: 2>, #<Show id: 2, date: "2009-04-19", attending: 91>, #<Show id: 3, date: "2009-04-20", attending: 16>, #<Show id: 4, date: "2009-04-21", attending: 136>] This is the query being generated from the logs: [4;35;1mUser Load (0.6ms)[0m [0mSELECT * FROM "users" WHERE ("users"."id" = 1) LIMIT 1[0m [4;36;1mShow Load (3.0ms)[0m [0;1mSELECT * FROM "shows" ORDER BY date ASC, attending DESC[0m [4;35;1mUser Load (0.6ms)[0m [0mSELECT * FROM "users" WHERE ("users"."id" = 1) [0m Finally, here is my model: create_table "shows", :force => true do |t| t.string "headliner" t.string "openers" t.string "venue" t.date "date" t.text "description" t.datetime "created_at" t.datetime "updated_at" t.decimal "price" t.time "showtime" t.integer "attending", :default => 0 t.string "time" end What am I missing? What am I doing wrong? UPDATE: Thanks for all your help, but it seems that all of you were stumped as much as I was. What solved the problem was actually switching databases. I switched from the default sqlite3 to mysql.

    Read the article

  • How to add indexes to MySQL tables?

    - by Michael
    I've got a very large MySQL table with about 150,000 rows of data. Currently, when I try and run SELECT * FROM table WHERE id = '1'; the code runs fine as the ID field is the primary index. However, recently for a development in the project, I have to search the database by another field. For example SELECT * FROM table WHERE product_id = '1'; This field was not previously indexed, however, I've added it as an index but when I try to run the above query, the results is very slow. An EXPLAIN query reveals that there is no index for the product_id field when I've already added one and as a result the query takes any where from 20 minutes to 30 minutes to return a single row. EDIT: My full EXPLAIN results are: | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+------+----------------------+------+---------+------+------+------------------+ | 1 | SIMPLE | table | ALL | NULL | NULL | NULL | NULL | 157211 | Using where | +----+-------------+-------+------+----------------------+------+---------+------+------+------------------+

    Read the article

  • Question about regex in linux commands.

    - by smwikipedia
    I ran the following command at linux bash: apt-cache search hex.*(view|edit) My intention was to find any software packages whose name/description contains the pattern 'hex.*(view|edit)'. But among the results I got this: kipi-plugins - image manipulation/handling plugins for KIPI aware programs How could this be in the results list? I didn't see any matching string in this result. Is this a bug of the apt-cache search command? Or do I mis-understand how the regex is used by this command? Many thanks.

    Read the article

  • Forcing LINQ to SQL to make one single call for all child rows

    - by zaph0d
    Let say I have a method (example taken from another post): public IQueryable<CityBlock> GetCityBlocks(){ var results = from o in db.city_blocks let buildings = GetBuildingsOnBlock(o.block_id) //returns Iqueryable select new CityBlock { BuildingsOnBlock = buildings, BlockOwner = o.block_owner }; return results; } In the calling method I add Skip() and Take() methods plus some filtering and then do a ToList(). The trouble is that I am getting dozens of database calls - one for all the city blocks and then a separate one for each building. Is there a way that I can refactor this code to just make two calls: one for the city blocks and one for all the buildings

    Read the article

  • Insert line in xml doc

    - by phenevo
    Hi, I wanna insert in second line : <?mso-application progid="Excel.Sheet"?> but I'm started to think that it is impossible. Here is my base code: XmlDocument doc = new XmlDocument(); XmlReader reader = cmd.ExecuteXmlReader(); doc.LoadXml("<results></results>"); XmlNode newNode = doc.ReadNode(reader); while (newNode != null) { doc.DocumentElement.AppendChild(newNode); newNode = doc.ReadNode(reader); }

    Read the article

  • Win32_PageFileUsage WMI call returning 0 for CurrentUsage

    - by Ryan Duffield
    I am querying for the current page file usage on Windows-based systems. This is meant to run on the .NET Framework, version 2.0 SP1 and has been tested (and works!) on Windows Vista, Windows 7, Windows Server 2003 R2 and Windows Server 2008. On Windows Server 2003 SP2 (original release, not R2) it appears to return 0: using (var query = new ManagementObjectSearcher("SELECT CurrentUsage FROM Win32_PageFileUsage")) { foreach (ManagementBaseObject obj in query.Get()) { uint used = (uint)obj.GetPropertyValue("CurrentUsage"); return used; } } This is simply returning the results from the first row returned for the WMI call. Even when a page file is being used, it returns 0. What causes the result to be 0 when it should be returning a larger value? It may be something specific to the machine in question, and could have nothing to do with the operating system version. I've also tried this with and without elevated privileges with the same results.

    Read the article

  • Setting new class variables inside a module

    - by Sean McCleary
    I have a plugin I have been working on that adds publishing to ActiveRecord classes. I extend my classes with my publisher like so: class Note < ActiveRecord::Base # ... publishable :related_attributes => [:taggings] end My publisher is structured like: module Publisher def self.included(base) base.send(:extend, ClassMethods) @@publishing_options = [] # does not seem to be available end module ClassMethods def publishable options={} include InstanceMethods @@publishing_options = options # does not work as class_variable_set is a private method # self.class_variable_set(:@@publishing_options, options) # results in: uninitialized class variable @@publishing_options in Publisher::ClassMethods puts "@@publishing_options: #{@@publishing_options.inspect}" # ... end # ... end module InstanceMethods # results in: uninitialized class variable @@publishing_options in Publisher::InstanceMethods def related_attributes @@publishing_options[:related_attributes] end # ... end end Any ideas on how to pass options to publishable and have them available as a class variable?

    Read the article

  • Click event not registering on second page.

    - by Cptcecil
    I'm using tablesorter and tablesorter.pager. Here is my code. $(document).ready(function() { $("#peopletable") .tablesorter({ widthFixed: true, widgets: ['zebra'] }) .tablesorterFilter({ filterContainer: $("#people-filter-box"), filterClearContainer: $("#people-filter-clear-button"), filterColumns: [1, 2, 3], filterCaseSensitive: false }) .tablesorterPager({ container: $("#peoplepager") }); $("#peopletable tr.data").click(function() { var personid = $(this).attr('id'); $.ajax({ type: "POST", url: "/Search/GetDocumentsByPerson", data: { "id": personid }, datatype: "json", success: function(data) { var results = eval(data); $("#documentstable > tbody tr").remove(); $.each(results, function(key, item) { $("#documentstable > tbody:last").append(html); }); $("#documentstable").trigger("update"); } }); }); }); Everything works great except when I click on the next page my button click event doesn't fire. Is this a known issue with jquery tablesorter?

    Read the article

  • How to make HTML5 speech recognition not ask permission every time

    - by user2081044
    I have created a script that requires my microphone. It uses the HTML5 speech recognition API. Chrome asks permission every time I want to perform a speech recognition test. Javascript (partial) code that I am using: var recognition = new webkitSpeechRecognition(); recognition.continuous = true; recognition.interimResults = true; recognition.onresult = function(event) { console.log(event.results[0][0].transcript); if(event.results[0][0].transcript === 'print') { console.log(''); } }; recognition.start(); I have tried to add it into the list of exceptions in either Chrome and Flash player, but it still asks for permission. Printscreen: That message pops up everytime I click the button. Is there any way to disable Chrome for asking permission?

    Read the article

  • ajax request via jquery for a url that redirects

    - by user177883
    I m trying to access a data after invoking a URL which redirects the output to another page with query strings. ie: $.ajax({ url: 'http://foo.com/results/bar.aspx?fooid = 123&more=1', success: function(data) { alert('Load was performed.'+data); } }); Reponse results empty. This URL is a redirect to another page with query string, I already have a page that parses the query string and write the output to a page. But response is blank. How can i get this data?

    Read the article

  • what mysql table structure is better

    - by Sergey
    I have very complicated search algorithm on my site, so i decided to make a table with cache or maybe all possible results. I wanna ask what structure would be better, or maybe not the one of them? (mySQL) 1) word VARCHAR, results TEXT or BLOB where i'll store ids of found objects (for example 6 chars for each id) 2) word VARCHAR, result INT, but words are not unique now i think i'll have about 200 000 rows in 1) with 1000-10000 ids each row or 200 000 000+ rows in 2) First way takes more storage memory but i think it would be much faster to find 1 unique row among 200 000, than 1000 rows among 200 mln non unique rows i think about index on word column and no sphinx. So that do YOU think? p.s. as always, sorry for my english if it's not very good.

    Read the article

  • Java: empty ArrayLists in a foor loop

    - by Patrick
    hi, I'm reusing the same ArrayList in a for loop, and I use for loop results = new ArrayList<Integer>(); experts = new ArrayList<Integer>(); output = new ArrayList<String>(); .... to create new ones. I guess this is wrong, because I'm allocating new memory. Is this correct ? If yes, how can I empty them ? Added: another example I'm creating new variables each time I call this method. Is this good practice ? I mean to create new precision, relevantFound.. etc ? Or should I declare them in my class, outside the method to not allocate more and more memory ? public static void computeMAP(ArrayList results, ArrayList experts) { //compute MAP double precision = 0; int relevantFound = 0; double sumprecision = 0; thanks

    Read the article

< Previous Page | 114 115 116 117 118 119 120 121 122 123 124 125  | Next Page >