Search Results

Search found 973 results on 39 pages for 'patrick horn'.

Page 3/39 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • SQL: GROUP BY after JOIN without overriding rows?

    - by krismeld
    I have a table of basketball leagues, a table af teams and a table of players like this: LEAGUES ID | NAME | ------------------ 1 | NBA | 2 | ABA | TEAMS: ID | NAME | LEAGUE_ID ------------------------------ 20 | BULLS | 1 21 | KNICKS | 2 PLAYERS: ID | TEAM_ID | FIRST_NAME | LAST_NAME | --------------------------------------------- 1 | 21 | John | Starks | 2 | 21 | Patrick | Ewing | Given a League ID, I would like to retrieve all the players' names and their team ID from all the teams in that league, so I do this: SELECT t.id AS team_id, p.id AS player_id, p.first_name, p.last_name FROM teams AS t JOIN players AS p ON p.team_id = t.id WHERE t.league_id = 1 which returns: [0] => stdClass Object ( [team_id] => 21 [player_id] => 1 [first_name] => John [last_name] => Starks ) [1] => stdClass Object ( [team_id] => 21 [player_id] => 2 [first_name] => Patrick [last_name] => Ewing ) + around 500 more objects... Since I will use this result to populate a dropdown menu for each team containing each team's list of players, I would like to group my result by team ID, so the loop to create these dropdowns will only have to cycle through each team ID instead of all 500+ players each time. But when I use the GROUP BY like this: SELECT t.id AS team_id, p.id AS player_id, p.first_name, p.last_name FROM teams AS t JOIN players AS p ON p.team_id = t.id WHERE t.league_id = 1 GROUP BY t.id it only returns one player from each team like this, overriding all the other players on the same team because of the use of the same column names. [0] => stdClass Object ( [team_id] => 21 [player_id] => 2 [first_name] => Patrick [last_name] => Ewing ) [1] => stdClass Object ( [team_id] => 22 [player_id] => 31 [first_name] => Shawn [last_name] => Kemp ) etc... I would like to return something like this: [0] => stdClass Object ( [team_id] => 2 [player_id1] => 1 [first_name1] => John [last_name1] => Starks [player_id2] => 2 [first_name2] => Patrick [last_name2] => Ewing +10 more players from this team... ) +25 more teams... Is it possible somehow?

    Read the article

  • Undefined referencec to ...

    - by Patrick LaChance
    I keep getting this error message every time I try to compile, and I cannot find out what the problem is. any help would be greatly appreciated: C:\DOCUME~1\Patrick\LOCALS~1\Temp/ccL92mj9.o:main.cpp:(.txt+0x184): undefined reference to 'List::List()' C:\DOCUME~1\Patrick\LOCALS~1\Temp/ccL92mj9.o:main.cpp:(.txt+0x184): undefined reference to 'List::add(int)' collect2: ld returned 1 exit status code: //List.h ifndef LIST_H define LIST_H include //brief Definition of linked list class class List { public: /** \brief Exception for operating on empty list */ class Empty : public std::exception { public: virtual const char* what() const throw(); }; /** \brief Exception for invalid operations other than operating on an empty list */ class InvalidOperation : public std::exception { public: virtual const char* what() const throw(); }; /** \brief Node within List */ class Node { public: /** data element stored in this node */ int element; /** next node in list / Node next; /** previous node in list / Node previous; Node (int element); ~Node(); void print() const; void printDebug() const; }; List(); ~List(); void add(int element); void remove(int element); int first()const; int last()const; int removeFirst(); int removeLast(); bool isEmpty()const; int size()const; void printForward() const; void printReverse() const; void printDebug() const; /** enables extra output for debugging purposes */ static bool traceOn; private: /** head of list */ Node* head; /** tail of list */ Node* tail; /** count of number of nodes */ int count; }; endif //List.cpp I only included the parts of List.cpp that might be the issue include "List.h" include include using namespace std; List::List() { //List::size = NULL; head = NULL; tail = NULL; } List::~List() { Node* current; while(head != NULL) { current = head- next; delete current-previous; if (current-next!=NULL) { head = current; } else { delete current; } } } void List::add(int element) { Node* newNode; Node* current; newNode-element = element; if(newNode-element head-element) { current = head-next; } else { head-previous = newNode; newNode-next = head; newNode-previous = NULL; return; } while(newNode-element current-element) { current = current-next; } if(newNode-element <= current-element) { newNode-previous = current-previous; newNode-next = current; } } //main.cpp include "List.h" include include using namespace std; //void add(int element); int main (char** argv, int argc) { List* MyList = new List(); bool quit = false; string value; int element; while(quit==false) { cinvalue; if(value == "add") { cinelement; MyList-add(element); } if(value=="quit") { quit = true; } } return 0; } I'm doing everything I think I'm suppose to be doing. main.cpp isn't complete yet, just trying to get the add function to work first. Any help will be greatly appreciated.

    Read the article

  • iPad UISplitView initial state in portrait: how to display popover controller widget?

    - by Patrick Linskey
    Hi, I'm working on an iPad app that uses a UISplitView. Inspired by http://blog.blackwhale.at/2010/04/your-first-ipad-split-view-application/, I display a button in my detail view when in portrait mode that shows the popover controller. This works great. However, the appropriate UISplitViewControllerDelegate message is only sent when the device rotates. So, when the app first loads (in portrait mode), my navigation button is not visible. Is it possible to somehow convince the UISplitViewController to send that message on load or something, or do I need to re-implement my own popover logic to get things working? Thanks, -Patrick

    Read the article

  • Umbraco CMS - keep getting logged out in ie, safari, chrome but not ff

    - by Daniel Horn
    I have a few Umbraco sites running on my server - but i'm getting logged out when using everything else than Firefox when using umbraco. I'm able to log in and after 10-15 sec's i'm being automatically logged out again. How can that be and how do i fix it? :( It's a win 2008 server using MSSQL database and umbraco 4.0.3 btw is running on integrated app pool and .net version 2.0.50727

    Read the article

  • Galleria and Infinite carousel and ajax

    - by John the horn
    Hy all you smart people I am using Galleria plugin for a image gallery on a page this page is loaded in a frame page using ajax this is the ajax $(document).ready(function() { function loadTab(pageUrl) { $.ajax( { url: pageUrl, cache: true, success: function(load) { $("#tabcontent").empty().append(load); } }); } $(document).ready(function() { $("#tab1").ready(function() { loadTab("acasa.html"); }); $("#tab1").click(function() { loadTab("acasa.html"); }); $("#tab2").click(function() { loadTab("desprenoi.html"); }); $("#tab3").click(function() { loadTab("servici.html"); }); $("#tab4").click(function() { loadTab("parteneri.html"); }); $("#tab5").click(function() { loadTab("galerie.html"); }); $("#tab6").click(function() { loadTab("contact.php"); }); }); }); On the frame page Im using Infinite gallery that uses <ul></ul> tags my problem is that offline, testing the page it works perfect but on the server(online) the gallery using galleria goes to the dogs. What I mean is that I have in stead of the gallery the a list of all the images. Can enione help this pore nube ? Thx for your time. P.S. Can enyone help me find a better ajax script :D

    Read the article

  • ASP.Net: User controls added to placeholder dynamically cannot retrieve values.

    - by Steve Horn
    I am adding some user controls dynamically to a PlaceHolder server control. My user control consists of some labels and some textbox controls. When I submit the form and try to view the contents of the textboxes (within each user control) on the server, they are empty. When the postback completes, the textboxes have the data that I entered prior to postback. This tells me that the text in the boxes are being retained through ViewState. I just don't know why I can't find them when I'm debugging. Can someone please tell me why I would not be seeing the data the user entered on the server? Thanks for any help.

    Read the article

  • Entity Framework Performance Problem

    - by Steve Horn
    I'm hoping that someone can help me understand how to overcome a performance problem I'm running into with the latest version of the Entity Framework. In my test, I created my model from a database consisting of around 80 tables. The problem that I'm running into is that the cost of the very first query I run on a thread is very expensive. If I run without pre-compiling views the first query takes anywhere from 5800 to 6600 milliseconds. If I pre-compile the views (see this article) I can get the initial query cost down to about 2800 to 3200 milliseconds. 3 seconds for each request is still unacceptable for my needs. Subsequent queries are very fast. Can you please help me understand how to eliminate the poor performance of the initial query? I'm using the version of entity framework that ships with Visual Studio 2010 RC.

    Read the article

  • continuous music on website

    - by Patrick
    Hi all, I'm against it as I'm sure ALL of you are, but my client wants background music on their website. I'm very new to this, so was wondering how should I do that? I know I should use iframes, but what's the actual way of using them? eg: do I just create the home page with 2 frames (one for the music, one for the rest of the website), and then every time the user clicks on a link I can load the usual destination page - or should I update all pages in some way to make sure they are 'frames enabled'? Also, I do I style the frame to make sure it's hidden? thanks, Patrick ps please don't reopen the discussion about why background music is not good - I do know that and personally hate it. But the client is adamant and paying for it so... ;)

    Read the article

  • Linq to SQL with INSTEAD OF Trigger and an Identity Column

    - by Bob Horn
    I need to use the clock on my SQL Server to write a time to one of my tables, so I thought I'd just use GETDATE(). The problem is that I'm getting an error because of my INSTEAD OF trigger. Is there a way to set one column to GETDATE() when another column is an identity column? This is the Linq-to-SQL: internal void LogProcessPoint(WorkflowCreated workflowCreated, int processCode) { ProcessLoggingRecord processLoggingRecord = new ProcessLoggingRecord() { ProcessCode = processCode, SubId = workflowCreated.SubId, EventTime = DateTime.Now // I don't care what this is. SQL Server will use GETDATE() instead. }; this.Database.Add<ProcessLoggingRecord>(processLoggingRecord); } This is the table. EventTime is what I want to have as GETDATE(). I don't want the column to be null. And here is the trigger: ALTER TRIGGER [Master].[ProcessLoggingEventTimeTrigger] ON [Master].[ProcessLogging] INSTEAD OF INSERT AS BEGIN SET NOCOUNT ON; SET IDENTITY_INSERT [Master].[ProcessLogging] ON; INSERT INTO ProcessLogging (ProcessLoggingId, ProcessCode, SubId, EventTime, LastModifiedUser) SELECT ProcessLoggingId, ProcessCode, SubId, GETDATE(), LastModifiedUser FROM inserted SET IDENTITY_INSERT [Master].[ProcessLogging] OFF; END Without getting into all of the variations I've tried, this last attempt produces this error: InvalidOperationException Member AutoSync failure. For members to be AutoSynced after insert, the type must either have an auto-generated identity, or a key that is not modified by the database after insert. I could remove EventTime from my entity, but I don't want to do that. If it was gone though, then it would be NULL during the INSERT and GETDATE() would be used. Is there a way that I can simply use GETDATE() on the EventTime column for INSERTs? Note: I do not want to use C#'s DateTime.Now for two reasons: 1. One of these inserts is generated by SQL Server itself (from another stored procedure) 2. Times can be different on different machines, and I'd like to know exactly how fast my processes are happening.

    Read the article

  • Error Galleria IE7

    - by John the horn
    I am using galleria for my site [Minavet.ro][1] [1]: http://minavet.ro and this error comes up is IE7 Line:219079877 Char:2 Error:Expected identifier, string number code:0 url:http://minavet.ro Thx for your time I have given the images width and height and now the error is Line:222704333 Char:2 Error:Expected identifier, string number code:0 url:http://minavet.ro

    Read the article

  • JUnit: 4.8.1 "Could not find class"

    - by Patrick
    Ok, I am like other and new to jUnit and having a difficult time trying to get it working. I have searched the forum but the answers provided; I am just not getting. If anyone out there could lend me a hand I would greatly appreciate it. Let me provide the basics: OS: mac OS X.6 export JUNIT_HOME="/Developer/junit/junit4.8.1" export CVSROOT="/opt/cvsroot" export PATH="/usr/local/bin:/usr/local/sbin:/usr/localmysql/bin:/opt/PalmSDK/Current/bin/:/usr/local/mysql/bin:$PATH:$JUNIT_HOME:$CVSROOT" export CLASSPATH="$CLASSPATH:$JUNIT_HOME/junit-4.8.1.jar:$JUNIT_HOME" I can compile a test class from a java file, however when I try to then run the test java org.junit.runner.JUnitCore MyTest.class I get the following: JUnit version 4.8.1 Could not find class: MyTest.class Time: 0.001 OK (0 tests) Now I have been in the directory with the MyTest.class which is just somewhere in my file system, I tried moving the source folder to the "junit" folder and the "junit/junit4.8.1" folder and the same result. I cannot even run the tests that came with junit. Thanks patrick

    Read the article

  • Capture and display console output at the same time

    - by Patrick
    Hi, MSDN states that it is possible in .NET to capture the output of a process and display it in the console window at the same time. Normally when you set StartInfo.RedirectStandardOutput = true; the console window stays blank. As the MSDN site doesn't provide a sample for this I was wondering if anyone would have a sample or could point me to a sample? When a Process writes text to its standard stream, that text is normally displayed on the console. By redirecting the StandardOutput stream, you can manipulate or suppress the output of a process. For example, you can filter the text, format it differently, or write the output to both the console and a designated log file. MSDN This post is similar to http://stackoverflow.com/questions/786726/capture-standard-output-and-still-display-it-in-the-console-window by the way. But that post didn't end up with a working sample. Thanks a lot, Patrick

    Read the article

  • jquery pagination plugin problem

    - by John the horn
    I am using a pagination plugin called "pagination". Here is the script that is initialized : function pageselectCallback(page_index, jq){ var new_content = jQuery('#hiddenresult div.result:eq('+page_index+')').clone(); $('#Searchresult').empty().append(new_content); return false; } /** * Initialisation function for pagination */ function initPagination() { // count entries inside the hidden content var num_entries = jQuery('#hiddenresult div.result').length; // Create content inside pagination element $("#Pagination").pagination(num_entries, { callback: pageselectCallback, items_per_page:1 // Show only one item per page }); } // When document is ready, initialize pagination $(document).ready(function(){ initPagination(); }); and I am using this script for accordation on the page : <script type="text/javascript"> $(document).ready(function(){ $('#content').show(); $('#content1').hide(); $('#content2').hide(); $('#content3').hide(); $('#content4').hide(); $('#content5').hide(); $('a.bucatarii_serie').click(function(){ $("div[id^='content']").hide(); $('#content').toggle('slow'); }); $('a.livinguri_serie').click(function(){ $("div[id^='content']").hide(); $('#content1').toggle('slow'); }); $('a.dormitoare_serie').click(function(){ $("div[id^='content']").hide(); $('#content2').toggle('slow'); }); $('a.tratamente').click(function(){ $("div[id^='content']").hide(); $('#content3').toggle('slow'); }); $('a.chirurgie').click(function(){ $("div[id^='content']").hide(); $('#content4').toggle('slow'); }); $('a.frizerie').click(function(){ $("div[id^='content']").hide(); $('#content5').toggle('slow'); }); }); </script> My problem is that I don't know how to implement multiple paginations on the same page in diferent containers but in a bigger container.

    Read the article

  • Graphing a line and scatter points using Matplotlib?

    - by Patrick O'Doherty
    Hi guys I'm using matplotlib at the moment to try and visualise some data I am working on. I'm trying to plot around 6500 points and the line y = x on the same graph but am having some trouble in doing so. I can only seem to get the points to render and not the line itself. I know matplotlib doesn't plot equations as such rather just a set of points so I'm trying to use and identical set of points for x and y co-ordinates to produce the line. The following is my code from matplotlib import pyplot import numpy from pymongo import * class Store(object): """docstring for Store""" def __init__(self): super(Store, self).__init__() c = Connection() ucd = c.ucd self.tweets = ucd.tweets def fetch(self): x = [] y = [] for t in self.tweets.find(): x.append(t['positive']) y.append(t['negative']) return [x,y] if __name__ == '__main__': c = Store() array = c.fetch() t = numpy.arange(0., 0.03, 1) pyplot.plot(array[0], array[1], 'ro', t, t, 'b--') pyplot.show() Any suggestions would be appreciated, Patrick

    Read the article

  • Mercurial local branching and pushing to shared repository

    - by Steve Horn
    I created a branch on my local Mercurial repository. I want to push to the shared repository so my work can be backed up, but I don't want other project members to see the branch. What's the standard operating procedure in this case? I'd like to avoid having the repository get full of developer branches that I don't need to see.

    Read the article

  • CSS Expand Parent Div To Child Height

    - by Steve Horn
    I have a page structure similar to this: <body> <div id="parent"> <div id="childRightCol"> <div> <div id="childLeftCol"> <div> </div> </body> I would like for the parent div to expand in height when the inner div height expands. Edit: One caveat is that if/when the width of the child content expands past the width of the browser window, my current CSS puts a horizontal scroll on the parent div. I would like the scrollbar to be at the page level. (Currently my parent div is set to overflow: auto;) Can you please help me with the CSS for this?

    Read the article

  • C# / Visual Studio: production and test code placement

    - by Patrick Linskey
    Hi, In JavaLand, I'm used to creating projects that contain both production and test code. I like this practice because it simplifies testing of internal code without artificially exposing the internals in a project's published API. So far, in my experiences with C# / Visual Studio / ReSharper / NUnit, I've created separate projects (i.e., separate DLLs) for production and test code. Is this the idiom, or am I off base? If this idiomatically correct, what's the right way to deal with exposing classes and methods for test purposes? Thanks, -Patrick

    Read the article

  • Web service can't open named pipe - access denied

    - by Patrick
    Hi All, I've got a C++ service which provides a named pipe to clients with a NULL SECURITY_ATTRIBUTES as follows: hPipe = CreateNamedPipe( lpszPipename, PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, BUFSIZE, BUFSIZE, 0, NULL); There is a dll which uses this pipe to get services. There is a c# GUI which uses the dll and works fine. There is a .net web site which also uses this dll (the exact same one on the same PC) but always gets permission denied when it tries to open the pipe. Any one know why this might happen and how to fix it? Also does anyone know of a good tutorial on SECURITY_ATTRIBUTES because I haven't understood the msdn info yet. Thanks, Patrick

    Read the article

  • Exceptions and Access Violations in Paint events in Windows

    - by Patrick
    After executing some new code, my C++ application started to behave strange (incorrect or incomplete screen updates, sometimes no screen updates at all). After a while we found out that the new code is causing an Access Violation. Strange enough, the application simply keeps on running (but with the incorrect screen updates). At first we thought the problem was caused by a "try-catch(...)" construction (put there by an overactive ex-colleague), but several hours later (carefully inspecting the call stacks, adding many breakpoints, ...) we found out that if there's an Access Violation in a paint event, Windows catches it, and simply continues running the application. Is this normal behavior? Is it normal that Windows catches exceptions/errors during a paint event? Is there a way to disable this? (if not, it would mean that we have to always run in the debugger with all exceptions enabled while testing our code). Patrick

    Read the article

  • Toggle problem pls help me

    - by John the horn
    Hy I am a uber nube to jquery my question is like this: if I have multiple toggle on same page and the div I`m toggleing must be desplayed in the same div. For example I have in div 'box' 6 divs named '1' '2' '3' '4' etc and all are hiden if I click on a 'a' tag named 1 it will display content div 1 in div 'box' if I click tag 'a' named 2 will display content div 2 in box and hide div 1 etc. My problem is that I havent been able to hide div 1 if div 2 is show This is my code $(document).ready(function(){ $('#content1').hide(); $('#content').hide(); $('a.aici').click(function(){ $('#content1').toggle('slow'); }); $('a.acolo').click(function(){ $('#content').toggle('slow'); }); }); I need an if function to hide all except the div that is shown Thx for your time

    Read the article

  • Undefined reference to ...

    - by Patrick LaChance
    I keep getting this error message every time I try to compile, and I cannot find out what the problem is. any help would be greatly appreciated: C:\DOCUME~1\Patrick\LOCALS~1\Temp/ccL92mj9.o:main.cpp:(.txt+0x184): undefined reference to 'List::List()' C:\DOCUME~1\Patrick\LOCALS~1\Temp/ccL92mj9.o:main.cpp:(.txt+0x184): undefined reference to 'List::add(int)' collect2: ld returned 1 exit status code: //List.h #ifndef LIST_H #define LIST_H #include <exception> //brief Definition of linked list class class List { public: /** \brief Exception for operating on empty list */ class Empty : public std::exception { public: virtual const char* what() const throw(); }; /** \brief Exception for invalid operations other than operating on an empty list */ class InvalidOperation : public std::exception { public: virtual const char* what() const throw(); }; /** \brief Node within List */ class Node { public: /** data element stored in this node */ int element; /** next node in list */ Node* next; /** previous node in list */ Node* previous; Node (int element); ~Node(); void print() const; void printDebug() const; }; List(); ~List(); void add(int element); void remove(int element); int first()const; int last()const; int removeFirst(); int removeLast(); bool isEmpty()const; int size()const; void printForward() const; void printReverse() const; void printDebug() const; /** enables extra output for debugging purposes */ static bool traceOn; private: /** head of list */ Node* head; /** tail of list */ Node* tail; /** count of number of nodes */ int count; }; #endif //List.cpp I only included the parts of List.cpp that might be the issue #include "List.h" #include <iostream> #include <iomanip> using namespace std; List::List() { //List::size = NULL; head = NULL; tail = NULL; } List::~List() { Node* current; while(head != NULL) { current = head-> next; delete current->previous; if (current->next!=NULL) { head = current; } else { delete current; } } } void List::add(int element) { Node* newNode; Node* current; newNode->element = element; if(newNode->element > head->element) { current = head->next; } else { head->previous = newNode; newNode->next = head; newNode->previous = NULL; return; } while(newNode->element > current->element) { current = current->next; } if(newNode->element <= current->element) { newNode->previous = current->previous; newNode->next = current; } } //main.cpp #include "List.h" #include <iostream> #include <string> using namespace std; //void add(int element); int main (char** argv, int argc) { List* MyList = new List(); bool quit = false; string value; int element; while(quit==false) { cin>>value; if(value == "add") { cin>>element; MyList->add(element); } if(value=="quit") { quit = true; } } return 0; } I'm doing everything I think I'm suppose to be doing. main.cpp isn't complete yet, just trying to get the add function to work first. Any help will be greatly appreciated.

    Read the article

  • Inject WCF proxy with credentials using StructureMap

    - by Steve Horn
    I have a service proxy generated by svcutil which generated an interface(IStudentContract) and a concrete type implementing (StudentContractClient). I'd like to have instances of StudentContractClient injected into my classes via StructureMap. My proxy also needs to have credentials supplied as seen in this passing unit test: <Test()> _ Public Sub Then_the_web_service_call_should_not_throw_an_exception() Dim studentServiceProxy As New StudentContractClient Dim credential As New NetworkCredential credential.Domain = ConfigurationManager.AppSettings("something") credential.UserName = ConfigurationManager.AppSettings("something") credential.Password = ConfigurationManager.AppSettings("something") studentServiceProxy.ClientCredentials.Windows.ClientCredential = credential Dim result = studentServiceProxy.GetCurrentTeachersByStudentSepid(26899) result.Count.ShouldEqual(4) End Sub My question is what would the structuremap configuration look like to have instances of IStudentContract injected with the credentials supplied? Thanks for any help!

    Read the article

  • Are there any modern platforms with non-IEEE C/C++ float formats?

    - by Patrick Niedzielski
    Hi all, I am writing a video game, Humm and Strumm, which requires a network component in its game engine. I can deal with differences in endianness easily, but I have hit a wall in attempting to deal with possible float memory formats. I know that modern computers have all a standard integer format, but I have heard that they may not all use the IEEE standard for floating-point integers. Is this true? While certainly I could just output it as a character string into each packet, I would still have to convert to a "well-known format" of each client, regardless of the platform. The standard printf() and atod() would be inadequate. Please note, because this game is a Free/Open Source Software program that will run on GNU/Linux, *BSD, and Microsoft Windows, I cannot use any proprietary solutions, nor any single-platform solutions. Cheers, Patrick

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >