Search Results

Search found 481 results on 20 pages for 'weather'.

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

  • Random Page Cost and Planning

    - by Dave Jarvis
    A query (see below) that extracts climate data from weather stations within a given radius of a city using the dates for which those weather stations actually have data. The query uses the table's only index, rather effectively: CREATE UNIQUE INDEX measurement_001_stc_idx ON climate.measurement_001 USING btree (station_id, taken, category_id); Reducing the server's configuration value for random_page_cost from 2.0 to 1.1 had a massive performance improvement for the given range (nearly an order of magnitude) because it suggested to PostgreSQL that it should use the index. While the results now return in 5 seconds (down from ~85 seconds), problematic lines remain. Bumping the query's end date by a single year causes a full table scan: sc.taken_start >= '1900-01-01'::date AND sc.taken_end <= '1997-12-31'::date AND How do I persuade PostgreSQL to use the indexes regardless of years between the two dates? (A full table scan against 43 million rows is probably not the best plan.) Find the EXPLAIN ANALYSE results below the query. Thank you! Query SELECT extract(YEAR FROM m.taken) AS year, avg(m.amount) AS amount FROM climate.city c, climate.station s, climate.station_category sc, climate.measurement m WHERE c.id = 5182 AND earth_distance( ll_to_earth(c.latitude_decimal,c.longitude_decimal), ll_to_earth(s.latitude_decimal,s.longitude_decimal)) / 1000 <= 30 AND s.elevation BETWEEN 0 AND 3000 AND s.applicable = TRUE AND sc.station_id = s.id AND sc.category_id = 1 AND sc.taken_start >= '1900-01-01'::date AND sc.taken_end <= '1996-12-31'::date AND m.station_id = s.id AND m.taken BETWEEN sc.taken_start AND sc.taken_end AND m.category_id = sc.category_id GROUP BY extract(YEAR FROM m.taken) ORDER BY extract(YEAR FROM m.taken) 1900 to 1996: Index "Sort (cost=1348597.71..1348598.21 rows=200 width=12) (actual time=2268.929..2268.935 rows=92 loops=1)" " Sort Key: (date_part('year'::text, (m.taken)::timestamp without time zone))" " Sort Method: quicksort Memory: 32kB" " -> HashAggregate (cost=1348586.56..1348590.06 rows=200 width=12) (actual time=2268.829..2268.886 rows=92 loops=1)" " -> Nested Loop (cost=0.00..1344864.01 rows=744510 width=12) (actual time=0.807..2084.206 rows=134893 loops=1)" " Join Filter: ((m.taken >= sc.taken_start) AND (m.taken <= sc.taken_end) AND (sc.station_id = m.station_id))" " -> Nested Loop (cost=0.00..12755.07 rows=1220 width=18) (actual time=0.502..521.937 rows=23 loops=1)" " Join Filter: ((sec_to_gc(cube_distance((ll_to_earth((c.latitude_decimal)::double precision, (c.longitude_decimal)::double precision))::cube, (ll_to_earth((s.latitude_decimal)::double precision, (s.longitude_decimal)::double precision))::cube)) / 1000::double precision) <= 30::double precision)" " -> Index Scan using city_pkey1 on city c (cost=0.00..2.47 rows=1 width=16) (actual time=0.014..0.015 rows=1 loops=1)" " Index Cond: (id = 5182)" " -> Nested Loop (cost=0.00..9907.73 rows=3659 width=34) (actual time=0.014..28.937 rows=3458 loops=1)" " -> Seq Scan on station_category sc (cost=0.00..970.20 rows=3659 width=14) (actual time=0.008..10.947 rows=3458 loops=1)" " Filter: ((taken_start >= '1900-01-01'::date) AND (taken_end <= '1996-12-31'::date) AND (category_id = 1))" " -> Index Scan using station_pkey1 on station s (cost=0.00..2.43 rows=1 width=20) (actual time=0.004..0.004 rows=1 loops=3458)" " Index Cond: (s.id = sc.station_id)" " Filter: (s.applicable AND (s.elevation >= 0) AND (s.elevation <= 3000))" " -> Append (cost=0.00..1072.27 rows=947 width=18) (actual time=6.996..63.199 rows=5865 loops=23)" " -> Seq Scan on measurement m (cost=0.00..25.00 rows=6 width=22) (actual time=0.000..0.000 rows=0 loops=23)" " Filter: (m.category_id = 1)" " -> Bitmap Heap Scan on measurement_001 m (cost=20.79..1047.27 rows=941 width=18) (actual time=6.995..62.390 rows=5865 loops=23)" " Recheck Cond: ((m.station_id = sc.station_id) AND (m.taken >= sc.taken_start) AND (m.taken <= sc.taken_end) AND (m.category_id = 1))" " -> Bitmap Index Scan on measurement_001_stc_idx (cost=0.00..20.55 rows=941 width=0) (actual time=5.775..5.775 rows=5865 loops=23)" " Index Cond: ((m.station_id = sc.station_id) AND (m.taken >= sc.taken_start) AND (m.taken <= sc.taken_end) AND (m.category_id = 1))" "Total runtime: 2269.264 ms" 1900 to 1997: Full Table Scan "Sort (cost=1370192.26..1370192.76 rows=200 width=12) (actual time=86165.797..86165.809 rows=94 loops=1)" " Sort Key: (date_part('year'::text, (m.taken)::timestamp without time zone))" " Sort Method: quicksort Memory: 32kB" " -> HashAggregate (cost=1370181.12..1370184.62 rows=200 width=12) (actual time=86165.654..86165.736 rows=94 loops=1)" " -> Hash Join (cost=4293.60..1366355.81 rows=765061 width=12) (actual time=534.786..85920.007 rows=139721 loops=1)" " Hash Cond: (m.station_id = sc.station_id)" " Join Filter: ((m.taken >= sc.taken_start) AND (m.taken <= sc.taken_end))" " -> Append (cost=0.00..867005.80 rows=43670150 width=18) (actual time=0.009..79202.329 rows=43670079 loops=1)" " -> Seq Scan on measurement m (cost=0.00..25.00 rows=6 width=22) (actual time=0.001..0.001 rows=0 loops=1)" " Filter: (category_id = 1)" " -> Seq Scan on measurement_001 m (cost=0.00..866980.80 rows=43670144 width=18) (actual time=0.008..73312.008 rows=43670079 loops=1)" " Filter: (category_id = 1)" " -> Hash (cost=4277.93..4277.93 rows=1253 width=18) (actual time=534.704..534.704 rows=25 loops=1)" " -> Nested Loop (cost=847.87..4277.93 rows=1253 width=18) (actual time=415.837..534.682 rows=25 loops=1)" " Join Filter: ((sec_to_gc(cube_distance((ll_to_earth((c.latitude_decimal)::double precision, (c.longitude_decimal)::double precision))::cube, (ll_to_earth((s.latitude_decimal)::double precision, (s.longitude_decimal)::double precision))::cube)) / 1000::double precision) <= 30::double precision)" " -> Index Scan using city_pkey1 on city c (cost=0.00..2.47 rows=1 width=16) (actual time=0.012..0.014 rows=1 loops=1)" " Index Cond: (id = 5182)" " -> Hash Join (cost=847.87..1352.07 rows=3760 width=34) (actual time=6.427..35.107 rows=3552 loops=1)" " Hash Cond: (s.id = sc.station_id)" " -> Seq Scan on station s (cost=0.00..367.25 rows=7948 width=20) (actual time=0.004..23.529 rows=7949 loops=1)" " Filter: (applicable AND (elevation >= 0) AND (elevation <= 3000))" " -> Hash (cost=800.87..800.87 rows=3760 width=14) (actual time=6.416..6.416 rows=3552 loops=1)" " -> Bitmap Heap Scan on station_category sc (cost=430.29..800.87 rows=3760 width=14) (actual time=2.316..5.353 rows=3552 loops=1)" " Recheck Cond: (category_id = 1)" " Filter: ((taken_start >= '1900-01-01'::date) AND (taken_end <= '1997-12-31'::date))" " -> Bitmap Index Scan on station_category_station_category_idx (cost=0.00..429.35 rows=6376 width=0) (actual time=2.268..2.268 rows=6339 loops=1)" " Index Cond: (category_id = 1)" "Total runtime: 86165.936 ms"

    Read the article

  • click feature in Qt

    - by Solitaire
    Hi, I just want to clarify, weather the feature is present or not in Qt. The scenario is like this, I have a list view with items, I want to place the icon to the listview when the item is selected. The selection I mean is, first time when I click item should be selected, next time if I click the same item then it should be selected. Please note It is not the double click. So is there any feature which handles this feature by default, any property or flag which I need to set to listview to behave like this or manual implementation Is required for this.

    Read the article

  • Calculating string sizes on iPhone on a background thread

    - by jbrennan
    I've got some somewhat hefty string size calculations happening in my app (each one takes close to 500ms, and happens when the user scrolls to a new "page" in my app (like the Weather app). The delay only happens once per page, as the calculation only needs to be run once (and can even be cached for subsequent launches with the same data). Anyway, I still like to not block the UI for this type of work, as to me it screams using threads, but I know UIKit is not meant to be used from other threads. (I know NSString is not part of UIKit, but the string sizing methods are part of the UIKitAdditions...) So how should I go about doing this? What's the best way to not block the UI and do so safely?

    Read the article

  • database design in google app engine

    - by iamgopal
    hi , i am designing a simple project based to do list. the idea is to define tasks under project ( no workflow - just "task is completed" or not is required. ) in a hirarchial way. i.e. each task has multiple task and that task may have other multiple task. a project can be said to be completed if all task under that project are completed. , i tought of using refrenceproeperty to create hirarchy , but could not figure out easy way ( which do not take more than 30 seconds to find all the children of a project and check weather it is completed or not ) . to detect if project is complete or not. how to design database for such job ? and also , if i need to copy the project in order to define another project , how to copy hierarchical data ?

    Read the article

  • The finest way to store the HardCore Data i android

    - by david
    Hi All! I am working on an application where I have a long listing of different states approximately 20 states and each state consisting of several zones in addition to the weather forcast of each zone eventually. Now the thing is that I have already created the Listing of hardcore data in a list view of all the states. Again I need to add the hardcore data of several zones for each state(min 4 to 5 zones/ state). So , now I am wondering that whether I have to create the separate classes with hardcore names of all the zones in each state or is there any easy way out for doing the same. It would be great if anyone having the idea can tell me. Thanks, david

    Read the article

  • Good "Modelling & Simulation" book recommendations for programmers?

    - by Harry
    I'm a programmer, and have completely forgotten all the advanced engineering Math I studied ~20 years ago at school. I now have an urgent need to learn about Modelling and Simulation. Though the present context is Disease Modelling, I'm not sure if there's such a thing as 'general' modelling and simulation... with concepts / techniques / algorithms that could be used in just about any domain (and not just limited to biology, finance, trade, economic, weather, etc.) Would you have any recommendations that are easy to read by a semi-Math-literate programmer? Basically, I cannot afford to drown myself in too much Math and theory behind M & S, hence this post. Tia...

    Read the article

  • Is calling Process.Refresh() required for Process.HasFinished

    - by Rekreativc
    Hello I am interested if calling Process.Refresh() is mandatory when waiting for the process to terminate by checking Process.HasFinished property? I have a piece of code that works fine without the Process.Refresh() call, however I am curious weather this is a coincidence? I can see that a msdn example has the Process.Refresh() call... If its not necessary, and Process.HasExited is the only property I need, are there any advantages to making the call to Process.Refresh() ? If not, is there a reason it is in the msdn example? Thank you for your answers.

    Read the article

  • How to send a list of object from my MainPage.xaml to another page

    - by LivingThing
    When navigating to another page how can i make my list of object available to another page. for example in my mainpage.xaml var data2 = from query in document.Descendants("weather") select new Forecast { date = (string)query.Element("date"), tempMaxC = (string)query.Element("tempMaxC"), tempMinC = (string)query.Element("tempMinC"), weatherIconUrl = (string)query.Element("weatherIconUrl"), }; forecasts = data2.ToList<Forecast>(); .... NavigationService.Navigate(new Uri("/WeatherInfoPage.xaml", UriKind.Relative)); and then in my other class, i want to make it available so that i can use it like this private void AddPageItem(List<Forecast> forecasts) { .. }

    Read the article

  • Mac dashboard widgets not loading external images

    - by andrhamm
    I set out to make a quick Mac OS X dashboard widget. I read the documentation and was pleased to find out they use simple HTML, JS, and CSS. I created my widget and it works when I open the .html file in Firefox, but it does not work when I install the widget to the dashboard. The widget is simple: it displays the most recent image from a weather web cam stream. The image URLs look like this: http://webcam.com/stream.jpg?1274213999617. The timestamp is appended to the URL and the server automatically responds with the latest image for that time. I did not write the server script. The widget appears to be loading correctly, but the web cam image will not load. Notice the blue question mark in the upper left. The image should appear over the square background image. Is there any special procedure for loading external images into a widget?

    Read the article

  • php, mySQL - how to create a table?

    - by user296516
    Hi guys, I have written a code that should check weather there is a table called imei.$addimei and, if not, create it... $userdatabase = mysqli_connect('localhost', 'root', 'marina', 'imei'); ... $result = mysqli_query($userdatabase, "SELECT * FROM imei".$addimei."" ); if ( !$result ) { echo('creating table...'); /// if no such table, make one! mysql_query ( $userdatabase, 'CREATE TABLE imei'.$addimei.'( ID int NOT NULL AUTO_INCREMENT, PRIMARY KEY(ID), EVENT varchar(15), TIME varchar(25), FLD1 varchar(35), FLD2 varchar(35), IP varchar(25), )' ); } Yet the CREATE TABLE somehow doesn't seem to work. Warning: mysql_query() expects parameter 1 to be string, object given in C:\xampp\xampp\htdocs\mobi\mainmenu.php on line 564 Any idea's what wrong? Thanks!

    Read the article

  • Problem with Full text Searching

    - by devendra
    I am searching in resumes weather the word is exist or not i am using the below query Case1: select top(10) c_resume_text from sntbl_candidates where contains(c_resume_text,'"a/dm"') in the above example only it is not working properly .It showing resumes even though there is no text like that. In Messages i am getting the following message. Informational: The full-text search condition contained noise word(s). if i try with Case 2: select top(10) c_resume_text from sntbl_candidates where contains(c_resume_text,'"a/d') i am getting proper results in case 2 can any one suggest me what to do. Thanks

    Read the article

  • Wunderground and UTC Offset

    - by Brandon
    I am consuming the international weather forecasts via Wunderground's XML API: http://wiki.wunderground.com/index.php/API_-_XML Looking at an output for Kabul, Afghanistan for instance: http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query=OAKB I notice that there is no UTC offset. The closest that I can see is this: <tz_short>AFT</tz_short> Which identifies the current TimeZone is AFT. The problem I see is that there is no universally accepted time zone abbreviations, so I cannot take these abbreviations and look up and offset from C#'s TimeZoneInfo objects. Is there a listing of Wunderground's Time Zones abbreviations/names/offsets so I can map their Time Zones to the TimeZoneInfo objects, or is there a better way to get this information? I will need to use the TimeZoneInfo so I can calculate daylight savings time for different locations internationally.

    Read the article

  • User not being saved, SharedPreferences

    - by Lars
    Hi i have a inlogscreen (inlogdialog.xml), which includes 2 EditText (username, passwd) and i have a CheckBox (saveuser) with which the user can decide weather to save the username or not. On the mainform (main.xml) i have a listner for these 3 values: private class OnReadyListener implements MyCustomForm.ReadyListener { public void ready(String user, String pass, boolean save) { username = user; password = pass; } } Now i first want to save the username through SharedPreferences but it doesn`t get saved, can someone help me please? If i check with system.out.println, the username is present in String username. SharedPreferenes code in main.xml: public static final String USERNM = ""; private SharedPreferences mPrefs; ....... @Override protected void onPause() { Editor e = mPrefs.edit(); e.putString(USERNM, username); <---- e.commit(); Toast.makeText(this, "Items saved.", Toast.LENGTH_SHORT).show(); super.onPause(); }

    Read the article

  • What application domains are CPU bound and will tend to benefit from multi-core technologies?

    - by Glomek
    I hear a lot of people talking about the revolution that is coming in programming due to multi-core processors and parallelism, but I can't shake the feeling that for most of us, CPU cycles aren't the bottleneck. Pretty much all of my programs have been I/O bound in one way or another (database, filesystem, network, user interaction, etc.) for a very long time. Now I can think of a few areas where CPU cycles are a limiting factor, like code breaking, graphics, sound, some forms of simulation (weather, physics, etc.), and some forms of mathematical research, but they all seem like fairly specialized application domains. My general impression is that most programs are still I/O bound and that for most of our industry CPUs have been plenty fast for quite a while now. Am I off my rocker? What other application domains are CPU bound today? Do any of them include a large portion of the programming population? In essence, I'm wondering whether the multi-core CPUs will impact very many of us, and if so, how?

    Read the article

  • iOS CollectionView with horizontal paging instead of vertical scrolling

    - by Nico Griffioen
    I'm working on a project for a client. It's an iPad pdf reader. The client wants a collection view, but instead of scrolling vertically, he wants it to use a page control. It's pretty hard to explain, but what I basically want is all the PDFs on the device in a grid, like on the iBooks app. When that grid overflows, I want to use a page control to display the extra elements on a second page (like in the weather app). My thoughts on this were: - Create a page control with one page. - On that page, create a UICollectionView. - If the number of elements is greater than 9 add a page to the page control and add another UICollectionView, until there are enough pages to display all elements. However, this seems horribly inefficient, so my question is if there's a better way to do this.

    Read the article

  • Get a font filename based on Font Name and Style (Bold/Italic)

    - by Brad
    This has been driving me crazy all day. I need to get a font filename (eg. Arial.ttf) based off of it's name (Arial in this case). The problem is, I am only supplied with the font name (Arial) and weather it's bold, italic or both. Using those pieces of information, I need to find the font file so I can use it for rendering. Some more examples: Calibri, Bold would resolve to calibrib.ttf Calibri, Italic would resolve to calibrii.ttf Any ideas on how I could achieve this in C++ (Win32)

    Read the article

  • What to do when you are a programmer and have a cold?

    - by Zak
    If you have a cold that isn't too bad, does it make sense to still go into the office and get some coding done? Assume a private office, no meetings for the day, and you have some documentation and coding tasks that need to get done. Also assume that you operate on a PTO system, where all days off are "vacation" or PTO. To clarify, should one just not code at all when under the weather? That's what I'm getting at. Will you just kick yourself in your own rear when you go back to deal with code you wrote when you are sick? What is the error defect rate of sick vs non-sick programming hours?

    Read the article

  • HTTPS-Compliant Sharepoint Web Parts

    - by bporter
    We are planning to create a new sub-site within our company's intranet site. The intranet is built on SharePoint 2007. My question is this: Suppose I want to add a 3rd-party weather web part to the home page of my new intranet site. Since the new site uses HTTPS, do I need to make sure to find an HTTPS-compliant web part? If I use a standard web part, will users get a "This page contains both secure and non-secure items" error message when they load the page? Thanks in advance!

    Read the article

  • Can I set a style for the content of an iframe from the main page?

    - by Joel Coehoorn
    We have a page the embeds a Google Calendar in an iframe. Recently, a warning box div began appearing on the calendar that looks like this: <div id="warningBox" style="color:#aa0000;">Events from one or more calendars could not be shown here because you do not have the permission to view them.</div> Obviously the best solution here is to find the private events and remove them, but so far the search for those events has proved fruitless. This calendar is an aggregate of several calendars, including a few we don't control (ie weather). We're still looking, but in the meantime, I would like to try to hide that div. I know that iframes enforce the separation between the pages, such that the child page is pretty much a law unto itself. But surely there must be some way to set a style on an element inside the frame?

    Read the article

  • I'm looking for Sidebar Menu Library for iOS

    - by Swordfish
    I'm looking for sidebar menu library similar to facebook. But sliding direction is opposite, not sliding left and right. What I need is up/down sliding way. I found many great soltutions for sidebar menu. But these things are usually that sliding directions is not what I need. These way is similar to taskbar of 6.0 ios Version. My app is for iPad, So, I want to use the bottom side of the screen. Weather + use this way. If anyone knows the solution to solve this, Please let me know it.

    Read the article

  • NotificationCenter Widget Failed To Use CoreLocation

    - by James Ye
    I'm writing a notification center widget, and it had to use location information. In normal apps I use CoreLocation and it works fine. But in my widget, I tried to locationServicesEnabled but it didn't go to the callback functions, and the authorizationStatus is always kCLAuthorizationStatusNotDetermined, and the authorize setting didn't show up in Setting - location service. I already set the delegate to the class. The system's Yahoo weather widget can auto locating and it uses CoreLocation too, so the widget do have ability to use location service. Why CoreLocation doesn't work on my widget?

    Read the article

  • Android: implementing sliding cards in widget

    - by DroidIn.net
    I have a widget that periodically updates itself (hourly) to display top result of search query. I would like to extend it so it captures several top results and then loops through these. The best example would be Genie News and Weather widget for which I was unable to find a source code. QUESTIONS: What would be a good way to implement the animation? I'm thinking ViewAnimator + timer, but is there maybe a better way, say FrameLayout + alerts? I'm already using AlertManager to periodically pull search results for the widget How bad such arraignment would affect phone's battery life?

    Read the article

  • PHP Inotify Non-blocking way

    - by demic0de
    I am reading a file in linux which is a log file that keeps on updating weather the file has changed and output it to the webpage. i do it using php inotify but my problem is that it is blocking. How can i make php inotify non-blocking so i can do other stuff while it is monitoring the text file?. <?php $fd = inotify_init(); $watch_descriptor = inotify_add_watch($fd, '/tmp/temp.txt', IN_MODIFY); touch('/tmp/temp.txt'); $events = inotify_read($fd); $contents = file_get_contents('/tmp/temp.txt'); echo $contents; inotify_rm_watch($fd, $watch_descriptor); fclose($fd) ?> Or can i do this in java?..Thanks.

    Read the article

  • login with users, groups and permissions

    - by Dan Bemowski
    OK, I have a set of tables that I want to use for my user logins. I am guessing that I need a separate model for each table in the database. My tables are as follows: Users - user information such as first and last name, groups_id, status, etc... groups - defines the user groups with id, name, description permissions - defines a list of permissions that a group can have permission_assignments - groups_id and permissions_id. many to many relationship table I am not sure how to go about populating an array that would contain the list of permissions that a user would have based on the group they are in after a successful login. Basically, a user belongs to a group, and the group gets assigned permissions. I want to then be able to validate functions/methods based on weather the logged in user has certain permissions. Any help is appreciated

    Read the article

  • Call a function every hour

    - by user2961971
    I am trying to update information from a weather service on my page. The info should be updated every hour on the hour. How exactly do I go about calling a function on the hour every hour? I kind of had an idea but im not sure of how to actually refine it so it works... What I had in mind was something like creating an if statement, such as: (pseudo code) //get the mins of the current time var mins = datetime.mins(); if(mins == "00"){ function(); }

    Read the article

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