Search Results

Search found 1234 results on 50 pages for 'giles smith'.

Page 24/50 | < Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >

  • C# dictionary and lookup add / update

    - by freddy smith
    I am sick of doing blocks of code like this for various bits of code I have: if (dict.ContainsKey[key]) { dict[key] = value; } else { dict.Add(key,value); } and for lookups (i.e. key - list of value) if (lookup.ContainsKey[key]) { lookup[key].Add(value); } else { lookup.Add(new List); lookup[key].Add(value); } Is there another collections lib or extension method I should use to do this in one line of code no matter what the key and value types are? e.g. dict.AddOrUpdate(key,value) lookup.AddOrUpdate(key,value)

    Read the article

  • complicated sql query !!

    - by user507779
    LookupTable: userid, mobileid, startedate, enddate , owner 1 , 1 , 12-12-2000, 01-01-2001, asd 2 , 2 , 12-12-2000, 01-01-2001, dgs 3 , 3 , 02-01-2001, 01-01-2002, sdg 4 , 4 , 12-12-2000, 01-01-2001, sdg UserInfoTable: userid, firstname, lastname, address 1 , tom , do , test 2 , sam , smith , asds 3 , john , saw , asdasda 4 , peter , winston , near by Mobile: Mobileid, Name , number, imeinumber 1 , apple , 123 , 1111111 2 , nokia , 456 , 2222222 3 , vodafone , 789 , 3333333 CallLogs: id , Mobileid, callednumbers (string), date , totalduration 1 , 1 , 123,123,321 , 13-12-2000 , 30 2 , 1 , 123,123,321 , 14-12-2000 , 30 3 , 2 , 123,123,321 , 13-12-2000 , 30 4 , 2 , 123,123,321 , 14-12-2000 , 30 5 , 3 , 123,123,321 , 13-12-2000 , 30 6 , 3 , 123,123,321 , 14-12-2000 , 30 1 , 1 , 123,123,321 , 13-01-2002 , 30 2 , 1 , 123,123,321 , 14-01-2002 , 30 I want a query which will return me the following: firstname, lastname, mobile.name as mobilename, callednumbers (as concatinated strings from different rows in CallLogs table) and need it for year 2000 example: firstname, lastname, mobilename, callednumbers tom , do , apple , 123,123,321, 123,123,321 sam , smith , nokia , 123,123,321, 123,123,321 peter , winston , apple , 123,123,321, 123,123,321 any help will be highly appreciated...

    Read the article

  • Flash uploader that can handle >2GB files?

    - by Alvin SMith
    Is there an open source Flash uploader that can handle files larger than 2 GB? ASP.net implementations like SlickUpload are not an option, and SWFUpload (and others that I've seen) do not handle files larger than 2 GB. Nor is requiring the user to have Java installed to run applets. This would be for both IE and Firefox. I've seen a couple "large file transfer" sites that have a Flash uploader and claim to go past the 2GB limit (which is the limit for http uploads for most browsers) so I know it is technically possible.

    Read the article

  • Intellisense for custom config section problem with namespaces

    - by Quick Joe Smith
    I have just rolled a custom configuration section, created an accompanying schema document for Intellisense and added it to the Web.config's Schemas property as per Michael Stum's answer to another similar question. Unfortunately, and possibly due to me creating the XSD by hand with limited knowledge, the Intellisense relies on an xmlns attribute pointing to my XSD file's namespace being present in the custom config element. However, when running the project I get an Unrecognized attribute 'xmlns'. Note that attribute names are case-sensitive error. I could probably just modify my XSD file to define the xmlns attribute for that element, however I am wondering if this is just a bandaid fix to a larger problem. I must confess I don't have a very good understanding of XML namespaces so this might be an oppportunity to set me straight on a few things. Here is the attributes for my XSD file's root xs:schema element: <xs:schema id="awesomeConfig" targetNamespace="http://awesome.com/schemas" xmlns="http://awesome.com/schemas" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"> ... </xs:schema> And on creating the element in the Web.config file, Visual Studio 2008 automatically appends: <awesomeConfig xmlns="http://awesome.com/schemas"></awesomeConfig> So have I misunderstood the meaning of the xs:schema attributes at all, or is the proper solution as simple as it seems?

    Read the article

  • PHP: Next Available Value in an Array, starting with a non-indexed value

    - by Erik Smith
    I've been stumped on this PHP issue for about a day now. Basically, we have an array of hours formatted in 24-hour format, and an arbitrary value ($hour) (also a 24-hour). The problem is, we need to take $hour, and get the next available value in the array, starting with the value that immediately proceeds $hour. The array might look something like: $goodHours = array('8,9,10,11,12,19,20,21). Then the hour value might be: $hour = 14; So, we need some way to know that 19 is the next best time. Additionally, we might also need to get the second, third, or fourth (etc) available value. The issue seems to be that because 14 isn't a value in the array, there is not index to reference that would let us increment to the next value. To make things simpler, I've taken $goodHours and repeated the values several times just so I don't have to deal with going back to the start (maybe not the best way to do it, but a quick fix). I have a feeling this is something simple I'm missing, but I would be so appreciative if anyone could shed some light. Erik

    Read the article

  • Smart Client Guidance = Prism? Vs 2010

    - by mark smith
    Hi there, I have found this link http://smartclient.codeplex.com/ which has some updates for vs 2010 .... I don't know but i always seem to get confused i.e. lack of documentation etc..... but is this the same as Prism?? If not can anyone tell me where the differences are... It appears to be a link for designing smartclient so i presume its composite Or am i wrong? If i am indeed wrong, where is the link to prism and the vs 2010 templates? Any help would be really appreciated

    Read the article

  • Using summary data from dataprovider to populate chart.

    - by arunp
    In Flex, how do i create a summary(say total of various domains) from the data provider and display in chart? Say this is my dataprovider.. I want to display the total estimate of each territory as a slice in piechart private var dpFlat:ArrayCollection = new ArrayCollection([ {Region:"Southwest", Territory:"Arizona", Territory_Rep:"Barbara Jennings", Actual:38865, Estimate:40000}, {Region:"Southwest", Territory:"Arizona", Territory_Rep:"Dana Binn", Actual:29885, Estimate:30000}, {Region:"Southwest", Territory:"Central California", Territory_Rep:"Joe Smith", Actual:29134, Estimate:30000}, {Region:"Southwest", Territory:"Nevada", Territory_Rep:"Bethany Pittman", Actual:52888, Estimate:45000}, {Region:"Southwest", Territory:"Northern California", Territory_Rep:"Lauren Ipsum", Actual:38805, Estimate:40000}, {Region:"Southwest", Territory:"Northern California", Territory_Rep:"T.R. Smith", Actual:55498, Estimate:40000}, {Region:"Southwest", Territory:"Southern California", Territory_Rep:"Alice Treu", Actual:44985, Estimate:45000}, {Region:"Southwest", Territory:"Southern California", Territory_Rep:"Jane Grove", Actual:44913, Estimate:45000} ]);

    Read the article

  • Grouping a generic list via LINQ in VB.NET

    - by CD Smith
    I need to take a collection and group it via Linq but all the examples I've seen fail in some manner or other with some syntax difference that I can't quite lick. My collection: Dim a As New List(Of ProcessAlert) a.Add(New ProcessAlert("0000112367", "[email protected]", "Alert", 2)) a.Add(New ProcessAlert("0000112367", "[email protected]", "Document", 2)) a.Add(New ProcessAlert("0000112367", "[email protected]", "Note", 2)) a.Add(New ProcessAlert("0000112367", "[email protected]", "Alert", 1)) a.Add(New ProcessAlert("0000112367", "[email protected]", "Document", 1)) a.Add(New ProcessAlert("0000112367", "[email protected]", "Note", 1)) Return a I need to turn this collection into a simple way to give this final outcome: "[email protected]", "Alert, Document, Note" "[email protected]", "Alert, Document, Note" Here's the definition of the ProcessAlert class: Public Class ProcessAlert Public LoanNumber As String Public EmailAddress As String Public AlertType As String Public AlertMethodID As Byte End Class Thanks in advance, CD

    Read the article

  • Looking for marg_setValue in UIKit

    - by John Smith
    I am trying to compile a library originally written for Cocoa. Things are good until it looks for the function marg_setValue(). It says it can't find it. I have googled and found it is defined in How can I use this file in cocoa-touch? Or does cocoa-touch not support runtime.

    Read the article

  • MySQL database Int overflow and can't login in.

    - by Ryan SMith
    I have a MySQL database on my server and I"m pretty sure it's an int over flow on one table with an auto_increment field that's crashing it. I can delete the table, it's not very important, but I can't get into the server. Is there anyway to delete that database from the file system or without logging into MySQL? HELP! THE WORLD IS ENDING!

    Read the article

  • SQL 2005: Select top N, group by ID with joins

    - by Suzy Fresh
    I'm having real difficulty with a query involving 3 tables. I need to get the 3 newest users per department grouped by department names. The groups should be sorted by the users.dateadded so the department with the newest activity is first. The users can exist in multiple departments so Im using a lookup table that just contains the userID and deptID. My tables are as follows. Department - depID|name Users - userID|name|dateadded DepUsers - depID|userID The output I need would be Receiving John Doe - 4/23/2010 Bill Smith - 4/22/2010 Accounting Steve Jones - 4/22/2010 John Doe - 4/21/2010 Auditing Steve Jones - 4/21/2010 Bill Smith - 4/21/2010

    Read the article

  • apache setup/directive question

    - by tom smith
    Hi. Trying to get my head around what I believe is a very basic question. Assume I want to have: http://www.cat.com, and http://www.dog.com and I want to have the cat.com, and dog.com come from "indexA.php", and "indexB.php" respectively... where indexA.php and indexB.php are in the same dir... thanks

    Read the article

  • Need to work out database structure

    - by jim smith
    Hi, Just need a little kickstart with this. I have Mysql/PHP, and I have 5,000 products. I have 30 companies I need to store some data for those 30 companies for each product as follows: a) prices b) stock qty I also need to store data historically on a daily basis. So the table... It makes sense that the records will be the products because there's 5000, and if I put the companies as the columns, I can store the prices, but what about the stock quantities? I could create two columns for each compoany, one for prices, one for qty. Then make the tablename the date for that day...so theer would be a new table for every day with 5000 products in it? is this the correct way? Some idea on how I'll be retreiving data the top 5 lowest prices (and the company) by product for a certain date the price and stock changes in the past 7 days by product

    Read the article

  • Keyboard blocking my view

    - by John Smith
    I have a UIView with another UIView inside it. On the inside UIView there is a textbox which I want to fill in. When I try to fill it in the keyboard blocks my view: The UIViewController has the following containerView = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds]; self.view=containerView; //The apropriate releases etc are further on... When I touch it, the keyboard comes up as expected, but blocks the textbox I'm trying to fill in. How can I force the view to slide up? The front view OptionsFront * fv = [[OptionsFront alloc] initWithFrame:[UIScreen mainScreen].bounds]; [containerView addSubview:frontView]; In the front view is a subview CGRect bounds = CGRectMake(0.0f, 210.0f, 280.0f, 130.0f); sv = [[UIView alloc] initWithFrame:bounds]; [self addSubview:sv]; //added to frontView In sv is a textbox near the botton: rect = CGRectMake(70.0f, 20.0f, 100.0f, 27.0f); cf = [self createTextField_Rounded:rect holder:@"+ve"]; [sv addSubview:cf]; So cf happens to be near the bottom of the page. I expected that when I select it, the whole display would move up, but the keyboard just moves up and blocks it. What can I do? Appendix: - (UITextField *)createTextField_Rounded:(CGRect) frame holder:(NSString *) ph { UITextField *returnTextField = [[UITextField alloc] initWithFrame:frame]; returnTextField.borderStyle = UITextBorderStyleRoundedRect; returnTextField.textColor = [UIColor blackColor]; returnTextField.font = [UIFont systemFontOfSize:17.0]; returnTextField.delegate = self; returnTextField.keyboardType = UIKeyboardTypeNumbersAndPunctuation; returnTextField.returnKeyType = UIReturnKeyDone; returnTextField.clearButtonMode = UITextFieldViewModeWhileEditing; return returnTextField; }

    Read the article

  • Log out of an SSH session into Erlang VM without stopping the VM or leaving stale processes

    - by Garret Smith
    I have an Erlang application running as a daemon, configured as an SSH server. I can connect to it with an SSH client and I get the standard Erlang REPL. If I 'q().' I shut down the Erlang VM, not the connection. If I close the connection ('~.' for OpenSSH, close the window in PuTTY) some processes remain under the sshd_sup/ssh_system_xx_sup tree. These appear to be stale shell processes. I do not see any exported function in the shell module that would let me shut down the shell (and therefore the SSH connection) without affecting the entire VM. How should I be logging out of the SSH session to not leave stale processes in the VM?

    Read the article

  • Why is the servlet request not available in the portlet API

    - by John Smith
    The portlet API deos not provide any reference to the enclosing servlet request and response objects. I know it is not the preferred model of interaction with the user, but it seems draconian to remove all access. I understand that for portlet driven interaction with the user, you want to use portlet URLs, and let the portlet container manage all the complexity. However if you have a number of portlets which are basically showing variants of the same data, it makes sense for them to be able to use the enclosing request to drive the data. We ended up using using a Liferay specific call to get the request, and it all seems to work as we wish. However I do feel the guilt. So my question really is, is there an underlying deep reason for the prohibition, or is it just to enforce the authors view of the API environment?

    Read the article

  • Access report not showing data

    - by Brian Smith
    I have two queries that I am using to generate a report from, the problem is when I run the report, three fields do not show any data at all for some reason. Query 1: SELECT ClientSummary.Field3 AS PM, ClientSummary.[Client Nickname 2] AS [Project #], ClientSummary.[Client Nickname 1] AS Customer, ClientSummary.[In Reference To] AS [Job Name], ClientSummary.Field10 AS Contract, (select sum([Billable Slip Value]) from Util_bydate as U1 where U1.[Client Nickname 2] = ClientSummary.[Client Nickname 2]) AS [This Week], (select sum([Billable Slip Value]) from Util as U2 where U2.[Client Nickname 2] = ClientSummary.[Client Nickname 2] ) AS [To Date], [To Date]/[Contract] AS [% Spent], 0 AS Backlog, ClientSummary.[Total Slip Fees & Costs] AS Billed, ClientSummary.Payments AS Paid, ClientSummary.[Total A/R] AS Receivable, [Forms]![ReportMenu]![StartDate] AS [Start Date], [Forms]![ReportMenu]![EndDate] AS [End Date] FROM ClientSummary; Query 2: SELECT JobManagement_Summary.pm, JobManagement_Summary.[project #], JobManagement_Summary.Customer, JobManagement_Summary.[Job Name], JobManagement_Summary.Contract, IIf(IsNull([This Week]),0,[This Week]) AS [N_This Week], IIf(IsNull([To Date]),0,[To Date]) AS [N_To Date], [% Spent], JobManagement_Summary.Backlog, JobManagement_Summary.Billed, JobManagement_Summary.Paid, JobManagement_Summary.Receivable, JobManagement_Summary.[Start Date], JobManagement_Summary.[End Date] FROM JobManagement_Summary; When I run the report from query 2 these 3 fields don't appear. N_This Week, N_To Date and % Spent. All have no data. It isn't the IIF functions, as it doesn't matter if I have those in there or remove them. Any thoughts? If I connect directly to the first recordset it works fine, but then SQL throws the error message: Multi-level GROUP BY cause not allowed in subquery. Is there any way to get around that message to link to it directly or does anyone have ANY clue why these fields are coming back blank? I am at wits end here!

    Read the article

  • What is the best way to use whitespace while programming?

    - by Emmanuel Smith
    I'm fairly new to programming and from learning I have seen different ways of formatting code, comments, etc; and have been recommended on different techniques. I mostly program in C#, C++, and Java so I want to know what is the the best way to layout code so that if other people where to go through it, they would be impressed by how simple and easy to understand it is. I would like to know the same thing for commenting as well.

    Read the article

  • Question about DBD::CSB Statement-Functions

    - by sid_com
    From the SQL::Statement::Functions documentation: Function syntax When using SQL::Statement/SQL::Parser directly to parse SQL, functions (either built-in or user-defined) may occur anywhere in a SQL statement that values, column names, table names, or predicates may occur. When using the modules through a DBD or in any other context in which the SQL is both parsed and executed, functions can occur in the same places except that they can not occur in the column selection clause of a SELECT statement that contains a FROM clause. # valid for both parsing and executing SELECT MyFunc(args); SELECT * FROM MyFunc(args); SELECT * FROM x WHERE MyFuncs(args); SELECT * FROM x WHERE y < MyFuncs(args); # valid only for parsing (won't work from a DBD) SELECT MyFunc(args) FROM x WHERE y; Reading this I would expect that the first SELECT-statement of my example shouldn't work and the second should but it is quite the contrary. #!/usr/bin/env perl use warnings; use strict; use 5.010; use DBI; open my $fh, '>', 'test.csv' or die $!; say $fh "id,name"; say $fh "1,Brown"; say $fh "2,Smith"; say $fh "7,Smith"; say $fh "8,Green"; close $fh; my $dbh = DBI->connect ( 'dbi:CSV:', undef, undef, { RaiseError => 1, f_ext => '.csv', }); my $table = 'test'; say "\nSELECT 1"; my $sth = $dbh->prepare ( "SELECT MAX( id ) FROM $table WHERE name LIKE 'Smith'" ); $sth->execute (); $sth->dump_results(); say "\nSELECT 2"; $sth = $dbh->prepare ( "SELECT * FROM $table WHERE id = MAX( id )" ); $sth->execute (); $sth->dump_results(); outputs: SELECT 1 '7' 1 rows SELECT 2 Unknown function 'MAX' at /usr/lib/perl5/site_perl/5.10.0/SQL/Parser.pm line 2893. DBD::CSV::db prepare failed: Unknown function 'MAX' at /usr/lib/perl5/site_perl/5.10.0/SQL/Parser.pm line 2894. [for Statement "SELECT * FROM test WHERE id = MAX( id )"] at ./so_3.pl line 30. DBD::CSV::db prepare failed: Unknown function 'MAX' at /usr/lib/perl5/site_perl/5.10.0/SQL/Parser.pm line 2894. [for Statement "SELECT * FROM test WHERE id = MAX( id )"] at ./so_3.pl line 30. Could someone explaine me this behavior?

    Read the article

  • JQuery methods and DOM properties

    - by Bob Smith
    I am confused as to when I can use the DOM properties and when I could use the Jquery methods on a Jquery object. Say, I use a selector var $elemSel = $('#myDiv').find('[id *= \'select\']') At this point, $elemSel is a jquery object which I understand to be a wrapper around the array of DOM elements. I could get a reference to the DOM elements by iterating through the $elemSel object/array (Correct?) My questions: 1. Is there a way to convert this $elemSel into a non JQuery regular array of DOM elements? 2. Can I combine DOM properties and JQuery methods at the same time (something like this) $elemSel.children('td').nodeName (nodeName is DOM related, children is JQuery related) EDIT: What's wrong with this? $elemSel.get(0).is(':checked') EDIT 2: Thanks for the responses. I understand now that I can use the get(0) to get a DOM element. Additional questions: How would I convert a DOM element to a JQuery object? If I assign "this" to a variable, is that new var DOM or JQuery? If it's JQuery, how can I convert this to a DOM element? (Since I can't use get(0)) var $elemTd = $(this); When I do a assignment like the one above, I have seen some code samples not include the $ sign for the variable name. Why? And as for my original question, can I combine the DOM properties and JQuery functions at the same time on a JQuery object? $elemSel.children('td').nodeName

    Read the article

  • Overlapping 2 Flash objects and controlling z-index

    - by Magnus Smith
    I have two Flash objects on a webpage (call them A and B), and they overlap so one partially obscures the other. I don't seem to have any control over the z-index, to force B in front of A. Whatever I try, A always 'wins' and stays on the top! I have read many people's posts about problem with getting HTML to show over the top of Flash...but nothing about when your two overlapping items are both Flash objects. I have tried various combinations of wmode=opaque/transparent/window I have tried CSS position:absolute/relative and z-index:0/999 I have tried placing the HTML sections in a different order The problem is the same in IE6 and Firefox 2.0 I do not want to use jQuery in this case In my particular situation B must have position:absolute and wmode=transparent, and sit above A. A needs relative positioning and transparency is not required. However, I have been testing without these restrictions, and I still have no control over the overlap. Are some SWFs (ours are adverts sent by clients) created in such a way as to override any code control of z-index? Thanks for any advice you can give.

    Read the article

  • Better algorithm for estimating download time

    - by Scott Smith
    We've all seen the download time running estimate that initially says something like "7 days", but keeps dropping wildly (e.g. "23 hours", "45 minutes", "1 min. 50 sec", etc) with each successive estimation as the chunks are downloaded. To avoid these initial (alarming) estimates, there are techniques one could try like suppressing display of the first n estimates, or waiting for the delta between estimates to drop below some threshold before you start displaying them, but these don't seem like a general, robust solution. There are corner cases involving too few samples, or samples that actually are wildly varying... I think I recall a general solution for this kind of thing in mathematics (statistics?) that reduced or eliminated these wild values. Does anyone know?

    Read the article

< Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >