Search Results

Search found 9093 results on 364 pages for 'three cups'.

Page 15/364 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • mysql - joining three tables with HAVING

    - by Qiao
    I have table: id name type where "type" is 1 or 2 I need to join this table with two other. Rows with "type = 1" should be joined with first table, and =2 with second. Something like SELECT * FROM tbl INNER JOIN tbl_1 ON tbl.name = tbl_1.name HAVING tbl.type = 1 INNER JOIN tbl_2 ON tbl.name = tbl_2.name HAVING tbl.type = 2 But it does not working. How it can be implemented?

    Read the article

  • Rails: three most recent comments for unique users

    - by Dennis Collective
    class User has_many :comments end class Comment belongs_to :user named_scope :recent, :order => 'comments.created_at DESC' named_scope :limit, lambda { |limit| {:limit => limit}} named_scope :by_unique_users end what would I put in the :by_unique_users so that I can do Comment.recent.by_unique_users.limit(3), and only get one comment per user

    Read the article

  • Three State Treeview Windows Forms

    - by alhambraeidos
    Hello everybody people, One of the frustrations with the standard TreeView is that you can't show a partial selection to indicate that some of the children are selected. A partial selection in a complex tree allows the user to easily determine where the selections are, even if the tree is not completely expanded. A similar idea is used in manu backup programs to allow the user to select the files to be backed up. Does anyone know of a way to make the checks in a treeview checkbox gray? I want to gray the check of a parent node when some (but not all) of its child nodes are checked. Kinda like what you see when you are selecting options to install during a software installation. I have seen several post, but is older (2000, 2007 year). I now, in 2010, the better answer possible is required. I use VS 2008 . Net 3.5 , Windows Forms Thanks in advanced, greetings

    Read the article

  • Remove pointer object whose reference is mantained in three different lists

    - by brainydexter
    I am not sure how to approach this problem: 'Player' class mantains a list of Bullet* objects: class Player { protected: std::list< Bullet* > m_pBullet_list; } When the player fires a Bullet, it is added to this list. Also, inside the constructor of bullet, a reference of the same object is updated in CollisionMgr, where CollisionMgr also mantains a list of Bullet*. Bullet::Bullet(GameGL*a_pGameGL, Player*a_pPlayer) : GameObject( a_pGameGL ) { m_pPlayer = a_pPlayer; m_pGameGL->GetCollisionMgr()->AddBullet(this); } class CollisionMgr { void AddBullet(Bullet* a_pBullet); protected: std::list< Bullet*> m_BulletPList; } In CollisionMgr.Update(); based on some conditions, I populate class Cell which again contain a list of Bullet*. Finally, certain conditions qualify a Bullet to be deleted. Now, these conditions are tested upon while iterating through a Cell's list. So, if I have to delete the Bullet object, from all these places, how should I do it so that there are no more dangling references to it? std::list< Bullet*>::iterator bullet_it; for( bullet_it = (a_pCell->m_BulletPList).begin(); bullet_it != (a_pCell->m_BulletPList).end(); bullet_it++) { bool l_Bullet_trash = false; Bullet* bullet1 = *bullet_it; // conditions would set this to true if ( l_Bullet_Trash ) // TrashBullet( bullet1 ); continue; } Also, I was reading about list::remove, and it mentions that it calls the destructor of the object we are trying to delete. Given this info, if I delete from one list, the object does not exist, but the list would still contain a reference to it..How do I handle all these problems ? Can someone please help me here ? Thanks PS: If you want me to post more code or provide explanation, please do let me know.

    Read the article

  • Filter across three tables using Django

    - by Vanessa MacDougal
    I have 3 django models, where the first has a foreign key to the second, and the second has a foreign key to the third. Like this: class Book(models.Model): year_published = models.IntField() author = models.ForeignKey(Author) class Author(models.Model): author_id = models.AutoField(primary_key=True) name = models.CharField(max_length=50) agent = models.ForeignKey(LitAgent) class LitAgent(models.Model): agent_id = models.AutoField(primary_key=True) name = models.CharField(max_length=50) I want to ask for all the literary agents whose authors had books published in 2006, for example. How can I do this in Django? I have looked at the documentation about filters and QuerySets, and don't see an obvious way. Thanks.

    Read the article

  • Git from localhost to remotehost with a team of three

    - by Mark McDonnell
    Hi, I'm completely new to Git. I've only just worked out how to use Github in a basic way (e.g. push my local file changes to Github - so I've not done 'pulling' down of content from Github and 'merging' it into my localhost version or anything like that). I had a look over at this existing question - Git: localhost remote development remote production - but I think it may have been a bit advanced for me at this stage as I didn't quite understand the terminology that most of the people were using. What I would like to achieve is to have a local server set-up that my team of developers can all 'push' to/'pull' from etc. And then have that local server upload any updated files automatically to our web server so we could see the updates live in the browser. I'm happy to get a server set-up in the office running Mac OSX Server and then installing Git on it and then getting the devs to write a shell script to push to the remote server but only if it was fairly easy for the devs local git to push to this new local server. I'm not a network engineer so I don't know what would need to be set-up for that to work, I know obviously we could set-up the server to be accessible via a local ip address like 192.168.0.xxx but not sure how that works with pushing to a git repository on that server? Would that literally be something like doing this on my local machine: git remote add MyGitFile git://192.168.0.xxx/MyGitFile.git ? Any ideas or advice you can give to a total Git newbie trying to help his team get a better work flow. Kind regards, Mark

    Read the article

  • mySQL: Joining three tables - how?

    - by Industrial
    Hi everybody, I have the following query in my application. It works well, but I need it to also contain the number of products that are associated with each manufacturer. The current query: SELECT * FROM (`manufacturers`) JOIN `languages` ON `manufacturers`.`lang` = `languages`.`id` ORDER BY `languages`.`id` asc, `id` asc My products table looks like this: id | name | manufacturerid 0 | Product1 | 0

    Read the article

  • Using a join with three tables when a field might be null

    - by John
    Hello, The code below works great. It combines data from two MySQL tables. I would like to modify it by pulling in some data from a third MySQL table called "comment." In the HTML table below, "title" is a field in the MySQL table "submission." Every "title" has a corresponding "submissionid" field. The field "submissionid" is also found in the "comment" MySQL table. In the HTML table below, I would like "countComments" to equal the number of times a field called "commentid" appears in the MySQL table "comment" for any given "submissionid," where the "submissionid" is the same in both the "submission" and "comment" tables, and where the "submissionid" corresponds to the "title" being used. Here's the catch: if there is no row in the MySQL table "comment" that corresponds with the "submissionid" being used for "table", I would like "countComments" to equal to zero. How can I do this? Thanks in advance, John $sqlStr = "SELECT s.loginid, s.title, s.url, s.displayurl, l.username FROM submission AS s, login AS l WHERE s.loginid = l.loginid ORDER BY s.datesubmitted DESC LIMIT 10"; $result = mysql_query($sqlStr); $arr = array(); echo "<table class=\"samplesrec\">"; while ($row = mysql_fetch_array($result)) { echo '<tr>'; echo '<td class="sitename1"><a href="http://www.'.$row["url"].'">'.$row["title"].'</a></td>'; echo '</tr>'; echo '<tr>'; echo '<td class="sitename2"><a href="http://www...com/sandbox/members/index.php?profile='.$row["username"].'">'.$row["username"].'</a><a href="http://www...com/sandbox/comments/index.php?submission='.$row["title"].'">'.$row["countComments"].'</a></td>'; echo '</tr>'; } echo "</table>";

    Read the article

  • Rails: three most recent records by unique belongs_to associated record

    - by Dennis Collective
    class User has_many :comments end class Comment belongs_to :user named_scope :recent, :order => 'comments.created_at DESC' named_scope :limit, lambda { |limit| {:limit => limit}} named_scope :by_unique_users end what would I put in the :by_unique_users so that I can do Comment.recent.by_unique_users.limit(3), and only get one comment per user on sqlite named_scope :by_unique_user, :group = "user_id" works, but makes it freak out on postgres, which is deployed on production PGError: ERROR: column "comments.id" must appear in the GROUP BY clause or be used in an aggregate function

    Read the article

  • .rdlc reporting bound to Object Data Source in Three layer Application

    - by Saeedouv
    Hi, i have the following situation, i have a Reporting layer(stand alone) in asp.net application(NOT website, this means NO App_Code folder exists), and i want just to create Object Data Source to take an Object in a separate layer(lets say from Data Access Layer), and then to use that Object Data Source to create a report, i have spent my whole day working around that, tons of work around's and articles on the web, but does not mention what i really want to do, any answer is appriciated... just to make things more clear here, assume the following: i have a solution with the follwoing layers, UI Reporting(has NO Employees object) just a reference Business Logic Data Access Layer(Employees--GetEmployees(), all i need is as mentioned above, i want to create Object Data Source from Reporting layer, to take Employee object from DAL, and then use it's GetEmployees method to be added to report, i think its more clear now, since also Reporting layer has NO App_Code folder.

    Read the article

  • Truncate text if it atempts to run into three lines

    - by Jigs
    I have a small about 140px wide aligned next to a picture. In total there is space for four lines of text. The first two lines are reserved for the title and there are two lines of other info. I want the title to be cut if it spans more than two lines else it will push the other info out of line with the bottom of the image. The only solution I could think of was to create a div the height of two lines with an overflow to hidden. However, if the title is only one line it leaves a big gap. The solution can be Jquery, plain javascript, CSS or even PHP (if its possible). TIA

    Read the article

  • Prevent the groupfield from repeating every three rows

    - by Aaron
    I have a web app and I need to integrate some JasperReports in this app. So I downloaded iReport and I used the templates. I choose the LeafGreen template, but I have a problem. When I have more than 4 elemets in my list, my headers gets repeated every 4 elements (see the image:) - I don't want this; once is enough. The problem: http://i39.tinypic.com/9kcp6p.jpg This is the template: http://i44.tinypic.com/2ags1w1.jpg What I'm doing wrong?

    Read the article

  • Creating a view linking three different node types with two node references

    - by mikesir87
    I have the following content types: Camp - the top level type Registration Information - contains node reference to Camp called Camp Medical Release Form - contains node reference to registration information called Camper I would like to create a View that takes the nid for the Camp, and pulls out all the fields for the Registration Info and Medical Release Form. I'm having trouble figuring out how to set up the various arguments/relationships. I haven't done something that's referenced more than two types. I know it would be smart/best to just combine the Registration Info and Medical Release Form, since it's a 1:1 mapping, but we can't. So... any help would be appreciated!

    Read the article

  • Display only latest three results from PHP and MySQL

    - by nogggin1
    <?php $result = @mysql_query('SELECT Article FROM news WHERE ID = (SELECT MAX(ID) FROM News)'); if (!$result) { die('<p>Error performing query: ' . mysql_error() . '</p>'); } while ( $row = mysql_fetch_array($result) ) { echo('<p>' . $row['Article'] . '</p>'); } ?> basically i need to tweak this so that it shows the latest 3 results instead of just the latest one, also i need the order to be: newest 2nd newest 3rd newest any help would be greatly appreciated!

    Read the article

  • Access COMPORT 1 through three different applications.

    - by Khushi
    Hi I have an SMS Appliaction, which receives the messages through GPS Modem and revert back through GPS Modem. The Modem is using COM1. Now, i need two more appliactions which can send messages through the same GPS Modem. I tried making a webservice which can access the COM1 to send data, but when i try to connect through webService, it throw an error saying, 'COM1 is already occupied, Access denied.'. Can anybody help me to connect through the modem in above scenario. Khushi

    Read the article

  • Letting user carry on after three attempts

    - by sMilbz
    In my spelling game there is a grid that is populated with words. The words are hidden and the aim of the game is to spell the word that is highlighted with the aid of a sound and a picture. To highlight a word you press the "next" button. At the moment if you spell the word correctly it says "well done" and you can advance to the next word, but if you spell it incorrectly you have to keep attempting the word until it is complete. As the game is designed for children I do not think this is the best approach, so I would like to make it so you can advance after 3 incorrect attempts. I have played around with the script so much trying to put counters on incorrect attempts and then making the button active but cannot seem to get it to work. Can someone please help me? Here is the script for the button var noExist = $('td[data-word=' + listOfWords[rndWord].name + ']').hasClass('wordglow2'); if (noExist) { $('.minibutton').click(); } else { $('.minibutton').click('disable'); $("#mysoundclip").attr('src', listOfWords[rndWord].audio); audio.play(); $("#mypic").attr('src', listOfWords[rndWord].pic); pic.show(); } }); "wordglow2" is the style applied if the word is spelt correctly. Here is a fiddle to help understand... http://jsfiddle.net/smilburn/ZAfVZ/4/

    Read the article

  • fluent nhibernate - storing and retrieving three classes in/from one table

    - by Will I Am
    Noob question. I have this situation where I have these objects: class Address { string Street; string City; ... } class User { string UserID; Address BillingAddress; Address MailingAddress; ... } What is the proper way of storing this data using (fluent) nHibernate? I could use a separate Address table and create a reference, but they are 1:1 relationships so I don't really want to incur the overhead of a join. Ideally I would store this as a single flat record. So, my question is, what is the proper way of storing an instance of class 'User' in such a way that it stores its contents and also the two addresses as a single record? My knowledge is failing me on how I can store this information in such a way that the two Address records get different column names (e.g. BillingAddress_Street and MailingAddress_Street, for example), and also how to read a record back into a User instance.

    Read the article

  • MySQL LEFT JOIN issue with three WHERE statements

    - by jhat
    I am building a note taking app for myself with tag filtering functions, but am having an issue when trying to grab notes with the tags. The tag filter needs to use AND not IN, because it will help better narrow down what I am looking for. My tables are configured like this: + notes note_id | note_title | note_uid + tags tag_id | tag_title + notes_tags nt_id | nt_note_id | nt_tag_id The notes_tags table keeps track of all notes' tags. I am not worried about returning any information about tags, so here is an example LEFT JOIN I am using currently to only get notes with only 1 tag. SELECT * FROM notes_tags LEFT JOIN notes ON note_id = nt_note_id WHERE note_uid IN ( 1 ) AND nt_tag_id = 10 This query runs perfect, it grabs all of the notes with that single tag. However, I am having issues "pinpointing" my notes using a query like this: SELECT * FROM notes_tags LEFT JOIN notes ON note_id = nt_note_id WHERE note_uid IN ( 1 ) AND nt_tag_id = 10 AND nt_tag_id = 11 What am I doing wrong with the syntax?

    Read the article

  • Java loop to collect the second and third elements every three in an array

    - by mhollander38
    I have a file with data in the form timestamp, coordinate, coordinate, seperated by spaces, as here; 14:25:01.215 370.0 333.0 I need to loop through and add the coordinates only to an array. The data from the file is read in and put into as String[] called info, from split(" "). I have two problems, I think the end of the file has a extra " " which I need to lose appropriately and I also want confirmation/suggestions of my loop, at the moment I am getting sporadic out of bounds exceptions. My loop is as follows; String[] info; info = dataHolder.split(" "); ArrayList<String> coOrds1 = new ArrayList<String>(); for (int counter = 0; counter < info.length; counter = counter+3) { coOrds1.add(info[counter+1]); coOrds1.add(info[counter+2]); } Help and suggestions appreciated. The text file is here but the class receives in a UDP packet from another class so I am unsure if this potentially adds " " at the end or not.

    Read the article

  • How grouping and totaling are done into three tables using JOIN

    - by text
    Here are my tables respondents: field sample value respondentid : 1 age : 2 gender : male survey_questions: id : 1 question : Q1 answer : sample answer answers: respondentid : 1 question : Q1 answer : 1 --id of survey question I want to display all respondents who answered the certain survey, display all answers and total all the answer and group them according to the age bracket. I tried using this query: $sql = "SELECT res.Age, res.Gender, answer.id, answer.respondentid, SUM(CASE WHEN res.Gender='Male' THEN 1 else 0 END) AS males, SUM(CASE WHEN res.Gender='Female' THEN 1 else 0 END) AS females, CASE WHEN res.Age < 1 THEN 'age1' WHEN res.Age BETWEEN 1 AND 4 THEN 'age2' WHEN res.Age BETWEEN 4 AND 9 THEN 'age3' WHEN res.Age BETWEEN 10 AND 14 THEN 'age4' WHEN res.Age BETWEEN 15 AND 19 THEN 'age5' WHEN res.Age BETWEEN 20 AND 29 THEN 'age6' WHEN res.Age BETWEEN 30 AND 39 THEN 'age7' WHEN res.Age BETWEEN 40 AND 49 THEN 'age8' ELSE 'age9' END AS ageband FROM Respondents AS res INNER JOIN Answers as answer ON answer.respondentid=res.respondentid INNER JOIN Questions as question ON answer.Answer=question.id WHERE answer.Question='Q1' GROUP BY ageband ORDER BY res.Age ASC"; I was able to get the data but the listing of all answers are not present. What's wrong with my query. I want to produce something like this: ex: # of Respondents is 3 ages: 2,3 and 6 Question: what are your favorite subjects? Ages 1-4: subject 1: 1 subject 2: 2 subject 3: 2 total respondents for ages 1-4 : 2 Ages 5-10: subject 1: 1 subject 2: 1 subject 3: 0 total respondents for ages 5-10 : 1

    Read the article

  • Merging Three or More Images -- PHP

    - by bballer13sn
    Before I ask my question, I'd like to thank you all in advance for helping me with this. So here's the question: So, for my website, I've been trying to make it so people's characters (which are currently composed of several pictures that are moved by CSS) are merged into one image as to make my life easier. The chunk of code that currently doesn't work is as follows: $template = $charRow['template']; $gender = $charRow['gender']; $shirt = $charRow['shirt']; $pants = $charRow['pants']; $hat = $charRow['hat']; $templatePic = imagecreatefrompng("Templates/".$template); if (!empty($shirt)) { $shirtPic = imagecreatefrompng($shirt); imagecopy($templatePic,$shirtPic,0,0,0,0,imagesx($templatePic),imagesy($templatePic)); } if (!empty($pants)) { $pantsPic = imagecreatefrompng($pants); imagecopy($templatePic,$pantsPic,0,0,0,0,imagesx($templatePic),imagesy($templatePic)); } if (!empty($hat)) { $hatPic = imagecreatefrompng($hat); imagecopy($templatePic,$hatPic,0,0,0,0,imagesx($templatePic),imagesy($templatePic)); } imagePNG($templatePic, 'Images/'); //Problem line... This is the error PHP is giving me: Warning: imagepng() [function.imagepng]: Unable to open 'Images/' for writing: Is a directory in PathToParentFolderOfFollowingFile/testFile.php on line 139 What exactly does this error mean and how can it be fixed? NOTE: $charRow is not the problem. The query to get that is just not being displayed to all of you.

    Read the article

  • UPDATE MANAGER UNABLE TO UPDATE

    - by muguro
    Requires installation of untrusted packages The action would require the installation of packages from not authenticated sources. i get this error every time i try updating. the system shows that it has 466 updates but fails after clicking update more details have this accountsservice apparmor apport apport-gtk apt apt-transport-https apt-utils aptdaemon aptdaemon-data at-spi2-core bamfdaemon base-files bcmwl-kernel-source bind9-host compiz compiz-core compiz-gnome compiz-plugins-default cron cups cups-bsd cups-client cups-common cups-filters cups-ppdc dbus dbus-x11 dconf-gsettings-backend dconf-service desktop-file-utils dmsetup dnsutils empathy empathy-common eog evince evince-common evolution-data-server evolution-data-server-common firefox firefox-globalmenu firefox-gnome-support firefox-locale-en fontconfig fontconfig-config fonts-liberation fonts-opensymbol foomatic-filters gcalctool gdb ghostscript ghostscript-cups ghostscript-x ginn gir1.2-atspi-2.0 gir1.2-dbusmenu-glib-0.4 gir1.2-dbusmenu-gtk-0.4 gir1.2-gst-plugins-base-0.10 gir1.2-gtk-3.0 gir1.2-gtksource-3.0 gir1.2-gudev-1.0 gir1.2-javascriptcoregtk-3.0 gir1.2-launchpad-integration-3.0 gir1.2-pango-1.0 gir1.2-rb-3.0 gir1.2-totem-1.0 gir1.2-ubuntuoneui-3.0 gir1.2-unity-5.0 gir1.2-webkit-3.0 glib-networking glib-networking-common glib-networking-services gnome-accessibility-themes gnome-control-center gnome-control-center-data gnome-desktop3-data gnome-games-data gnome-icon-theme gnome-media gnome-orca gnome-settings-daemon gnome-sudoku gnomine gnupg google-talkplugin gpgv grub-common grub-pc grub-pc-bin grub2-common gstreamer0.10-alsa gstreamer0.10-plugins-base gstreamer0.10-plugins-base-apps gstreamer0.10-x gvfs gvfs-backends gvfs-bin gvfs-common gvfs-daemons gvfs-fuse gvfs-libs gwibber gwibber-service gwibber-service-facebook gwibber-service-identica gwibber-service-twitter hdparm hplip hplip-data indicator-sound initscripts isc-dhcp-client isc-dhcp-common jockey-common jockey-gtk krb5-locales landscape-client-ui-install language-pack-en language-pack-en-base language-pack-gnome-en language-pack-gnome-en-base launchpad-integration libaccountsservice0 libapt-inst1.4 libapt-pkg4.12 libart-2.0-2 libasound2 libatspi2.0-0 libbamf0 libbamf3-0 libbind9-80 libc-bin libc-dev-bin libc6 libc6-dev libcairo-gobject2 libcairo2

    Read the article

  • Import a Collada model doesn't align to pixels

    - by Dan Friedman
    Assume I have a model that is simply a cube. (It is more complicated than a cube, but for the purposes of this discussion, we will simplify.) So when I am in Sketchup, the cube is Xmm by Xmm by Xmm, where X is an integer. I then export the a Collada file and subsequently load that into threejs. Now if I look at the geometry bounding box, the values are floats, not integers. So now assume I am putting cubes next to each other with a small space in between say 1 pixel. Because screens can't draw half pixels, sometimes I see one pixel and sometimes I see two, which causes a lack of uniformity. I think I can resolve this satisfactorily if I can somehow get the imported model to have integer dimensions. I have full access to all parts of the model starting with Sketchup, so any point in the process is fair game. Is it possible? Thanks.

    Read the article

  • running requestAnimationFrame from within a new object

    - by JVE999
    I'm having trouble running an animation. This is inside var ob1 = function() {};. When called, it runs for a while and then I get the error Uncaught RangeError: Maximum call stack size exceeded. However, this same structure has no problems running outside of the object. /////////////// Render the scene /////////////// this.render = function (){ renderer.render(scene,camera); if(isControls == true) controls.update(clock.getDelta()); this.animate(); //console.log(true); requestAnimationFrame(this.render()); } /////////////// Update objects /////////////// this.animate = function (){ console.log("!"); }

    Read the article

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