Search Results

Search found 229 results on 10 pages for 't boy'.

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

  • initializing structs using user-input information

    - by johnny boy
    I am trying to make a program that works with poker (texas holdem) starting hands; each hand has a value from 1 to 169, and i want to be able to input each card and whether they are suited or not, and have those values correspond to a series of structs. Here is the code so far, i cant seem to get it to work (im a beginning programmer). oh and im using visual studio 2005 by the way #include "stdafx.h" #include <iostream> int main() { using namespace std; struct FirstCard { struct SecondCard { int s; //suited int n; //non-suited }; SecondCard s14; SecondCard s13; SecondCard s12; SecondCard s11; SecondCard s10; SecondCard s9; SecondCard s8; SecondCard s7; SecondCard s6; SecondCard s5; SecondCard s4; SecondCard s3; SecondCard s2; }; FirstCard s14; //ace FirstCard s13; //king FirstCard s12; //queen FirstCard s11; //jack FirstCard s10; FirstCard s9; FirstCard s8; FirstCard s7; FirstCard s6; FirstCard s5; FirstCard s4; FirstCard s3; FirstCard s2; s14.s14.n = 169; // these are the values that each combination s13.s13.n = 168; // will evaluate to, would eventually have s12.s12.n = 167; // hand combinations all the way down to 1 s11.s11.n = 166; s14.s13.s = 165; s14.s13.s = 164; s10.s10.n = 163; //10, 10, nonsuited s14.s13.n = 162; s14.s11.s = 161; s13.s12.s = 160;// king, queen, suited s9.s9.n = 159; s14.s10.s = 158; s14.s12.n = 157; s13.s11.s = 156; s8.s8.n = 155; s12.s11.s = 154; s13.s10.s = 153; s14.s9.s = 152; s14.s11.n = 151; cout << "enter first card: " << endl; cin >> somthing?//no idea what to put here, but this would somehow //read out the user input (a number from 2 to 14) //and assign it to the corresponding struct cout << firstcard.secondcard.suited_or_not << endl; //this would change depending //on what the user inputs system("Pause"); }

    Read the article

  • Winforms panel event after scroll

    - by Charlie boy
    Hello I have a panel in wich I do a bounch af rater complex drawing in the paint event. Since the drawing-code is kind of heavy, it gets rather twitchy when I scroll the panel, since the paint event is raised in such short intervals. My question is really this; Can i capture evnts such as "on scroll start" and "on scroll end" on a winforms control? If so, I could then just pause the drawing-code until the scroll is complete. Thanks in advance!

    Read the article

  • How to create a HTML5 + SVG document using the PHP XSLTProcessor

    - by Kau-Boy
    For a little project about XML I try to use HTML5 as it has SVG and WAI-ARIA Support. I also want to use a XSL stylesheet for my document. But I can't get a valid HTML5 document with a nested SVG. Here are some version I tested so far: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes" method="xml"/> <xsl:template match="/"> <html xmlns="http://www.w3.org/1999/xhtml"> // content with the svg tag in the body </html> </xsl:template> </xsl:stylesheet> In combination with header('Content-Type: application/xml'); it works and produces this HTML output: <?xml version="1.0"?> <html xmlns="http://www.w3.org/1999/xhtml"> // content with the svg tag in the body </html> But it is not HTML5 and without a DOCTYPE I get a lot of errors on the W3 validator. So trying to get a HTML5 document I used the following XSL: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes" method="html"/> <xsl:template match="/"> <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE HTML></xsl:text> <html> // content with the svg tag in the body </html> </xsl:template> </xsl:stylesheet> But unfortunately that will produce thze following HTML output: <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> .... </head> // content with the svg tag in the body </html> As you can see it's regular HTML5 but using it in combination with header('Content-Type: application/xml'); it fails because of the missing slash at the end of the meta tag (which was automatically created). Using header('Content-Type: image/xhtml+svg'); or header('Content-Type: text/html'); there is no XML parsing error, but the page will not show the SVG as a graph but as text (without the tags). Can anyone tell me how to avoid the meta tag to be inserted or how to set a propper Content-Type that will make the browser rendern the SVG. Or even any other hint to get this working. I would really like to keep HTML5 to be able to keep the WAI-ARIA Landmark Roles an the HTML5 tags like NAV and FOOTER.

    Read the article

  • Facebook Connect for iOS: dialogDidComplete response differentiation

    - by Oh Danny Boy
    I was wondering how to differentiate between the user tapping submit or skip in the inline post-to-stream FBDialog. Anyone know what to test for? I am using the latest iOS Facebook Connect in a iOS 4.2 environment. /** * Called when a UIServer Dialog successfully return. */ - (void)dialogDidComplete:(FBDialog *)dialog { if user tapped submit and post was successful alert user of successful post if user tapped "skip" (cancel equivalent) do not display alert }

    Read the article

  • iOS MapKit: Selected MKAnnotation coordinates.

    - by Oh Danny Boy
    Using the code at the following tutorial, http://www.zenbrains.com/blog/en/2010/05/detectar-cuando-se-selecciona-una-anotacion-mkannotation-en-mapa-mkmapview/, I was able to add an observer to each MKAnnotation and receive a notification of selected/deselected states. I am attempting to add a UIView on top of the selection annotation to display relevant information about the location. This information cannot be conveyed in the 2 lines allowed (Title/Subtitle) for the pin's callout. - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { Annotation *a = (Annotation *)object; // Alternatively attempted using: //Annotation *a = (Annotation *)[mapView.selectedAnnotations objectAtIndex:0]; NSString *action = (NSString *)context; if ([action isEqualToString:ANNOTATION_SELECTED_DESELECTED]) { BOOL annotationSelected = [[change valueForKey:@"new"] boolValue]; if (annotationSelected) { // Actions when annotation selected CGPoint origin = a.frame.origin; NSLog(@"origin (%f, %f) ", origin.x, origin.y); // Test UIView *v = [[UIView alloc] init]; [v setBackgroundColor:[UIColor orangeColor]]; [v setFrame:CGRectMake(origin.x, origin.y , 300, 300)]; [self.view addSubview:v]; [v release]; }else { // Accions when annotation deselected } } } Results using Annotation *a = (Annotation *)object origin (154373.000000, 197135.000000) origin (154394.000000, 197152.000000) origin (154445.000000, 197011.000000) Results using Annotation *a = (Annotation *)[mapView.selectedAnnotations objectAtIndex:0]; origin (0.000000, 0.000000) origin (0.000000, 0.000000) origin (0.000000, 0.000000) The numbers are large. They are not relative to the view (1024 x 768). I believe they are relative to the entire map. How would I be able to detect the exact coordinates relative to the entire view so that I can appropriately position my view?

    Read the article

  • WPF - Centering a checkbox in a GridViewColumn?

    - by Sonny Boy
    Hey all, I'm currently struggling on getting my checkboxes to property center within my GridViewColumns. I've defined a style for my checkboxes like so: <Style TargetType="{x:Type CheckBox}" x:Key="DataGridCheckBox"> <Setter Property="HorizontalAlignment" Value="Center" /> <Setter Property="HorizontalContentAlignment" Value="Center" /> <Setter Property="IsEnabled" Value="False" /> <Setter Property="Margin" Value="4" /> <Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="VerticalContentAlignment" Value="Center" /> <Setter Property="Width" Value="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type GridViewColumn}},Path=ActualWidth}" /> </Style> And my checkboxes are added into the GridViewColumn using a DataTemplate like this: <GridViewColumn Header="Comment"> <GridViewColumn.CellTemplate> <DataTemplate> <CheckBox Style="{StaticResource DataGridCheckBox}" IsChecked="{Binding PropertyItem.Comment, Converter={StaticResource booleanConverter}, ConverterParameter='string'}"/> </DataTemplate> </GridViewColumn.CellTemplate> </GridViewColumn> But the problem I have is that the checkboxes remain left-aligned (even when resizing the column). Any ideas? Thanks in advance, Sonny

    Read the article

  • Which DOCTYPE should I use for HTML newsletters?

    - by Kau-Boy
    We are going the send our newsletters in HTML format soon. I have found a lot of information (like on Litmus) about which e-mail program and web mailer understands which CSS property. But the only think I couldn't figure out is which DOCTYPE we should use. Our mass mailing tool always overwrites the DOCTYPE with HTML 4.0 Transitional: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> What would you say we should take to be compatible with most of the e-mail programs and web mailer? We don't use a lot of HTML and now special new CSS properties.

    Read the article

  • How to create Chat application using Servlets & JSP

    - by Crazy boy
    I want to create chat application using Servlets & JSP. May I know how can I create chat application as I have never created before? How much knowledge I need to have to create chat application? Is there any need of networking API to create chat application? What's the design pattern I need to follow to create that application? Is there any need of database?

    Read the article

  • Firefox api - access from my program

    - by del-boy
    Is it possible to access Firefox info from my program? Specificly I need to read URL of opened site in active tab. Is something like this possible? I guess I can write extension that will allow me to do something like this, but I wanted to know if it is posible with some FF api...

    Read the article

  • MSVC enum debugging

    - by oh boy
    Is there a quick way of outputting the names of enumerated values? I suppose you know what I mean, and at all this isn't possible as of course all of this data becomes irrelevant during compile process, but I'm using MSVC in debugging mode, so is it possible?

    Read the article

  • Orientation issue while presenting Modal ViewController

    - by Jacky Boy
    Current scenario: Right now I am showing a UIViewController using a segue with the style Modal and presentation Sheet. This Modal gets its superview bounds change, in order to have the dimensions I want, like this: - (void)viewWillLayoutSubviews { [super viewWillLayoutSubviews]; self.view.superview.bounds = WHBoundsRect; } The only allowed orientations are UIInterfaceOrientationLandscapeLeft and UIInterfaceOrientationLandscapeRight. Since the Modal has some TextFields and the keyboard would be over the Modal itself, I am changing its center so it moves a bit to the top. The problem: What I am noticing right now, is that I am unable to work with the Y coordinate. In order for it move vertically (remember it's on landscape) I need to work with the X. The problem is that when it's UIInterfaceOrientationLandscapeLeft I need to come with a negative X. And when it's UIInterfaceOrientationLandscapeRight I need to come with a positive X. So it seems that the X/Y Coordinate System is "glued" to the top left corner while in Portrait and when an orientation occurs, it's still there: What I have done So I have something like this: UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; NSInteger newX = 0.0f; if (orientation == UIInterfaceOrientationLandscapeLeft) { // Logic for calculating the negative X. } else { // Logic for calculating the positive X. } It works exactly like I want, but it seems a very fragile implementation. Am I missing something? Is this the expected behaviour?

    Read the article

  • Partial class or "chained inheritance"

    - by Charlie boy
    Hi From my understanding partial classes are a bit frowned upon by professional developers, but I've come over a bit of an issue; I have made an implementation of the RichTextBox control that uses user32.dll calls for faster editing of large texts. That results in quite a bit of code. Then I added spellchecking capabilities to the control, this was made in another class inheriting RichTextBox control as well. That also makes up a bit of code. These two functionalities are quite separate but I would like them to be merged so that I can drop one control on my form that has both fast editing capabilities and spellchecking built in. I feel that simply adding the code form one class to the other would result in a too large code file, especially since there are two very distinct areas of functionality, so I seem to need another approach. Now to my question; To merge these two classes should I make the spellchecking RichTextBox inherit from the fast edit one, that in turn inherits RichTextBox? Or should I make the two classes partials of a single class and thus making them more “equal” so to speak? This is more of a question of OO principles and exercise on my part than me trying to reinvent the wheel, I know there are plenty of good text editing controls out there. But this is just a hobby for me and I just want to know how this kind of solution would be managed by a professional. Thanks!

    Read the article

  • designing classes and objects in .net for a restaurant assignment

    - by Dell Boy
    I have received an assignment at School for creating a Restaurant site. I have to use objects and classes (OOP) for my assignment. I have the foundations of the OOP in .net, but what I don't know is how can I design this assignment to be object-oriented. I don't know how to start it. The requirement is like this: The menu has to be saved in a database and retrieved from it. The menu is devided in appetizers, Salades, Main Meal, Pastas, Wines, Beverages, Extras, Do I create classes like this: Base Class: Menu Derived classes: Appetizers, Salades, Main meal, Pastas, wines, etc. If you have a good example about how to create classes from a Menu that will be great. You don't have to rely on the example I gave above. The menu can be anything. I can deside what the menu will contain. thanks a lot. I am waiting for some help. Please

    Read the article

  • C++: Short question regarding switch and break

    - by oh boy
    Example: switch( x ) { case y: if ( true ) { break; } cout << "Oops"; break; } If the switch statement selects y, will Oops be written to the standard output? - Is break in switch statements a dynamic keyword like continue which can be called under conditions or static like a closing bracket }?

    Read the article

  • How to repair Java in Ubuntu after trying to switch to Java 6 using update-java-alternatives

    - by Kau-Boy
    I tried to switch from Java 5 to Java 6 using the "update-java-alternatives" command like explained on this page: https://help.ubuntu.com/community/Java But afterwards I get the following error when I tried to execute java: root@webserver:~# java Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine. I also tried to reinstall the java binaries using "apt-get" but I didn't succeed reinstalling it. I would like to post the "apt-get" errors, but unfortunately I don't know how to print out the error messages in English and not in German. My system is a Ubuntu 8.04 ROOT server. Here is the (Google translated) english text tring to install Java 6 again: root@server:~# apt-get install sun-java6-jdk Reading package lists ... Ready Dependency tree Reading state information ... Ready sun-java6-jdk is already the newest version. sun-java6-jdk set to manually installed. 0 upgraded, 0 newly installed, 0 to remove and 86 not upgraded. 1 not fully installed or removed. After this operation, 0B of additional disk space will be used. Set up a sun-java6-bin (6-03-0ubuntu2) ... Could not create the Java virtual machine. dpkg: error processing sun-java6-bin (- configure): Subprocess post-installation script returned error exit status 1 Errors were encountered while processing: sun-java6-bin E: Sub-process / usr / bin / dpkg returned an error code (1) I hope that this might help you helping me.

    Read the article

  • Why the streams in C++?

    - by oh boy
    As you all know there are libraries using streams such as iostream and fstream. My question is: Why streams? Why didn't they stick with functions similar to print, fgets and so on (for example)? They require their own operators << and >> but all they do could be implemented in simple functions like above, also the function printf("Hello World!"); is a lot more readable and logical to me than cout << "Hello World"; I also think that all of those string abstractions in C++ all compile down to (less efficient) standard function calls in binary.

    Read the article

  • PHP-How to Pass Multiple Value In Form Field

    - by Tall boY
    hi i have a php based sorting method with drop down menu to sort no of rows, it is working fine. i have another sorting links to sort id & title, it is also working fine. but together they are not working fine. what happens is that when i sort(say by title) using links, result gets sorted by title, then if i sort rows using drop down menu rows get sorted but result gets back to default of id sort. sorting codes for id & tite is if ($orderby == 'title' && $sortby == 'asc') {echo " <li id='scurrent'><a href='?rpp=$rowsperpage&order=title&sort=asc'>title-asc:</a></li> ";} else {echo " <li><a href='?rpp=$rowsperpage&order=title&sort=asc'>title-asc:</a></li> ";} if ($orderby == 'title' && $sortby == 'desc') {echo " <li id='scurrent'><a href='?rpp=$rowsperpage&order=title&sort=desc'>title-desc:</a></li> ";} else {echo " <li><a href='?rpp=$rowsperpage&order=title&sort=desc'>title-desc:</a></li> ";} if ($orderby == 'id' && $sortby == 'asc') {echo " <li id='scurrent'><a href='?rpp=$rowsperpage&order=id&sort=asc'>id-asc:</a></li> ";} else {echo " <li><a href='?rpp=$rowsperpage&order=id&sort=asc'>id-asc:</a></li> ";} if ($orderby == 'id' && $sortby == 'desc') {echo " <li id='scurrent'><a href='?rpp=$rowsperpage&order=id&sort=desc'>id-desc:</a></li> ";} else {echo " <li><a href='?rpp=$rowsperpage&order=id&sort=desc'>id-desc:</a></li> ";} ?> sorting codes for rows is <form action="is-test.php" method="get"> <select name="rpp" onchange="this.form.submit()"> <option value="10" <?php if ($rowsperpage == 10) echo 'selected="selected"' ?>>10</option> <option value="20" <?php if ($rowsperpage == 20) echo 'selected="selected"' ?>>20</option> <option value="30" <?php if ($rowsperpage == 30) echo 'selected="selected"' ?>>30</option> </select> </form> this method passes only rows per page(rpp) into url. i want it to pass order, sort& rpp. is there a way around to pass multiple values in form fields like this. <form action="is-test.php" method="get"> <select name="rpp, order, sort" onchange="this.form.submit()"> <option value="10, $orderby, $sortby" <?php if ($rowsperpage == 10) echo 'selected="selected"' ?>>10</option> <option value="20, $orderby, $sortby" <?php if ($rowsperpage == 20) echo 'selected="selected"' ?>>20</option> <option value="30, $orderby, $sortby" <?php if ($rowsperpage == 30) echo 'selected="selected"' ?>>30</option> </select> </form> this may seem silly but it just to give you an idea of what i am trying to implement,(i am very new to php) please suggest any way to make this work. thanks

    Read the article

  • Conditions of Use dialog for Windows logins

    - by 20th Century Boy
    I need to design a "Conditions of Use" dialog that is presented to users after they logon to Windows XP. It must not allow the user to proceed until they check an "I agree" box. It must not be possible to shut it using Task Manager or any other method. And it should be fullscreen and modal. The "I agree" will remain checked automatically during subsequent logins for the duration of 1 month, after which the user will need to check it again. Also HR want to track who has checked the checkbox. Is such a thing possible using .Net? I can use C# to design it but I'm not sure about how to prevent users from bypassing the dialog. I know Windows Group Policy allows a dialog to be presented before login, but that does not allow a checkbox or any customization. Any thoughts?

    Read the article

  • disable download of my paid app in Android

    - by Boy
    I have a paid app in the store which will remove the ads in another app when it is installed on that device. Now I want to remove this 'remove ads' app, as I want to have an in-app payement for this for instance (or maybe I just keep the ads version only). But the problem is, if I unpublish the app, people who bought it will not be able to download it again when they get a new phone or reset their phone. How to I keep the app in the Play Store, but prevent people from buying it? Is this possible? My backup plan is: make the app cost 10.000 euro's and put in the message that this app should not be bought anymore. But I don't like that...

    Read the article

  • C++ STL: Array vs Vector: Raw element accessing performance

    - by oh boy
    I'm building an interpreter and as I'm aiming for raw speed this time, every clock cycle matters for me in this (raw) case. Do you have any experience or information what of the both is faster: Vector or Array? All what matters is the speed I can access an element (opcode receiving), I don't care about inserting, allocation, sorting, etc. I'm going to lean myself out of the window now and say: Arrays are at least a bit faster than vectors in terms of accessing an element i. It seems really logical for me. With vectors you have all those security and controlling overhead which doesn't exist for arrays. (Why) Am I wrong? No, I can't ignore the performance difference - even if it is so small - I have already optimized and minimized every other part of the VM which executes the opcodes :)

    Read the article

  • C++: Pointers and scope

    - by oh boy
    int* test( ) { int a = 5; int* b = &a; return b; } Will the result of test be a bad pointer? As far as I know a should be deleted and then b would become a messed up pointer, right? How about more complicated things, not an int pointer but the same with a class with 20 members or so?

    Read the article

  • C++ OOP: Which functions to put into the class?

    - by oh boy
    Assume I have a class a: class a { public: void load_data( ); private: void check_data( ); void work_data( ); void analyze_data( ); } Those functions all do something with the class or one of its members. However this function: bool validate_something( myType myData ) { if ( myData.blah > 0 && myData.blah < 100 ) { return true; } return false; } Is related to the class and will only be called by it, so it won't be needed anywhere else Doesn't do anything with the class or its members - just a small "utility" function Where to put validate_something? Inside or outside the class?

    Read the article

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