Daily Archives

Articles indexed Friday March 12 2010

Page 28/130 | < Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >

  • How do you calculate the offset to the client area in WPF?

    - by chris
    I want to position a modal dialog (progress window) at the top right corner of the parent window client area. This code will put it in the corner of the non-client area, but how do I calculate the offset to the client area? this.Owner=owner; this.Left=owner.Left+owner.ActualWidth-Width; this.Top=owner.Top; Edit: I found this 'solution' that works for normal windows: this.Left=owner.Left+owner.ActualWidth-Width-SystemParameters.ResizeFrameVerticalBorderWidth; this.Top=owner.Top+SystemParameters.ResizeFrameHorizontalBorderHeight+SystemParameters.WindowCaptionHeight; This would however fail for windows that have customized borders. EDIT: The code should work regardless of the systems DPI setting (e.g. 120 instead of 96).

    Read the article

  • Reporting Services: Two Tables One Sum

    - by Neomoon
    My report is as follows: One table provides financial information with sums at the group footer (Grouping is called "StockTable_Shipped"). The group is controlled by a boolean value (1=shows shipped data, 0 = shows received data) The second table is a variance report for data that has been shipped (boolean value of 1) and has a sum at the bottom of the table. My ultimate goal is to take the sum from table1 where shipped=1 and subtract it from the variance sum from table2. This will be placed in a textbox at the bottom of the report. I understand if this sounds confusing but I would be more then happy to provide more information.

    Read the article

  • Problem with writeToFile with array of NSDictionary objects

    - by Ken
    I'm trying to write an array of NSDictionary objects to a .plist file on the iPhone (OS 3.0). (They are actually NSCFDictionary objects when I call the [object class] method). My problem is that it won't write to file. If I set the array to "nil" it at least creates the empty plist file but won't do it if I have these objects in the array. My array is a parsed response from a JSON HTTP request and looks like this: { "title" = "A Movie"; "time_length" = "3:22"; }, { "title" = "Another Movie"; "time_length" = "1:40"; }, { "title" = "A Third Movie"; "time_length" = "2:10"; } The code to create the file is: [array writeToFile:[self dataFilePath] atomically:YES]; - (NSString *)dataFilePath { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; return [documentsDirectory stringByAppendingPathComponent:@"data.plist"]; } Could the NCSFDictionary class of the objects in my array be preventing me from writing to file? Thanks for your help.

    Read the article

  • Complex SQL query help on aggregating values for nested subquery

    - by François Beausoleil
    Hi! I have people, companies, employees, events and event kinds. I'm making a report/followup sheet where people, companies and employees are the rows, and the columns are event kinds. Event kinds are simple values describing: "Promised Donation", "Received Donation", "Phoned", "Followed up" and such. Event kinds are ordered: CREATE TABLE event_kinds ( id, name, position); Events hold the actual reference to the event: CREATE TABLE events ( id, person_id, company_id, referrer_id, event_kind_id, created_at); referrer_id is another reference to people. It is the person which sent the information/tip along, and is an optional field, although I sometimes want to filter on an event_kind that has a specific referrer, while I don't for other event kinds. Notice I don't have an employee ID reference. The reference exists, but is implied. I have application code to validate that person_id and company_id really reference an employee record. The other tables are pretty basic: CREATE TABLE people ( id, name); CREATE TABLE companies ( id, name); CREATE TABLE employees ( id, person_id, company_id); I'm trying to achieve the following report: Referrer Phoned Promised Donated Francois Feb 16th Feb 20th Mar 1st Apple (Steve Jobs) Steve Ballmer Mar 3rd IBM Bill Gates Mar 7th The first row is a people record, the 2nd is an employee, and the 3rd is a company. If I asked for referrer Bill Gates for Phoned event kinds, I'd only see the 3rd row, while asking for Steve and Phoned would return no rows. Right now, I do 3 queries, one for companies, one for people and a last one for employees. I want the event kind columns to be ordered, but I do that in application code and show it properly there. Here's where I'm at so far: SELECT companies.id, companies.name, (SELECT events.id FROM events WHERE events.referrer_id = 1470 AND events.company_id = companies.id AND events.person_id IS NULL AND events.event_kind_id = 9 ORDER BY created_at DESC LIMIT 1) event_kind_9, (SELECT events.id FROM events WHERE events.company_id = companies.id AND events.person_id IS NULL AND events.event_kind_id = 10 ORDER BY created_at DESC LIMIT 1) event_kind_10, (SELECT events.created_at FROM events WHERE events.referrer_id = 1470 AND events.company_id = companies.id AND events.person_id IS NULL AND events.event_kind_id = 9 ORDER BY created_at DESC LIMIT 1) event_kind_9_order FROM "companies" SELECT people.id, people.name, (SELECT events.id FROM events WHERE events.referrer_id = 1470 AND events.company_id IS NULL AND events.person_id = people.id AND events.event_kind_id = 9 ORDER BY created_at DESC LIMIT 1) event_kind_9, (SELECT events.id FROM events WHERE events.company_id IS NULL AND events.person_id = people.id AND events.event_kind_id = 10 ORDER BY created_at DESC LIMIT 1) event_kind_10, (SELECT events.created_at FROM events WHERE events.referrer_id = 1470 AND events.company_id IS NULL AND events.person_id = people.id AND events.event_kind_id = 9 ORDER BY created_at DESC LIMIT 1) event_kind_9_order FROM "people" SELECT employees.id, employees.company_id, employees.person_id, (SELECT events.id FROM events WHERE events.referrer_id = 1470 AND events.company_id = employees.company_id AND events.person_id = employees.person_id AND events.event_kind_id = 9 ORDER BY created_at DESC LIMIT 1) event_kind_9, (SELECT events.id FROM events WHERE events.company_id = employees.company_id AND events.person_id = employees.person_id AND events.event_kind_id = 10 ORDER BY created_at DESC LIMIT 1) event_kind_10, (SELECT events.created_at FROM events WHERE events.referrer_id = 1470 AND events.company_id = employees.company_id AND events.person_id = employees.person_id AND events.event_kind_id = 9 ORDER BY created_at DESC LIMIT 1) event_kind_9_order FROM "employees" I rather suspect I'm doing this wrong. There should be an "easier" way to do it. One other filter criteria would be to filter on people/company names: WHERE LOWER(companies.name) LIKE '%apple%'. Note that I'm ordering by the dates of event_kind_9 here, and a secondary sort is by person/company name. To summarize: I want to paginate the result set, find the latest event for each cell, order the result set by the date of the latest event, and by company/person name, filter by referrer in some event kinds, but not others. For reference, I'm using PostgreSQL, from Ruby, ActiveRecord/Rails. The solution is pure SQL though.

    Read the article

  • RSS feed generated by SharePoint has a stylesheet tag and how to remove that

    - by iHeartDucks
    The feed which SharePoint Generates is here (I copied it to pastie because I thought it would be clear there) However, the xml file comes with a style sheet tag. How do I remove that? Does SharePoint always generate that? Due to the presence of that tag, I am unable to apply another style sheet of my own using the XML WebPart. EDIT: I don't think the issue is related to the style sheet. If I copy the xml and paste it in the "Xml Editor" of the Web Part everything works just fine. If I provide the URL, that is when I do not see any data. This is my XSL file <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" exclude-result-prefixes="x d ddwrt xsl msxsl" xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt"> <xsl:output method="html" version="1.0" encoding="iso-8859-1" indent="yes"/> <xsl:template match="/"> <xsl:value-of select="count(rss)" /> <xsl:value-of select="count(rss/channel)" /> <xsl:value-of select="count(rss/channel/item)" /> <xsl:for-each select="rss/channel/item"> <xsl:value-of select="title" /> </xsl:for-each> </xsl:template> </xsl:stylesheet> Pastie link

    Read the article

  • Converting a PowerShell Script into a Module Part 2

    In this article the author explains how PSModuleInfo object for a module can be retrieved. Further, he shows how code can be injected into the module to manipulate the state of a module without having to reload it. He also explains how to directly set some metadata elements, like the module description, and some other PSModuleInfo object features.

    Read the article

  • mod_rewrite rules in httpd configuration

    - by wag2639
    How and where do I put my mod_rewrite rules in the httpd configuration so that they're only parsed once at startup instead of each time a file in my web directory is read. Additional info: assuming all scripts work in .htaccess file RHEL4 running Apache 2.0.52 multiple sub/domains on the the machine Thanks

    Read the article

  • Prevent Explorer From Expanding Network Folders when in Folders View

    - by Chris
    When you are browsing a network share and there are over 1000 folders in the root (like at work), is there a way to prevent Explorer from expanding all the Folders when you have the "Folders" view enabled? Explorer will open the folder your double clicked on, and show that in the right navigation pane, and it's great, but wait about five seconds and the rest of the folder list pops into view, I'd rather that not happen. There is only one folder I'm interested in (or have access to), and it's annoying waiting for Explorer to load the rest of the files.

    Read the article

  • What is wrong with this database query?

    - by outsyncof
    I have the following tables in a database (i'll only list the important attributes): Person(ssn,countryofbirth) Parents(ssn,fatherbirthcountry) Employment(ssn, companyID) Company(companyID, name) My task is this: given fatherbirthcountry as input, output the names of companies where persons work whose countryofbirth match the fatherbirthcountry input. I pretend that the fatherbirthcountry is Mexico and do this: SELECT name FROM Company WHERE companyid = (SELECT companyid FROM Employment WHERE ssn = (SELECT ssn FROM Person WHERE countryofbirth = 'Mexico'); but it is giving me an error: >Scalar subquery is only allowed to return a single row. am I completely off track? Can anybody please help?

    Read the article

  • PHP - get MySQL query results as their native data type?

    - by redidas
    I've tried fetching MySQL query results using mysql_fetch_row() mysql_result() and numeric values are being returned as strings. Is there any way to fetch the data as its datatype stored in the table? The application will be querying many different queries so I will be unable to cast the values as the intended datatype on a 1 by 1 basis.

    Read the article

  • VBA Range.Rows.Count giving unexpected results

    - by Jeffrey
    I have a Range variable that contains an address - $2:$2,$4:$205,$214:$214 - (3 groups of rows). I would like to get the count of all the rows in that range. However, range.Count gives me the count of all the cells (50,000~) and range.Rows.Count only return 1 - the count of all the rows in the first group. How do I get the count of all the rows Thanks

    Read the article

  • getting 502 proxy error while parsing

    - by developer
    Iam parsing a page and im getting response from that but after some time i.e. after some of the parsing gets done i get this error from the server - Proxy Error The proxy server received an invalid response from an upstream server. The proxy server could not handle the request GET /file.php. Reason: Error reading from remote server and after this my parsing fails. I even tried sleep() function but it didnt helped and the error still came. Are they temporarily blocking my ip or what?? What could be the reason for this and how can i parse those pages without getting this error and all ???

    Read the article

  • Advice on Python/Django and message queues

    - by Andy Hume
    I have an application in Django, that needs to send a large number of emails to users in various use cases. I don't want to handle this synchronously within the application for obvious reasons. Has anyone any recommendations for a message queuing server which integrates well with Python, or they have used on a Django project? The rest of my stack is Apache, mod_python, MySQL.

    Read the article

  • Using a custom URL parameter in Wordpress (with permalinks)?

    - by kiko
    Hello - Is there a way to perhaps edit .htaccess to add a custom URL parameter to Wordpress, so that the parameter is not stripped out by permalinks? I have a Wordpress site with a page that queries a separate (non-Wordpress) database. I passed the URL parameter "pubID" to display individual books and it is working OK. Example: http://www.uglyducklingpresse.org/catalog/browse/item/?pubID=63 But the individual books are not showing up properly in Google - maybe because they all have the same auto-generated "canonical" URL meta tab - one with the "pubID" parameter stripped out. Thank you for any help.

    Read the article

< Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >