Daily Archives

Articles indexed Thursday May 13 2010

Page 8/119 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • How to find the latest row for each group of data

    - by Jason
    Hi All, I have a tricky problem that I'm trying to find the most effective method to solve. Here's a simplified version of my View structure. Table: Audits AuditID | PublicationID | AuditEndDate | AuditStartDate 1 | 3 | 13/05/2010 | 01/01/2010 2 | 1 | 31/12/2009 | 01/10/2009 3 | 3 | 31/03/2010 | 01/01/2010 4 | 3 | 31/12/2009 | 01/10/2009 5 | 2 | 31/03/2010 | 01/01/2010 6 | 2 | 31/12/2009 | 01/10/2009 7 | 1 | 30/09/2009 | 01/01/2009 There's 3 query's that I need from this. I need to one to get all the data. The next to get only the history data (that is, everything but exclude the latest data item by AuditEndDate) and then the last query is to obtain the latest data item (by AuditEndDate). There's an added layer of complexity that I have a date restriction (This is on a per user/group basis) where certain user groups can only see between certain dates. You'll notice this in the where clause as AuditEndDate<=blah and AuditStartDate=blah Foreach publication, select all the data available. select * from Audits Where auditEndDate<='31/03/10' and AuditStartDate='06/06/2009'; foreach publication, select all the data but Exclude the latest data available (by AuditEndDate) select * from Audits left join (select AuditId as aid, publicationID as pid and max(auditEndDate) as pend from Audit where auditenddate <= '31/03/2009' /* user restrict / group by pid) Ax on Ax.pid=Audit.pubid where pend!=Audits.auditenddate AND auditEndDate<='31/03/10' and AuditStartDate='06/06/2009' / user restrict */ Foreach publication, select only the latest data available (by AuditEndDate) select * from Audits left join (select AuditId as aid, publicationID as pid and max(auditEndDate) as pend from Audit where auditenddate <= '31/03/2009'/* user restrict / group by pid) Ax on Ax.pid=Audit.pubid where pend=Audits.auditenddate AND auditEndDate<='31/03/10' and AuditStartDate='06/06/2009' / user restrict */ So at the moment, query 1 and 3 work fine, but query 2 just returns all the data instead of the restriction. Can anyone help me? Thanks jason

    Read the article

  • How to select from datetime in sqlite?

    - by Sein Kraft
    Joined is a datetime data type column in the database and dates are saved as '12/05/2010 15:54:32' This my query: SELECT * FROM users WHERE joined BETWEEN '12/05/2010 00:00:00' AND '12/05/2010 59:59:59' ORDER BY id ASC But it doesn't work. It returns no rows. So how i gan get them?

    Read the article

  • Is there a website to look up common, already written functions?

    - by pinnacler
    I'm sitting here writing a function that I'm positive has been written before, somewhere on earth. It's just too common to have not been attempted, and I'm wondering why I can't just go to a website and search for a function that I can then copy and paste into my project in 2 seconds, instead of wasting my day reinventing the wheel. Sure there are certain libraries you can use, but where do you find these libraries and when they are absent, is there a site like I'm describing? Possibly a wiki of some type that contains free code that anybody can edit and improve? Edit: I can code things fine, I just don't know HOW to do them. So for example, right now, I'm trying to localize a robot/car/point in space. I KNOW there is a way to do it, just based off of range and distance. Triangulation and Trilateration. How to code that is a different story. A site that could have psuedo code, step by step how to do that would be ridiculously helpful. It would also ensure the optimal solution since everybody can edit it. I'm also writing in Matlab, which I hate because it's quirky, adding to my desire for creating a website like I describe.

    Read the article

  • CSS box shadow on container div causes scrollbars

    - by kaile
    I have a website with the following setup: <div id="container"> <div id="header"></div> <div id="content"></div> <div id="clearfooter"></div> </div> <div id="footer"></div> I use the clearfooter and a footer outside the container to keep the footer at the bottom of the page when there isn't enough content. My problem is that I would like to apply a box shadow on the container div in the following way: #container {width:960px; min-height:100%; margin:0px auto -32px auto; position:relative; padding:0px; background-color:#e6e6e6; -moz-box-shadow: -3px 0px 5px rgba(0,0,0,.8), 3px 0px 5px rgba(0,0,0,.8);} #header {height:106px; position:relative;} #content {margin:0px; padding:10px 30px 10px 30px; position:relative;} #clearFooter {height:32px; clear:both; display:block; padding:0px; margin:0px;} #footer {height:32px; padding:0px; position:relative; width:960px; margin:0px auto 0px auto;} As you can see its a drop shadow on on each side of the container div. However, in doing this, when the content doesn't take up the full height, there are still scroll bars caused by the shadow pushing past the bottom of the footer due to the blur. Is there some way of preventing the shadow from going past the edge of the container div and causing a scrollbar? Thanks for your help!

    Read the article

  • Autoconf macros for Apache and conf.d install process?

    - by Stephen Burke
    I have a package that is using the autotools to build and install. Part of the package is a website that can be run on the local machine. So in the package there is a .conf file that is meant to be either copied or linked to the /etc/apache2/conf.d directory. What's the standard way that packages would do this? If possible, I'd like for the user not to have an extra step to make the website work. I'd like to have them install the package and then be able to browse to http://localhost/newpackage to get up and running. Also, is there a way that autoconf knows about the apache install or a standard way through then environment some how? If someone could point me in the right direction that would be great. Steve

    Read the article

  • Reference app relative virtual paths in .css file

    - by bravo9
    Assume I have an "images" folder directory under the root of my application. How can I, from within a .css file, reference an image in this directory using an ASP.NET app relative path. Example: When in development, the path of ~/Images/Test.gif might resolve to /MyApp/Images/Test.gif while, in production, it might resolve to /Images/Test.gif (depending on the virtual directory for the application). I, obviously, want to avoid having to modify the .css file between environments. I know you can use Page.ResolveClientUrl to inject a url into a control's Style collection dynamically at render time. I would like to avoid doing this.

    Read the article

  • Microsoft Chart Control labels

    - by Serge
    Hello, I've been searching for a while and browsing through the samples but could not find a solution to my problem. In Microsoft Chart Control I have created a line series that plots real-time data. As new data points are added, the chart margins will sometimes jump on the form. I have tried disabling the grid lines and have determined that the margins change when the x-axis label overlaps with the y-axis label. I have tried auto-fitting the labels but that does not seem to work probably because it treat x-axis and y-axis separately. Is there any way to prevent the overlap, or keep the labels and corresponding grid lines stationery and just change their value when the data scrolls? Thank you for your help.

    Read the article

  • Writing .htaccess mod rewrite for hierarchical categories

    - by NetCaster
    i need to rewrite urls for my classified ads directory i have 4 types of links /City == display all ads in city /City/Cat1 == display all ads in city + category /City/Cat1/Cat2 == display add ads in city + category 1 + category 2 /City/Cat1/Cat2/Ad-id == display the ad itself and pass cat1 cat2 and city variables original hidden url should be index.php?city=alexandria&cat1=cars&cat2=bikes&adid=EWSw22d Can you please help me writing .htaccess for this structure

    Read the article

  • Unwanted font Helvetica in PDF from Jasper

    - by Fabio
    When I create a PDF from a Jasper Report, the resulting PDF declare to use "Helvetica" font, even if it doesn't contain text. Unfortunately I cannot embed "Helvetica" font, because it is not among the Windows fonts. Based on the PDF/A rules, I need to embed all the fonts in the PDF file. How can I create from Jasper a PDF that doesn't declare to use Helvetica? Thank you in advance. Fabio

    Read the article

  • Interpolating data points in Excel

    - by Niels Basjes
    Hi, I'm sure this is the kind of problem other have solved many times before. A group of people are going to do measurements (Home energy usage to be exact). All of them will do that at different times and in different intervals. So what I'll get from each person is a set of {date, value} pairs where there are dates missing in the set. What I need is a complete set of {date, value} pairs where for each date withing the range a value is known (either measured or calculated). I expect that a simple linear interpolation would suffice for this project. If I assume that it must be done in Excel. What is the best way to interpolate in such a dataset (so I have a value for every day) ? Thanks. NOTE: When these datasets are complete I'll determine the slope (i.e. usage per day) and from that we can start doing home-to-home comparisons. ADDITIONAL INFO After first few suggestions: I do not want to manually figure out where the holes are in my measurement set (too many incomplete measurement sets!!). I'm looking for something (existing) automatic to do that for me. So if my input is {2009-06-01, 10} {2009-06-03, 20} {2009-06-06, 110} Then I expect to automatically get {2009-06-01, 10} {2009-06-02, 15} {2009-06-03, 20} {2009-06-04, 50} {2009-06-05, 80} {2009-06-06, 110} Yes, I can write software that does this. I am just hoping that someone already has a "ready to run" software (Excel) feature for this (rather generic) problem.

    Read the article

  • Passing constructor arguments when using StructureMap

    - by Mosh
    Hello, I'm using StructureMap for my DI. Imagine I have a class that takes 1 argument like: public class ProductProvider : IProductProvider { public ProductProvider(string connectionString) { .... } } I need to specify the "connectionString at run-time when I get an instance of IProductProvider. I have configured StructureMap as follows: ForRequestedType<IProductProvider>.TheDefault.Is.OfConcreteType<ProductProvider>(). WithCtorArgument("connectionString"); However, I don't want to call EqualTo("something...") method here as I need some facility to dynamically specify this value at run-time. My question is: how can I get an instance of IProductProvider by using ObjectFactory? Currently, I have something like: ObjectFactory.GetInstance<IProductProvider>(); But as you know, this doesn't work... Any advice would be greatly appreciated.

    Read the article

  • Monitoring process-level performance counters in Windows Perfmon

    - by Dennis Kashkin
    I am sure everybody has bumped into this. As you scale a web server that uses multiple application pools, it's valuable to collect performance counters for each application pool 24x7. The only problem is - Perfmon links counters to application pools by process ID, so whenever an application pool recycles you have to remove the counters for the old process ID and add them for the new process ID. Since application pools recycle quite often (whenever you release a new version or patch the server), it's a major pain. I wonder if anybody has found a workaround for this? Perhaps a programmatic way to update Perfmon settings whenever an application pool starts up or some way to reference application pools by name instead of process ID? I'll appreciate any hints on this!

    Read the article

  • Lua Operator Overloading

    - by Pessimist
    I've found some places on the web saying that operators in Lua are overloadable but I can't seem to find any example. Can someone provide an example of, say, overloading the + operator to work like the .. operator works for string concatenation? EDIT 1: to Alexander Gladysh and RBerteig: If operator overloading only works when both operands are the same type and changing this behavior wouldn't be easy, then how come the following code works? (I don't mean any offense, I just started learning this language): printf = function(fmt, ...) io.write(string.format(fmt, ...)) end Set = {} Set.mt = {} -- metatable for sets function Set.new (t) local set = {} setmetatable(set, Set.mt) for _, l in ipairs(t) do set[l] = true end return set end function Set.union (a,b) -- THIS IS THE PART THAT MANAGES OPERATOR OVERLOADING WITH OPERANDS OF DIFFERENT TYPES -- if user built new set using: new_set = some_set + some_number if type(a) == "table" and type(b) == "number" then print("building set...") local mixedset = Set.new{} for k in pairs(a) do mixedset[k] = true end mixedset[b] = true return mixedset -- elseif user built new set using: new_set = some_number + some_set elseif type(b) == "table" and type(a) == "number" then print("building set...") local mixedset = Set.new{} for k in pairs(b) do mixedset[k] = true end mixedset[a] = true return mixedset end if getmetatable(a) ~= Set.mt or getmetatable(b) ~= Set.mt then error("attempt to 'add' a set with a non-set value that is also not a number", 2) end local res = Set.new{} for k in pairs(a) do res[k] = true end for k in pairs(b) do res[k] = true end return res end function Set.tostring (set) local s = "{" local sep = "" for e in pairs(set) do s = s .. sep .. e sep = ", " end return s .. "}" end function Set.print (s) print(Set.tostring(s)) end s1 = Set.new{10, 20, 30, 50} s2 = Set.new{30, 1} Set.mt.__add = Set.union -- now try to make a new set by unioning a set plus a number: s3 = s1 + 8 Set.print(s3) --> {1, 10, 20, 30, 50}

    Read the article

  • Objective-C Plugin Architecture Security (Mac, not iphone)

    - by Tom Dalling
    I'm possibly writing a plugin system for a Cocoa application (Mac, not iphone). A common approach is the make each plugin a bundle, then inject the bundle into the main application. I'm concerned with the security implications of doing this, as the bundle will have complete access to the Objective-C runtime. I am especially concerned with a plugin having access to the code that handles registration and serial keys. Another plugin system we are considering is based on distributed notifications. Basically, each plugin will be a separate process, and they will communicate via distributed notifications only. Is there a way to load bundles securely (e.g. sandboxing)? If not, do you see any problems with using distributed notifications? Are there any other plugin architectures that would be better?

    Read the article

  • Pros and Cons of Creating an Internal Cerificate Authority

    - by Chad
    What are the pros and cons of spinning up an internal certificate authority (primarily Windows 2003 CA)? We have the need to encypt server-server traffic on a project that has 20+ certificates. We could buy certs from Verisign, but I was thinking that an internal CA might be a better long term solution. So I was looking to the community to provide a pros/cons list of what we might gain (or lose) by hosting our own CA? Thanks in advance for the help.

    Read the article

  • How do you reset a Nexxt 54M Wireless AP Router?

    - by Fernando
    I have this Nexxt router, and I haven't been able to reset it correctly. I pressed the thin button in the back (which you have to press with a pen point or something similar, really slim), but haven't managed to make it work. The CPU, WLAN and power lights go on and remain still. The lights for the connected cables don't turn on...

    Read the article

  • How do I keep gnome-terminal width from changing when I use "reset"

    - by monguin
    When I use reset in gnome-terminal (bash, Ubuntu 9.04), the window width resets, though the height does not. On my personal computer, this does not happen in xterm or konsole. On my work computer (RHEL 5 or maybe 4), this does not happen in any terminals, including gnome-terminal. I assume there is some environment variable that controls this, but my .bashrc at work is hundreds of lines long, so I'm not sure where to look in there.

    Read the article

  • Few question on windows explorer properties(win 7)

    - by Nrew
    I've red this article from howtogeek, but it didn't explain this one which is placed in the target portion when you right click on windows explorer and click properties: %windir%\explorer.exe shell:desktop\Inbox And why does local disk E: shows up when I have this one: %windir%\explorer.exe shell:E:\FINAL SAVE DATA I don't really get the code, especially the part in shell: desktop\Inbox. What's that supposed to mean. How do I change it so that when I click on the Windows Explorer shortcut, I get to see this location: E:\FINAL SAVE DATA

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >