Search Results

Search found 826 results on 34 pages for 'matthew adams'.

Page 11/34 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • How can I increase my disk space when Ubuntu is installed alongside with Windows?

    - by Matthew
    Some time ago i reinstalled windows, formating and deleting every partition. I then made 3 partitions: One only for Windows OS (about 25GB) One for Ubuntu OS (about 25GB, if i remember corectly 10GB for swap memory and 15GB as an ext4 partition) (not sure if it was that, hope I am not wrong) and like 200GB for all the other stuff. Recently I got a message that i am running out of disk space. My question is: is there a way to resize the 200GB partition and add more space for the Ubuntu partition?

    Read the article

  • Ubuntu 13.10 - Wifi not re-connecting after suspend

    - by Matthew
    I upgraded the other day from Ubuntu 13.04 to 13.10 on my ZaReason laptop, and the WiFi doesn't reconnect after suspend. In 13.04, pressing Fn+F2 turned network connections back on after suspend. The 'soft' wireless hardware switch. But in 13.10, that doesn't work, and trying to enable networking in the networking menu doesn't work either. So I have to restart every time. Any suggestions to make it work?

    Read the article

  • PHP splitting arrays into groups based on one field's value

    - by Dan
    I have an array containing arrays of names and other details, in alphabetical order. Each array includes the first letter associated with the name. Array ( [0] => Array ( [0] => a [1] => Alanis Morissette ) [1] => Array ( [0] => a [1] => Alesha Dixon ) [2] => Array ( [0] => a [1] => Alexandra Burke ) [3] => Array ( [0] => b [1] => Britney Spears ) [4] => Array ( [0] => b [1] => Bryan Adams ) ) I'd like to display them grouped by that first initial, eg: A - Alanis Morissette Alesha Dixon Alexandra Burke B - Britney Spears Bryan Adams etc... Is this at all possible?

    Read the article

  • How to eliminate NULL fields in TSQL

    - by salvationishere
    I am developing a TSQL query in SSMS 2008 R2. I am trying to develop this query to identify one record / client. Because some of these values are NULL, I am currently doing LEFT JOINS on most of the tables. But the problem with the LEFT JOINs is that now I get 1 record for some clients. But if I change this to INNER JOINs then some clients are excluded entirely because they have NULL values for these columns. How do I limit the query result to just one record / client regardless of NULL values? And if there are non-NULL values then I want it to choose the record with non-NULL values. Here is some of my current output: group_profile_id profile_name license_number is_accepting is_accepting_placement managing_office region vendor_name vendor_id applicant_type Office Address status_description Cert Date2 race ethnicity_desc religion 9CD932F1-6BE1-4F80-AB81-0CE32C565BCF Atreides Foster Home 1 Atreides1 1 Yes Manchester, NH Gulf Atlantic Atreides1 00000007 Treatment Foster Home 4042 Arrakis Avenue, Springfield, VT 05156 Open/Re-opened 2011-06-01 00:00:00.000 NULL NULL NULL DCE354D5-A7CC-409F-B5A3-89BF664B7718 Averitte, Leon and Sandra 00000044 1 Yes Birmingham, AL Gulf Atlantic AL Averitte, Leon and Sandra 00000044 Treatment Foster Home 3816 5th Avenue, Bessemer, AL 35020, (205)482-4307 Open/Re-opened 2011-08-05 00:00:00.000 NULL NULL NULL DCE354D5-A7CC-409F-B5A3-89BF664B7718 Averitte, Leon and Sandra 00000044 1 Yes Birmingham, AL Gulf Atlantic AL Averitte, Leon and Sandra 00000044 Treatment Foster Home 3816 5th Avenue, Bessemer, AL 35020, (205)482-4307 Open/Re-opened 2011-08-05 00:00:00.000 Caucasian/White Non Hispanic NULL AD02A43C-6F38-4F35-8C9E-E12422690BFB Bass, Matthew and Sarah 00000076 1 Yes Jacks on, MS Central Gulf Coast MS Bass, Matthew and Sarah 00000076 Treatment Foster Home 506 Eagelwood Drive, Florence, MS 39073, (601)665-7169 Open/Re-opened 2011-04-01 00:00:00.000 NULL NULL NULL AD02A43C-6F38-4F35-8C9E-E12422690BFB Bass, Matthew and Sarah 00000076 1 Yes Jackson, MS Central Gulf Coast MS Bass, Matthew and Sarah 00000076 Treatment Foster Home 506 Eagelwood Drive, Florence, MS 39073, (601)665-7169 Open/Re-opened 2011-04-01 00:00:00.000 Caucasian/White NULL Baptist You can see that both Averitte and Bass profile names have one record with NULL race, ethnicity, religion. How do I eliminate these rows (rows 2 and 4)? Here is my query currently: select distinct gp.group_profile_id, gp.profile_name, gp.license_number, gp.is_accepting, case when gp.is_accepting = 1 then 'Yes' when gp.is_accepting = 0 then 'No ' end as is_accepting_placement, mo.profile_name as managing_office, regions.[region_description] as region, pv.vendor_name, pv.id as vendor_id, at.description as applicant_type, dbo.GetGroupAddress(gp.group_profile_id, null, 0) as [Office Address], gsv.status_description, ri.[description] as race, ethnicity.description as ethnicity_desc, religion.description as religion from group_profile gp With (NoLock) --Office Information inner join group_profile_type gpt With (NoLock) on gp.group_profile_type_id = gpt.group_profile_type_id and gpt.type_code = 'FOSTERHOME' and gp.agency_id = @agency_id and gp.is_deleted = 0 inner join group_profile mo With (NoLock) on gp.managing_office_id = mo.group_profile_id left outer join payor_vendor pv With (NoLock) on gp.payor_vendor_id = pv.payor_vendor_id left outer join applicant_type at With (NoLock) on gp.applicant_type_id = at.applicant_type_id and at.is_foster_home = 1 inner join group_status_view gsv With (NoLock) on gp.group_profile_id = gsv.group_profile_id and gsv.status_value = 'OPEN' and gsv.effective_date = (Select max(b.effective_date) from group_status_view b With (NoLock) where gp.group_profile_id = b.group_profile_id) left outer join regions With (NoLock) on isnull(mo.regions_id, gp.regions_id) = regions.regions_id left join enrollment en on en.group_profile_id = gp.group_profile_id join event_log el on el.event_log_id = en.event_log_id left join people client on client.people_id = el.people_id left join race With (NoLock) on el.people_id = race.people_id left join group_profile_race gpr with (nolock) on gpr.race_info_id = race.race_info_id left join race_info ri with (nolock) on ri.race_info_id = gpr.race_info_id left join ethnicity With(NoLock) On client.ethnicity = ethnicity.ethnicity_id left join religion on client.religion = religion.religion_id

    Read the article

  • Can't Mount Phone, "according to mtab, /dev/sdb1 is already mounted on /"

    - by RPG Master
    My myTouch Slide wasn't mounting, so I decided to open Disk Utility. My phone shows up but when I click "Mount" it gives me this error: Error mounting: mount exited with exit code 1: helper failed with: mount: according to mtab, /dev/sdb1 is already mounted on / mount failed Here's my mtab: /dev/sdb1 / ext4 rw,errors=remount-ro,commit=0 0 0 proc /proc proc rw,noexec,nosuid,nodev 0 0 none /sys sysfs rw,noexec,nosuid,nodev 0 0 fusectl /sys/fs/fuse/connections fusectl rw 0 0 none /sys/kernel/debug debugfs rw 0 0 none /sys/kernel/security securityfs rw 0 0 none /dev devtmpfs rw,mode=0755 0 0 none /dev/pts devpts rw,noexec,nosuid,gid=5,mode=0620 0 0 none /dev/shm tmpfs rw,nosuid,nodev 0 0 none /var/run tmpfs rw,nosuid,mode=0755 0 0 none /var/lock tmpfs rw,noexec,nosuid,nodev 0 0 binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0 gvfs-fuse-daemon /home/matthew/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,user=matthew 0 0 /dev/sdg1 /media/Seagate\040GoFlex ext4 rw,nosuid,nodev,uhelper=udisks 0 0 EDIT: Here's my fstab: # /etc/fstab: static file system information. # # Use 'blkid -o value -s UUID' to print the universally unique identifier # for a device; this may be used with UUID= as a more robust way to name # devices that works even if disks are added and removed. See fstab(5). # # <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc nodev,noexec,nosuid 0 0 /dev/sda1 / ext4 errors=remount-ro 0 1 # swap was on /dev/sda5 during installation UUID=3b0db205-2bdb-4c98-a506-6bdd3520d540 none swap sw 0 0

    Read the article

  • Installing VSTO 4.0 Causes VSTO 3.0 Addin to quit working

    - by Jacob Adams
    I just installed Visual Studio 2010 yesterday. As part of that I installed VSTO 4.0. Now when I run any Office application, my VSTO 3.0 addins fail to load. The error in the event log is Customization URI: file:///H:/PathToMyAddin/MyAddin.vsto Exception: Customization does not have the permissions required to create an application domain. ***** Exception Text ******* Microsoft.VisualStudio.Tools.Applications.Runtime.CannotCreateCustomizationDomainException: Customization does not have the permissions required to create an application domain. --- System.Security.SecurityException: Customized functionality in this application will not work because the administrator has listed file:///H:/PathToMyAddin/MyAddin.vsto as untrusted. Contact your administrator for further assistance. at Microsoft.VisualStudio.Tools.Office.Runtime.RuntimeUtilities.VerifySolutionUri(Uri uri) at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.CreateCustomizationDomainInternal(String solutionLocation, String manifestName, String documentName, Boolean showUIDuringDeployment, IntPtr hostServiceProvider, IntPtr& executor) The Zone of the assembly that failed was: MyComputer It seems like like maybe this is due to it trying to load different version of .NET is the same process/AppDomain. However the error would indicate it's some sort of permissions issue.

    Read the article

  • Iterate through deserialized xml object

    - by Bruce Adams
    I have a deserialized xml c# objet. I need to iterate through the oject to display all items, in this case there's just one, and display the name, colors and sizes for each item. The xml: <?xml version="1.0" encoding="utf-8"?> <Catalog Name="Example"> <Items> <Item Name="ExampleItem"> <Colors> <Color Name="Black" Value="#000" /> <Color Name="White" Value="#FFF" /> </Colors> <Sizes> <Size Name="Small" Value="10" /> <Size Name="Medium" Value="20" /> </Sizes> </Item> </Items> </Catalog> xsd.exe generated classes: //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:2.0.50727.4927 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ using System.Xml.Serialization; // // This source code was auto-generated by xsd, Version=2.0.50727.42. // /// <remarks/> [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)] public partial class Catalog { private CatalogItemsItem[][] itemsField; private string nameField; /// <remarks/> [System.Xml.Serialization.XmlArrayAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] [System.Xml.Serialization.XmlArrayItemAttribute("Item", typeof(CatalogItemsItem[]), Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)] public CatalogItemsItem[][] Items { get { return this.itemsField; } set { this.itemsField = value; } } /// <remarks/> [System.Xml.Serialization.XmlAttributeAttribute()] public string Name { get { return this.nameField; } set { this.nameField = value; } } } /// <remarks/> [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] public partial class CatalogItemsItem { private CatalogItemsItemColorsColor[][] colorsField; private CatalogItemsItemSizesSize[][] sizesField; private string nameField; /// <remarks/> [System.Xml.Serialization.XmlArrayAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] [System.Xml.Serialization.XmlArrayItemAttribute("Color", typeof(CatalogItemsItemColorsColor[]), Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)] public CatalogItemsItemColorsColor[][] Colors { get { return this.colorsField; } set { this.colorsField = value; } } /// <remarks/> [System.Xml.Serialization.XmlArrayAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] [System.Xml.Serialization.XmlArrayItemAttribute("Size", typeof(CatalogItemsItemSizesSize[]), Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)] public CatalogItemsItemSizesSize[][] Sizes { get { return this.sizesField; } set { this.sizesField = value; } } /// <remarks/> [System.Xml.Serialization.XmlAttributeAttribute()] public string Name { get { return this.nameField; } set { this.nameField = value; } } } /// <remarks/> [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] public partial class CatalogItemsItemColorsColor { private string nameField; private string valueField; /// <remarks/> [System.Xml.Serialization.XmlAttributeAttribute()] public string Name { get { return this.nameField; } set { this.nameField = value; } } /// <remarks/> [System.Xml.Serialization.XmlAttributeAttribute()] public string Value { get { return this.valueField; } set { this.valueField = value; } } } /// <remarks/> [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] public partial class CatalogItemsItemSizesSize { private string nameField; private string valueField; /// <remarks/> [System.Xml.Serialization.XmlAttributeAttribute()] public string Name { get { return this.nameField; } set { this.nameField = value; } } /// <remarks/> [System.Xml.Serialization.XmlAttributeAttribute()] public string Value { get { return this.valueField; } set { this.valueField = value; } } } /// <remarks/> [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)] [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)] public partial class NewDataSet { private Catalog[] itemsField; /// <remarks/> [System.Xml.Serialization.XmlElementAttribute("Catalog")] public Catalog[] Items { get { return this.itemsField; } set { this.itemsField = value; } } } Deserialization code: System.Xml.Serialization.XmlSerializer xSerializer = new System.Xml.Serialization.XmlSerializer(typeof(Catalog)); TextReader reader = new StreamReader("catalog.xml"); Catalog catalog = (Catalog)xSerializer.Deserialize(reader); foreach (var item in catalog.Items) { } reader.Close(); When I setp through the code there is one item present in catalog.items, but it is empty, no name, colors or sizes. Any ideas what I need to do? Thanks

    Read the article

  • IFrame targeting another IFrame

    - by Mitchan Adams
    I have a parent page containing two iframes. One holds navigation links and the other should display the information pertaining to the navigation link clicked in the first iframe. So I need to target the one iframe from within another iframe.Is this possible? If so how does one go about it?

    Read the article

  • Code Golf: 1x1 black pixel

    - by Joey Adams
    Recently, I used my favorite image editor to make a 1x1 black pixel (which can come in handy when you want to draw solid boxes in HTML cheaply). Even though I made it a monochrome PNG, it came out to be 120 bytes! I mean, that's kind of steep. 120 bytes. For one pixel. I then converted it to a GIF, which dropped the size down to 43 bytes. Much better, but still... Challenge The shortest image file or program that is or generates a 1x1 black pixel. A submission may be: An image file that represents a 1x1 black pixel. The format chosen must be able to represent larger images than 1x1, and cannot be ad-hoc (that is, it can't be an image format you just made up for code golf). Image files will be ranked by byte count. A program that generates such an image file. Programs will be ranked by character count, as usual in code golf. As long as an answer falls into one of these two categories, anything is fair game.

    Read the article

  • Connect to a wireless network programmatically

    - by Josh Adams
    I'm trying to write an application that connects to my company's wireless network automatically on windows XP. I've found the Wireless LAN API but it requires me to have some hotfix installed on the machine, and you need to have sp2 or higher(There are machines with SP1, and I'm required to support any XP machine). I've tried to find some samples about Wireless Zero Configuration on MSDN but with no luck, only samples I've found are for WinCE, I think Microsoft stopped supporting it. In addition I couldn't find where to download the dll and header file for working with the WZC. There must be a way to do it and work on any service pack because I've found Zwlancfg by ENGL

    Read the article

  • How to get current Joomla user with external PHP script

    - by Joey Adams
    I have a couple PHP scripts used for AJAX queries, but I want them to be able to operate under the umbrella of Joomla's authentication system. Is the following safe? Are there any unnecessary lines? joomla-auth.php (located in the same directory as Joomla's index.php): <?php define( '_JEXEC', 1 ); define('JPATH_BASE', dirname(__FILE__)); define( 'DS', DIRECTORY_SEPARATOR ); require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' ); require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' ); /* Create the Application */ $mainframe =& JFactory::getApplication('site'); /* Make sure we are logged in at all. */ if (JFactory::getUser()->id == 0) die("Access denied: login required."); ?> test.php: <?php include 'joomla-auth.php'; echo 'Logged in as "' . JFactory::getUser()->username . '"'; /* We then proceed to access things only the user of that name has access to. */ ?>

    Read the article

  • Shift-reduce: when to stop reducing?

    - by Joey Adams
    I'm trying to learn about shift-reduce parsing. Suppose we have the following grammar, using recursive rules that enforce order of operations, inspired by the ANSI C Yacc grammar: S: A; P : NUMBER | '(' S ')' ; M : P | M '*' P | M '/' P ; A : M | A '+' M | A '-' M ; And we want to parse 1+2 using shift-reduce parsing. First, the 1 is shifted as a NUMBER. My question is, is it then reduced to P, then M, then A, then finally S? How does it know where to stop? Suppose it does reduce all the way to S, then shifts '+'. We'd now have a stack containing: S '+' If we shift '2', the reductions might be: S '+' NUMBER S '+' P S '+' M S '+' A S '+' S Now, on either side of the last line, S could be P, M, A, or NUMBER, and it would still be valid in the sense that any combination would be a correct representation of the text. How does the parser "know" to make it A '+' M So that it can reduce the whole expression to A, then S? In other words, how does it know to stop reducing before shifting the next token? Is this a key difficulty in LR parser generation?

    Read the article

  • PHP DOM vs SimpleXML for Atom GData feed parsing

    - by Geoff Adams
    I'm building a library to access the Google Analytics Data Export API. All the data the library accesses is in Atom format and utilises numerous different namespaces throughout. My experiments with the API have used SimpleXML for parsing so far, especially as all I have been doing is accessing the data held within the feed. Now I'm coming to write a library I am wondering whether forging ahead with SimpleXML will be adequate or whether the enhanced functionality of the DOM module in PHP would be of benefit in the future. I haven't written much code for this part of the library yet so the choice is still open. I have read that the PHP DOM module can be a better choice if you need to build an XML DOM on the fly or modify an existing one, but I'm not entirely sure I would need that functionality anyway due to the nature of the API (no pushing data to the server, for instance). SimpleXML is certainly easier to use and I have seen people saying that for read-only situations it is all you need. Essentially the question is, what would you use? Compatibility will not be an issue as the server configuration will match the application's requirements. Is it worth building the library with PHP DOM in mind or should I stick with SimpleXML for now? Update: Here are two examples of the kind of feeds I will be dealing with: Account feed Data feed

    Read the article

  • Multithreading or task parallel library

    - by Bruce Adams
    I have an application which performs 30 independent tasks simultaneously using multithreading, each task retrieves data over http, performs a calculation and returns a result to the ui thread. Can I use tpl to perform the same tasks? Does tpl create 30 new threads and spread them over all the available cores, or does it just split the tasks over the available cores and use one thread per core? Will there be a performance boost using tpl over multithreading in this case?

    Read the article

  • What is the proper query to get all the children in a tree?

    - by Nathan Adams
    Lets say I have the following MySQL structure: CREATE TABLE `domains` ( `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `domain` CHAR(50) NOT NULL, `parent` INT(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MYISAM AUTO_INCREMENT=10 DEFAULT CHARSET=latin1 insert into `domains`(`id`,`domain`,`parent`) values (1,'.com',0); insert into `domains`(`id`,`domain`,`parent`) values (2,'example.com',1); insert into `domains`(`id`,`domain`,`parent`) values (3,'sub1.example.com',2); insert into `domains`(`id`,`domain`,`parent`) values (4,'sub2.example.com',2); insert into `domains`(`id`,`domain`,`parent`) values (5,'s1.sub1.example.com',3); insert into `domains`(`id`,`domain`,`parent`) values (6,'s2.sub1.example.com',3); insert into `domains`(`id`,`domain`,`parent`) values (7,'sx1.s1.sub1.example.com',5); insert into `domains`(`id`,`domain`,`parent`) values (8,'sx2.s2.sub1.example.com',6); insert into `domains`(`id`,`domain`,`parent`) values (9,'x.sub2.example.com',4); In my mind that is enough to emulate a simple tree structure: .com | example / \ sub1 sub2 ect My problem is that give sub1.example.com I want to know all the children of sub1.example.com without using multiple queries in my code. I have tried joining the table to itself and tried to use subqueries, I can't think of anything that will reveal all the children. At work we are using MPTT to keep in hierarchal order a list of domains/subdomains however, I feel that there is an easier way to do it. I did some digging and someone did something similar but they required the use of a function in MySQL. I don't think for something simple like this we would need a whole function. Maybe I am just dumb and not seeing some sort of obvious solution. Also, feel free to alter the structure.

    Read the article

  • Handling aces and finding a segfault in a blackjack program

    - by Bill Adams
    Here's what i have so far... I have yet to figure out how i'm going to handle the 11 / 1 situation with an ace, and when the player chooses an option for hit/stand, i get segfault. HELP!!! #include <stdio.h> #include <string.h> #include <stdlib.h> #include <time.h> #define DECKSIZE 52 #define VALUE 9 #define FACE 4 #define HANDSIZE 26 typedef struct { int value; char* suit; char* name; }Card; typedef struct { int value; char* suit; char* name; }dealerHand; typedef struct { int value; char* suit; char* name; }playerHand; Card cards[DECKSIZE]; dealerHand deal[HANDSIZE]; playerHand dealt[HANDSIZE]; char *faceName[]={"two","three", "four","five","six", "seven","eight","nine", "ten", "jack","queen", "king","ace"}; char *suitName[]={"spades","diamonds","clubs","hearts"}; void printDeck(){ int i; for(i=0;i<DECKSIZE;i++){ printf("%s of %s value = %d\n ",cards[i].name,cards[i].suit,cards[i].value); if((i+1)%13==0 && i!=0) printf("-------------------\n\n"); } } void shuffleDeck(){ srand(time(NULL)); int this; int that; Card temp; int c; for(c=0;c<10000;c++){ //c is the index for number of individual card shuffles should be set to c<10000 or more this=rand()%DECKSIZE; that=rand()%DECKSIZE; temp=cards[this]; cards[this]=cards[that]; cards[that]=temp; } } /*void hitStand(i,y){ // I dumped this because of a segfault i couldn't figure out. int k; printf(" Press 1 to HIT or press 2 to STAND:"); scanf("%d",k); if(k=1){ dealt[y].suit=cards[i].suit; dealt[y].name=cards[i].name; dealt[y].value=cards[i].value; y++; i++; } } */ int main(){ int suitCount=0; int faceCount=0; int i; int x; int y; int d; int p; int k; for(i=0;i<DECKSIZE;i++){ //this for statement builds the deck if(faceCount<9){ cards[i].value=faceCount+2; }else{ //assigns face cards as value 10 cards[i].value=10; } cards[i].suit=suitName[suitCount]; cards[i].name=faceName[faceCount++]; if(faceCount==13){ //this if loop increments suit count once cards[i].value=11; //all faces have been assigned, and also suitCount++; //assigns the ace as 11 faceCount=0; } //end building deck } /*printDeck(); //prints the deck in order shuffleDeck(); //shuffles the deck printDeck(); //prints the deck as shuffled This was used in testing, commented out to keep the deck hidden!*/ shuffleDeck(); x=0; y=0; for(i=0;i<4;i++){ //this for loop deals the first 4 cards, dealt[y].suit=cards[i].suit; //first card to player, second to dealer, dealt[y].name=cards[i].name; //as per standard dealing practice. dealt[y].value=cards[i].value; i++; y++; deal[x].suit=cards[i].suit; deal[x].name=cards[i].name; deal[x].value=cards[i].value; x++; } printf(" Dealer's hand is: %s of %s and XXXX of XXXX. (Second card is hidden!)\n",deal[0].name,deal[0].suit,deal[1].name,deal[1].suit); printf(" Player's hand is: %s of %s and %s of %s.\n",dealt[0].name,dealt[0].suit,dealt[1].name,dealt[1].suit); printf(" the current value of the index i=%d\n",i); //this line gave me the value of i for testing d=deal[0].value+deal[1].value; p=dealt[0].value+dealt[1].value; if(d==21){ printf(" The Dealer has Blackjack! House win!\n"); }else{ if(d>21){ printf(" The dealer is Bust! You win!\n"); }else{ if(d>17){ printf(" Press 1 to HIT or 2 to STAND"); scanf("%d",k); if(k==1){ dealt[y].suit=cards[i].suit; dealt[y].name=cards[i].name; dealt[y].value=cards[i].value; y++; i++; } }else{ if(d<17){ printf(" Dealer Hits!"); deal[x].suit=cards[i].suit; deal[x].name=cards[i].name; deal[x].value=cards[i].value; x++; i++; } } } } return 0; }

    Read the article

  • SQL select descendants of a row

    - by Joey Adams
    Suppose a tree structure is implemented in SQL like this: CREATE TABLE nodes ( id INTEGER PRIMARY KEY, parent INTEGER -- references nodes(id) ); Although cycles can be created in this representation, let's assume we never let that happen. The table will only store a collection of roots (records where parent is null) and their descendants. The goal is to, given an id of a node on the table, find all nodes that are descendants of it. A is a descendant of B if either A's parent is B or A's parent is a descendant of B. Note the recursive definition. Here is some sample data: INSERT INTO nodes VALUES (1, NULL); INSERT INTO nodes VALUES (2, 1); INSERT INTO nodes VALUES (3, 2); INSERT INTO nodes VALUES (4, 3); INSERT INTO nodes VALUES (5, 3); INSERT INTO nodes VALUES (6, 2); which represents: 1 `-- 2 |-- 3 | |-- 4 | `-- 5 | `-- 6 We can select the (immediate) children of 1 by doing this: SELECT a.* FROM nodes AS a WHERE parent=1; We can select the children and grandchildren of 1 by doing this: SELECT a.* FROM nodes AS a WHERE parent=1 UNION ALL SELECT b.* FROM nodes AS a, nodes AS b WHERE a.parent=1 AND b.parent=a.id; We can select the children, grandchildren, and great grandchildren of 1 by doing this: SELECT a.* FROM nodes AS a WHERE parent=1 UNION ALL SELECT b.* FROM nodes AS a, nodes AS b WHERE a.parent=1 AND b.parent=a.id UNION ALL SELECT c.* FROM nodes AS a, nodes AS b, nodes AS c WHERE a.parent=1 AND b.parent=a.id AND c.parent=b.id; How can a query be constructed that gets all descendants of node 1 rather than those at a finite depth? It seems like I would need to create a recursive query or something. I'd like to know if such a query would be possible using SQLite. However, if this type of query requires features not available in SQLite, I'm curious to know if it can be done in other SQL databases.

    Read the article

  • Microsoft.Build.Engine Error (default targets): Target GetFrameworkPaths: Could not locate the .NET

    - by Mitchan Adams
    I am writing a webservice, that when called should build a C# project. I'm using the framework 2 reference, Microsoft.Buld.Engine and Microsoft.Build.Framework. If you look under the '<Import>' section .csproj file, by default it has: <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> which I then changed to: <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> My code to build the csproj is: Engine buildEngine = new Engine(Path.Combine(Environment.GetEnvironmentVariable("SystemRoot"), @"Microsoft.NET\Framework\v2.0.50727")); FileLogger logger = new FileLogger(); logger.Parameters = @"logfile=c:\temp\build.log"; buildEngine.RegisterLogger(logger); bool success = buildEngine.BuildProjectFile([Path_Of_Directory]+ "ProjectName.csproj"); buildEngine.UnregisterAllLoggers(); The success variable returns a false because the build faild. I then check the build.log file and this is the error I recieve: *Build started 3/17/2010 11:16:56 AM. ______________________________ Project "[Path_Of_Directory]\ProjectName.csproj" (default targets): Target GetFrameworkPaths: Could not locate the .NET Framework SDK. The task is looking for the path to the .NET Framework SDK at the location specified in the SDKInstallRootv2.0 value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework. You may be able to solve the problem by doing one of the following: 1.) Install the .NET Framework SDK. 2.) Manually set the above registry key to the correct location. Target* I cant understand why it wont build. Any help will be much appreciated. Thanks

    Read the article

  • Variant datatype library for C

    - by Joey Adams
    Is there a decent open-source C library for storing and manipulating dynamically-typed variables (a.k.a. variants)? I'm primarily interested in atomic values (int8, int16, int32, uint, strings, blobs, etc.), while JSON-style arrays and objects as well as custom objects would also be nice. A major case where such a library would be useful is in working with SQL databases. The most obvious feature of such a library would be a single type for all supported values, e.g.: struct Variant { enum Type type; union { int8_t int8_; int16_t int16_; // ... }; }; Other features might include converting Variant objects to/from C structures (using a binding table), converting values to/from strings, and integration with an existing database library such as SQLite. Note: I do not believe this is question is a duplicate of http://stackoverflow.com/questions/649649/any-library-for-generic-datatypes-in-c , which refers to "queues, trees, maps, lists". What I'm talking about focuses more on making working with SQL databases roughly as smooth as working with them in interpreted languages.

    Read the article

  • What is the `name` keyword in JavaScript?

    - by Joey Adams
    When I typed this apparently innocent snippet of code: values.name gedit highlighted name as a keyword. However, name is not listed by the pages linked to by an answer to a question about reserved keywords. I also did a couple trivial tests in SpiderMonkey, but name seemed to act like an ordinary identifier. A Google search didn't tell me much either. However, I did find a page listing name in "Other JavaScript Keywords". My guess is that name is a function or a member of some DOM element and does not intrude on the namespace. Is name really a keyword in JavaScript? If so, what does it do?

    Read the article

  • How to convert hexadecimal representation of data to binary data in PHP?

    - by Marcus Adams
    I'm familiar with php's function bin2hex() for converting binary data to its hexadecimal representation. However, what is the complement function to convert the hexadecimal representation of the data back to binary data? For example: $foo = "hello"; $foo = bin2hex($foo); echo $foo; // Displays 68656c6c6f How do I turn it back to hello? $foo = "68656c6c6f"; // Now what? There is no hex2bin() function.

    Read the article

  • How do you convert a hexadecimal representation of data to binary data in PHP?

    - by Marcus Adams
    I'm familiar with php's function bin2hex() for converting binary data to its hexadecimal representation. However, what is the complement function to convert the hexadecimal representation of the data back to binary data? For example: $foo = "hello"; $foo = bin2hex($foo); echo $foo; // Displays 68656c6c6f How do I turn it back to hello? $foo = "68656c6c6f"; // Now what? There is no hex2bin() function.

    Read the article

  • ANSI C blackjack assignment, linux GCC compiler, i'm stuck...

    - by Bill Adams
    Here's what i have so far... I have yet to figure out how i'm going to handle the 11 / 1 situation with an ace, and when the player chooses an option for hit/stand, i get segfault. HELP!!! #include <stdio.h> #include <string.h> #include <stdlib.h> #include <time.h> #define DECKSIZE 52 #define VALUE 9 #define FACE 4 #define HANDSIZE 26 typedef struct { int value; char* suit; char* name; }Card; typedef struct { int value; char* suit; char* name; }dealerHand; typedef struct { int value; char* suit; char* name; }playerHand; Card cards[DECKSIZE]; dealerHand deal[HANDSIZE]; playerHand dealt[HANDSIZE]; char *faceName[]={"two","three", "four","five","six", "seven","eight","nine", "ten", "jack","queen", "king","ace"}; char *suitName[]={"spades","diamonds","clubs","hearts"}; void printDeck(){ int i; for(i=0;i<DECKSIZE;i++){ printf("%s of %s value = %d\n ",cards[i].name,cards[i].suit,cards[i].value); if((i+1)%13==0 && i!=0) printf("-------------------\n\n"); } } void shuffleDeck(){ srand(time(NULL)); int this; int that; Card temp; int c; for(c=0;c<10000;c++){ //c is the index for number of individual card shuffles should be set to c<10000 or more this=rand()%DECKSIZE; that=rand()%DECKSIZE; temp=cards[this]; cards[this]=cards[that]; cards[that]=temp; } } /*void hitStand(i,y){ // I dumped this because of a segfault i couldn't figure out. int k; printf(" Press 1 to HIT or press 2 to STAND:"); scanf("%d",k); if(k=1){ dealt[y].suit=cards[i].suit; dealt[y].name=cards[i].name; dealt[y].value=cards[i].value; y++; i++; } } */ int main(){ int suitCount=0; int faceCount=0; int i; int x; int y; int d; int p; int k; for(i=0;i<DECKSIZE;i++){ //this for statement builds the deck if(faceCount<9){ cards[i].value=faceCount+2; }else{ //assigns face cards as value 10 cards[i].value=10; } cards[i].suit=suitName[suitCount]; cards[i].name=faceName[faceCount++]; if(faceCount==13){ //this if loop increments suit count once cards[i].value=11; //all faces have been assigned, and also suitCount++; //assigns the ace as 11 faceCount=0; } //end building deck } /*printDeck(); //prints the deck in order shuffleDeck(); //shuffles the deck printDeck(); //prints the deck as shuffled This was used in testing, commented out to keep the deck hidden!*/ shuffleDeck(); x=0; y=0; for(i=0;i<4;i++){ //this for loop deals the first 4 cards, dealt[y].suit=cards[i].suit; //first card to player, second to dealer, dealt[y].name=cards[i].name; //as per standard dealing practice. dealt[y].value=cards[i].value; i++; y++; deal[x].suit=cards[i].suit; deal[x].name=cards[i].name; deal[x].value=cards[i].value; x++; } printf(" Dealer's hand is: %s of %s and XXXX of XXXX. (Second card is hidden!)\n",deal[0].name,deal[0].suit,deal[1].name,deal[1].suit); printf(" Player's hand is: %s of %s and %s of %s.\n",dealt[0].name,dealt[0].suit,dealt[1].name,dealt[1].suit); printf(" the current value of the index i=%d\n",i); //this line gave me the value of i for testing d=deal[0].value+deal[1].value; p=dealt[0].value+dealt[1].value; if(d==21){ printf(" The Dealer has Blackjack! House win!\n"); }else{ if(d>21){ printf(" The dealer is Bust! You win!\n"); }else{ if(d>17){ printf(" Press 1 to HIT or 2 to STAND"); scanf("%d",k); if(k==1){ dealt[y].suit=cards[i].suit; dealt[y].name=cards[i].name; dealt[y].value=cards[i].value; y++; i++; } }else{ if(d<17){ printf(" Dealer Hits!"); deal[x].suit=cards[i].suit; deal[x].name=cards[i].name; deal[x].value=cards[i].value; x++; i++; } } } } return 0; }

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >