<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>j9678's Feed - Programmer's Heaven</title>
    <link>http://www.programmersheaven.com/feed/User/109007/RSS.aspx</link>
    <description>Events at Programmer's Heaven related to the user j9678.</description>
    <language>en</language>
    <copyright>Copyright 2010 Programmers Heaven</copyright>
    <pubDate>Mon, 15 Mar 2010 20:48:40 -0700</pubDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <item>
      <title>Re: VBScript for Windows cluster</title>
      <link>http://www.programmersheaven.com/mb/VBasic/396197/396245/ReadMessage.aspx#396245</link>
      <description>&lt;p&gt;Posted a '&lt;a href="http://www.programmersheaven.com/mb/VBasic/396197/396245/ReadMessage.aspx#396245"&gt;reply&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/VBasic/Board.aspx"&gt;Visual Basic&lt;/a&gt; forum.&lt;/p&gt;The problem solved. There was an invalid command inside the batch file cause the error. Thanks to those who had read my thead.</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/396197/396245/ReadMessage.aspx#396245</guid>
      <pubDate>Tue, 01 Sep 2009 00:22:47 -0700</pubDate>
    </item>
    <item>
      <title>VBScript for Windows cluster</title>
      <link>http://www.programmersheaven.com/mb/VBasic/396197/396197/ReadMessage.aspx#396197</link>
      <description>&lt;p&gt;Posted a '&lt;a href="http://www.programmersheaven.com/mb/VBasic/396197/396197/ReadMessage.aspx#396197"&gt;new message&lt;/a&gt; on the &lt;a href="http://www.programmersheaven.com/mb/VBasic/Board.aspx"&gt;Visual Basic&lt;/a&gt; forum.&lt;/p&gt;I need the Windows cluster member to auto run a batch job when the cluster resources are fail over to it from another member.&lt;br /&gt;
I use the vbscript below:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Dim WshShell
Set WshShell = CreateObject("WScript.Shell")
Function Online()
  RunCommand "c:\start.bat", True
  Online = 0
End Function
Function Open()
  Open = 0
End Function
Function Close()
  Close = 0
End Function
Function LooksAlive()
  LooksAlive = 0
End Function
Function IsAlive()
  IsAlive = 0
End Function
Function RunCommand(command, wait)
  RunCommand = WshShell.Run(command, 1, wait)
End Function
&lt;/pre&gt;&lt;br /&gt;
The problem is I can't bring it online in cluster administrator, and can't trigger the batch job. It show an error code and I think i miss something in the code.&lt;br /&gt;
Please, Is there anyone can help me !!!</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBasic/396197/396197/ReadMessage.aspx#396197</guid>
      <pubDate>Mon, 31 Aug 2009 07:21:06 -0700</pubDate>
    </item>
    <item>
      <title>Re: Borland Builder 6 multiple source files problem</title>
      <link>http://www.programmersheaven.com/mb/bcbuilder/371837/371838/ReadMessage.aspx#371838</link>
      <description>&lt;p&gt;Posted the message '&lt;a href="http://www.programmersheaven.com/mb/bcbuilder/371837/371838/ReadMessage.aspx#371838"&gt;Re: Borland Builder 6 multiple source files problem&lt;/a&gt;' on the &lt;a href="http://www.programmersheaven.com/mb/bcbuilder/Board.aspx"&gt;C++ Builder&lt;/a&gt; forum.&lt;/p&gt;: I don't know how to compile and link programs consisting of multiple &lt;br /&gt;
: source files in Borland Builder 6.&lt;br /&gt;
: The compiler show the class members have the problem of unresolve &lt;br /&gt;
: link if I place all 3 files (header, source-code, main program) in &lt;br /&gt;
: the same directory.&lt;br /&gt;
:  &lt;br /&gt;
Just found the answer in the previous post. Thanks for reading this.</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/bcbuilder/371837/371838/ReadMessage.aspx#371838</guid>
      <pubDate>Mon, 12 May 2008 07:46:21 -0700</pubDate>
    </item>
    <item>
      <title>Borland Builder 6 multiple source files problem</title>
      <link>http://www.programmersheaven.com/mb/bcbuilder/371837/371837/ReadMessage.aspx#371837</link>
      <description>&lt;p&gt;Posted the message '&lt;a href="http://www.programmersheaven.com/mb/bcbuilder/371837/371837/ReadMessage.aspx#371837"&gt;Borland Builder 6 multiple source files problem&lt;/a&gt;' on the &lt;a href="http://www.programmersheaven.com/mb/bcbuilder/Board.aspx"&gt;C++ Builder&lt;/a&gt; forum.&lt;/p&gt;I don't know how to compile and link programs consisting of multiple source files in Borland Builder 6.&lt;br /&gt;
The compiler show the class members have the problem of unresolve link if I place all 3 files (header, source-code, main program) in the same directory.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/bcbuilder/371837/371837/ReadMessage.aspx#371837</guid>
      <pubDate>Mon, 12 May 2008 06:44:34 -0700</pubDate>
    </item>
    <item>
      <title>Re: How to solve this bug ?</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/371729/371816/ReadMessage.aspx#371816</link>
      <description>&lt;p&gt;Posted the message '&lt;a href="http://www.programmersheaven.com/mb/beginnercpp/371729/371816/ReadMessage.aspx#371816"&gt;Re: How to solve this bug ?&lt;/a&gt;' on the &lt;a href="http://www.programmersheaven.com/mb/beginnercpp/Board.aspx"&gt;Beginner C/C++&lt;/a&gt; forum.&lt;/p&gt;&lt;pre class="sourcecode"&gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;ctype.h&amp;gt;
#include &amp;lt;string.h&amp;gt;
struct inputNode{
        char Id[8];
        char Name[31];
        char Class[4];
        char Position[51];
        struct inputNode *nextPtr;
};
typedef struct inputNode InputNode;
typedef InputNode *InputNodePtr;
void inputScreen1(void);
void inputScreen11(InputNodePtr *, FILE *);
int print(FILE *);
void main(){
        InputNodePtr inputPtr = NULL;
        int choice;
        FILE *sfPtr;
        printf("XXX Secondary School Student's Union\n");
        printf("1.\tAdd new member information\n");
        printf("2.\tPrint member list\n");
        printf("3.\tExit\n");
        printf("Please enter your choice:");
        scanf("%d", &amp;amp;choice);
        while (choice != 3){
                switch (choice){
                        case 1:
                                if ((sfPtr = fopen("students.txt", "a")) == NULL)
                                        printf("File could not be open.\n");
                                else
                                        inputScreen11(&amp;amp;inputPtr, sfPtr);
                                fclose(sfPtr);
                                break;
                        case 2:
                                if ((sfPtr = fopen("students.txt", "r")) == NULL)
                                        printf("File could not be open.\n");
                                else
                                        choice = print(sfPtr);
                                fclose(sfPtr);
                                break;
                        default:
                                printf("Invalid choice.\n");
                                break;
                }
                if (choice != 3){
                        inputScreen1();
                        scanf("%d", &amp;amp;choice);
                        getchar();
                }
        }
        system("pause");
}
void inputScreen1(void){
        printf("1. Add new member information\n");
        printf("2. Print member list\n");
        printf("3. Exit\n");
        printf("Please enter your choice:");
}
void inputScreen11(InputNodePtr *topPtr, FILE *fPtr){
        void createFile(FILE *, InputNodePtr);
        char id[8], na[31], cl[4], po[51], add;
        InputNodePtr newPtr;
        printf("Please enter the followings:\n");
        do{
                printf("Student Id: ");
                scanf("%s", id);
                getchar();
                if (strlen(id) != 7)
                        printf("7 characters only\n");
        }while (strlen(id) != 7);
        do{
                printf("Student Name: ");
                gets(na);
                if (strlen(na) &amp;gt; 30)
                        printf("Max. 30 characters\n");
        }while (strlen(na) &amp;gt; 30);
        do{
                printf("Class: ");
                scanf("%s", cl);
                getchar();
                if (strlen(cl) != 3)
                        printf("3 characters only\n");
        }while (strlen(cl) != 3);
        do{
                printf("Position: ");
                gets(po);
                if (strlen(po) &amp;gt; 50)
                        printf("Max. 50 characters\n");
        }while (strlen(po) &amp;gt; 50);
        do{
                printf("Are you sure to add new member information(Y/N)?");
                scanf("%c", &amp;amp;add);
                getchar();
                if (islower(add))
                        add = toupper(add);
                switch (add){
                        case 'Y':
                                newPtr = malloc(sizeof(InputNode));
                                if (newPtr != NULL){
                                        strcpy(newPtr-&amp;gt;Id, id);
                                        strcpy(newPtr-&amp;gt;Name, na);
                                        strcpy(newPtr-&amp;gt;Class, cl);
                                        strcpy(newPtr-&amp;gt;Position, po);
                                        newPtr-&amp;gt;nextPtr = *topPtr;
                                        *topPtr = newPtr;
                                }
                                createFile(fPtr, newPtr);
                                free(newPtr);
                                break;
                        case 'N':
                                break;
                        default:
                                printf("Invalid choice.\n");
                                break;
                }
        }while ((add != 'Y') &amp;amp;&amp;amp; (add != 'N'));
}
void createFile(FILE *fPtr, InputNodePtr writePtr){
        fprintf(fPtr, "%s %s %s %s\n", writePtr-&amp;gt;Id, writePtr-&amp;gt;Name, writePtr-&amp;gt;Class, writePtr-&amp;gt;Position);
}
int print(FILE *fPtr){
        struct inputNode input = {"", "", "", ""};
        char re;
        printf("Student id\tStudent Name\t\tClass\t\tPosition\n");
        fscanf(fPtr, "%s%s%s%s", input.Id, input.Name, input.Class, input.Position);
        while (!feof(fPtr)){
                printf("%-16s%-24s%s%21s\n", input.Id, input.Name, input.Class, input.Position);
                fscanf(fPtr, "%s%s%s%s", input.Id, input.Name, input.Class, input.Position);
        }
        do{
                printf("Return to Main Menu / Exit the program (R/E):");
                scanf("%c", &amp;amp;re);
                if (islower(re))
                        re = toupper(re);
                if (re == 'R')
                        return 0;
                else if (re == 'E')
                        return 3;
                else
                        printf("Invalid choice.\n");
        }while ((re != 'R') &amp;amp;&amp;amp; (re != 'E'));
        return 0;
}
&lt;/pre&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/371729/371816/ReadMessage.aspx#371816</guid>
      <pubDate>Fri, 09 May 2008 01:04:48 -0700</pubDate>
    </item>
    <item>
      <title>How to solve this bug ?</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/371729/371729/ReadMessage.aspx#371729</link>
      <description>&lt;p&gt;Posted the message '&lt;a href="http://www.programmersheaven.com/mb/beginnercpp/371729/371729/ReadMessage.aspx#371729"&gt;How to solve this bug ?&lt;/a&gt;' on the &lt;a href="http://www.programmersheaven.com/mb/beginnercpp/Board.aspx"&gt;Beginner C/C++&lt;/a&gt; forum.&lt;/p&gt;This program has a bug. If you choose option 2 (ofcoz you need to have file students.txt first, which can create by option 1). It will print the statement "Return to Main ..." twice. I expect it should print once only.&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;ctype.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
struct inputNode{&lt;br /&gt;
        char Id[8];&lt;br /&gt;
        char Name[31];&lt;br /&gt;
        char Class[4];&lt;br /&gt;
        char Position[51];&lt;br /&gt;
        struct inputNode *nextPtr;&lt;br /&gt;
};&lt;br /&gt;
typedef struct inputNode InputNode;&lt;br /&gt;
typedef InputNode *InputNodePtr;&lt;br /&gt;
void inputScreen1(void);&lt;br /&gt;
void inputScreen11(InputNodePtr *, FILE *);&lt;br /&gt;
int print(FILE *);&lt;br /&gt;
void main(){&lt;br /&gt;
        InputNodePtr inputPtr = NULL;&lt;br /&gt;
        int choice;&lt;br /&gt;
        FILE *sfPtr;&lt;br /&gt;
        printf("XXX Secondary School Student's Union\n");&lt;br /&gt;
        printf("1.\tAdd new member information\n");&lt;br /&gt;
        printf("2.\tPrint member list\n");&lt;br /&gt;
        printf("3.\tExit\n");&lt;br /&gt;
        printf("Please enter your choice:");&lt;br /&gt;
        scanf("%d", &amp;amp;choice);&lt;br /&gt;
        while (choice != 3){&lt;br /&gt;
                switch (choice){&lt;br /&gt;
                        case 1:&lt;br /&gt;
                                if ((sfPtr = fopen("students.txt", "a")) == NULL)&lt;br /&gt;
                                        printf("File could not be open.\n");&lt;br /&gt;
                                else&lt;br /&gt;
                                        inputScreen11(&amp;amp;inputPtr, sfPtr);&lt;br /&gt;
                                fclose(sfPtr);&lt;br /&gt;
                                break;&lt;br /&gt;
                        case 2:&lt;br /&gt;
                                if ((sfPtr = fopen("students.txt", "r")) == NULL)&lt;br /&gt;
                                        printf("File could not be open.\n");&lt;br /&gt;
                                else&lt;br /&gt;
                                        choice = print(sfPtr);&lt;br /&gt;
                                fclose(sfPtr);&lt;br /&gt;
                                break;&lt;br /&gt;
                        default:&lt;br /&gt;
                                printf("Invalid choice.\n");&lt;br /&gt;
                                break;&lt;br /&gt;
                }&lt;br /&gt;
                if (choice != 3){&lt;br /&gt;
                        inputScreen1();&lt;br /&gt;
                        scanf("%d", &amp;amp;choice);&lt;br /&gt;
                        getchar();&lt;br /&gt;
                }&lt;br /&gt;
        }&lt;br /&gt;
        system("pause");&lt;br /&gt;
}&lt;br /&gt;
void inputScreen1(void){&lt;br /&gt;
        printf("1. Add new member information\n");&lt;br /&gt;
        printf("2. Print member list\n");&lt;br /&gt;
        printf("3. Exit\n");&lt;br /&gt;
        printf("Please enter your choice:");&lt;br /&gt;
}&lt;br /&gt;
void inputScreen11(InputNodePtr *topPtr, FILE *fPtr){&lt;br /&gt;
        void createFile(FILE *, InputNodePtr);&lt;br /&gt;
        char id[8], na[31], cl[4], po[51], add;&lt;br /&gt;
        InputNodePtr newPtr;&lt;br /&gt;
        printf("Please enter the followings:\n");&lt;br /&gt;
        do{&lt;br /&gt;
                printf("Student Id: ");&lt;br /&gt;
                scanf("%s", id);&lt;br /&gt;
                getchar();&lt;br /&gt;
                if (strlen(id) != 7)&lt;br /&gt;
                        printf("7 characters only\n");&lt;br /&gt;
        }while (strlen(id) != 7);&lt;br /&gt;
        do{&lt;br /&gt;
                printf("Student Name: ");&lt;br /&gt;
                gets(na);&lt;br /&gt;
                if (strlen(na) &amp;gt; 30)&lt;br /&gt;
                        printf("Max. 30 characters\n");&lt;br /&gt;
        }while (strlen(na) &amp;gt; 30);&lt;br /&gt;
        do{&lt;br /&gt;
                printf("Class: ");&lt;br /&gt;
                scanf("%s", cl);&lt;br /&gt;
                getchar();&lt;br /&gt;
                if (strlen(cl) != 3)&lt;br /&gt;
                        printf("3 characters only\n");&lt;br /&gt;
        }while (strlen(cl) != 3);&lt;br /&gt;
        do{&lt;br /&gt;
                printf("Position: ");&lt;br /&gt;
                gets(po);&lt;br /&gt;
                if (strlen(po) &amp;gt; 50)&lt;br /&gt;
                        printf("Max. 50 characters\n");&lt;br /&gt;
        }while (strlen(po) &amp;gt; 50);&lt;br /&gt;
        do{&lt;br /&gt;
                printf("Are you sure to add new member information(Y/N)?");&lt;br /&gt;
                scanf("%c", &amp;amp;add);&lt;br /&gt;
                getchar();&lt;br /&gt;
                if (islower(add))&lt;br /&gt;
                        add = toupper(add);&lt;br /&gt;
                switch (add){&lt;br /&gt;
                        case 'Y':&lt;br /&gt;
                                newPtr = malloc(sizeof(InputNode));&lt;br /&gt;
                                if (newPtr != NULL){&lt;br /&gt;
                                        strcpy(newPtr-&amp;gt;Id, id);&lt;br /&gt;
                                        strcpy(newPtr-&amp;gt;Name, na);&lt;br /&gt;
                                        strcpy(newPtr-&amp;gt;Class, cl);&lt;br /&gt;
                                        strcpy(newPtr-&amp;gt;Position, po);&lt;br /&gt;
                                        newPtr-&amp;gt;nextPtr = *topPtr;&lt;br /&gt;
                                        *topPtr = newPtr;&lt;br /&gt;
                                }&lt;br /&gt;
                                createFile(fPtr, newPtr);&lt;br /&gt;
                                free(newPtr);&lt;br /&gt;
                                break;&lt;br /&gt;
                        case 'N':&lt;br /&gt;
                                break;&lt;br /&gt;
                        default:&lt;br /&gt;
                                printf("Invalid choice.\n");&lt;br /&gt;
                                break;&lt;br /&gt;
                }&lt;br /&gt;
        }while ((add != 'Y') &amp;amp;&amp;amp; (add != 'N'));&lt;br /&gt;
}&lt;br /&gt;
void createFile(FILE *fPtr, InputNodePtr writePtr){&lt;br /&gt;
        fprintf(fPtr, "%s %s %s %s\n", writePtr-&amp;gt;Id, writePtr-&amp;gt;Name, writePtr-&amp;gt;Class, writePtr-&amp;gt;Position);&lt;br /&gt;
}&lt;br /&gt;
int print(FILE *fPtr){&lt;br /&gt;
        struct inputNode input = {"", "", "", ""};&lt;br /&gt;
        char re;&lt;br /&gt;
        printf("Student id\tStudent Name\t\tClass\t\tPosition\n");&lt;br /&gt;
        fscanf(fPtr, "%s%s%s%s", input.Id, input.Name, input.Class, input.Position);&lt;br /&gt;
        while (!feof(fPtr)){&lt;br /&gt;
                printf("%-16s%-24s%s%21s\n", input.Id, input.Name, input.Class, input.Position);&lt;br /&gt;
                fscanf(fPtr, "%s%s%s%s", input.Id, input.Name, input.Class, input.Position);&lt;br /&gt;
        }&lt;br /&gt;
        printf("Return to Main Menu / Exit the program (R/E):");&lt;br /&gt;
        getchar();&lt;br /&gt;
        re = toupper(re);&lt;br /&gt;
        if ((re != 'R') &amp;amp;&amp;amp; (re != 'E')){&lt;br /&gt;
                printf("Return to Main Menu / Exit the program (R/E):");&lt;br /&gt;
                scanf("%c", &amp;amp;re);&lt;br /&gt;
                re = toupper(re);&lt;br /&gt;
        }&lt;br /&gt;
        if (re == 'R')&lt;br /&gt;
                return 0;&lt;br /&gt;
        else if (re == 'E')&lt;br /&gt;
                return 3;&lt;br /&gt;
}&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/371729/371729/ReadMessage.aspx#371729</guid>
      <pubDate>Tue, 06 May 2008 11:36:07 -0700</pubDate>
    </item>
    <item>
      <title>Strange behavior of while and for loop</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/371467/371467/ReadMessage.aspx#371467</link>
      <description>&lt;p&gt;Posted the message '&lt;a href="http://www.programmersheaven.com/mb/beginnercpp/371467/371467/ReadMessage.aspx#371467"&gt;Strange behavior of while and for loop&lt;/a&gt;' on the &lt;a href="http://www.programmersheaven.com/mb/beginnercpp/Board.aspx"&gt;Beginner C/C++&lt;/a&gt; forum.&lt;/p&gt;Below is a example programm. The strange is when I add the while or for loop to the main function, The "scanf" statement inside sub-function &lt;br /&gt;
test() never execute but always return a 1.&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
int test(void);&lt;br /&gt;
void main(){&lt;br /&gt;
	int number, now;&lt;br /&gt;
	do{&lt;br /&gt;
		printf("test now\n");&lt;br /&gt;
		scanf("%d", &amp;amp;now);&lt;br /&gt;
		number = test();&lt;br /&gt;
		printf("%d\n", number);&lt;br /&gt;
	}while (now != 0);&lt;br /&gt;
	system("pause");&lt;br /&gt;
}&lt;br /&gt;
int test(){&lt;br /&gt;
	char abc;&lt;br /&gt;
	printf("Enter: ");&lt;br /&gt;
	scanf("%c", &amp;amp;abc);&lt;br /&gt;
	if (abc == 'h')&lt;br /&gt;
		return 11;&lt;br /&gt;
}</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/371467/371467/ReadMessage.aspx#371467</guid>
      <pubDate>Thu, 24 Apr 2008 22:00:30 -0700</pubDate>
    </item>
  </channel>
</rss>