Unimportant 18 Junior Poster

I created a regular function called add, which receives two pointers to integer as arguments, and returns an integer.

I declared two pointers to integer as registers, and instantiated them with the address of two arbitrary integers.

Finally, I instantiated an integer with the return value of the first function, accepting the two register variables as arguments.

Unimportant 18 Junior Poster
int add( int * a, int * b )
{
  return *a + *b;
}
register int * a( & var1 ), * b( & var 2);
int c( add( a, b ) );

Considering you didn't define a type, I suggest you avoid using registers for the time being.

Unimportant 18 Junior Poster

No, I meant for you to replace item(0) with item(selected) and set it to false, then set item(selected+1) to true. It's not the same.

Unimportant 18 Junior Poster

Something like,

ListView1.Items.Item(ListView1.FocusedItem.Index+1).Selected = True;
ListView1.Items.Item(ListView1.FocusedItem.Index).Selected = False;

Though I'm not certain of your objective.

Unimportant 18 Junior Poster

Format
SELECT (column list)
FROM (primary table)
JOIN (seconary, tertiary, ...) ON (comparator)

SELECT a.column, a.nother,
       b.for, b.cause
FROM `table` AS a
JOIN `table2` AS b
ON a.id = b.id;
Unimportant 18 Junior Poster

There is a lot of missing context, and honestly I didn't take that long to understand your question... however...

ListView1.Items(0).Selected = True
Items(0) is the first item, so it sounds like that's your problem.

Unimportant 18 Junior Poster
Unimportant 18 Junior Poster

Open a socket on port 80 and send a standard HTTP header,
I'm sorry, I don't really code VB and responded from the main page, but the concept is the same, I'll give some equivalent C++ code.

This is the constructor of a class object:

urlsock(char * URL, char * PATH) : inpacket(1024) {
        buf = new BYTE[MAX_LEN]; // send buffer
        rec = new BYTE[MAX_LEN]; // recv buffer
        memset(&hints,0,sizeof hints); // empty the uninitialized set
        WSADATA wsadata;
        if( WSAStartup(MAKEWORD(2,2),&wsadata) != 0 ) return; // failure

        hints.ai_family = AF_UNSPEC; // IPv6 or IPv4 is fine
        hints.ai_socktype = SOCK_STREAM; // connected server (protocol defaults to TCP)

        if( getaddrinfo( URL, "80", &hints, &res ) != 0 ) return; // failure

        for(r=res;r;r=r->ai_next) {
            if( (sockfd = socket(r->ai_family, r->ai_socktype, r->ai_protocol)) == -1 ) // -1 error
                continue; // next res
            if( connect(sockfd, r->ai_addr, r->ai_addrlen) == -1 ) { // -1 error
                closesocket(sockfd);
                continue; // next res
            }
            break; // we connected!
        }
        if(!r) return; // no socket
        freeaddrinfo(res); // done with result list

        sprintf((char*)buf,
            "GET %s HTTP\1.1\r\n"
            "Host: %s\r\n"
            "Connection: close\r\n"
            "Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain,q=0.8,image/png,*/*;q=0.5\r\n"
            "Accept-Language:en-us;q=0.5;en;q=0.3\r\n"
            "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n"
            "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120427 Firefox/15.0a1\r\n"
            "Referer: http://www.google.com/\r\n\r\n",
            PATH,URL);
        send(sockfd,(char*)buf,strlen((char*)buf),0);
        while(handle_recv());   // don't do anything, it's handled
        page_result.process(&inpacket);
    }

There's lots of stuff that doesn't matter to you in there, but if you look at the sprintf() command, you can see that I send a GET request for the URL.

Once you call recv(), you'll get the webpage as "plain text" …

Unimportant 18 Junior Poster
    SELECT
      c.id AS CID, c.vendorid AS VID,
      c.course_title, c.author,
      c.date_added, c.last_updated
    FROM `courses` AS c
    JOIN `vendors` AS v
    ON VID=v.id;

Print the result and think about it for a while

Unimportant 18 Junior Poster

Please give a sample of the tables.
For example, every column name and perhaps a brief description.

You can make 1 query return information from 2 or more tables using INNER JOIN.

Unimportant 18 Junior Poster

What if there is only one possible simultaneous alert?

Unimportant 18 Junior Poster

$.post('script.php'

in script.php
if(isset($_POST['names'])) print_r($_POST['names']);

Unimportant 18 Junior Poster

Beej's guides contain intros to network programming and interprocess communication which are both excellent.

Unimportant 18 Junior Poster

The two reasons with the greatest probability (IMO) are as follows:

1) The hardware specifications of your computer are too low. Reasons include but are not limited to: CPU clock speed, RAM amount and timing, motherboard front side bus speed, hard disk read and write rates, and graphics processing ability.

2) You have too much malware on your computer, which can result from an inability to assess the danger value of a particular action (ignorance) or general negligence regarding computer security (laziness).
2a) If you're using a fresh install of Windows 7, go ahead and invalidate this option.

Unimportant 18 Junior Poster

Ok ok ok, I really wanted you to figure this out on your own... but it's almost like the typo is holding you back.
Are you sure the connection is properly established?

You left your original query which causes the program to die, you never get to see the output of ->error

Unimportant 18 Junior Poster

From what you've given, there is no way to tell if you failed to submit.
I don't know what code library you're using and I don't really care to find out about its semantics, either.

For all I know, this data is successfully passed to getdata.php.
Why don't you make getdata.php perform the SQL query, and then check to see if it added a row.
Even better, have getdata.php echo something, and then when you receive the response from POST, you can draw it into a text box on the current page. That last request might be difficult for you, but you could at least provide some way of knowing if the request worked at all.

Also, it might help for you to include the HTML of #demoForm

Unimportant 18 Junior Poster

I think this may be a communication breakdown due to our differing native language.

I understand that PHP is catching your error, but you need to ask MySQL what the problem is instead.
I intuited that query did not return a valid result, which is why I attempted to make you check that case.
You'll want to make sure that $result is in fact a valid object.

Unimportant 18 Junior Poster

Specify a width of 20 - 33% for each item; display each one within <li>, such that if you had no styling, it would be a single bulleted list of pictures.

Unimportant 18 Junior Poster

From the example given in PHP Manual mysqli::query

if (!$mysqli->query("SET @a:='this will not work'")) {
        printf("Error: %s\n", $mysqli->error);
    }

If you do this, it may give you some insight.

mmcdonald commented: Helpful, but already had it in :) +2
Unimportant 18 Junior Poster
class SQLink
{
  public $sqlink;
  // make a connection...
  public function __construct( $host="localhost", $u="root", $p="", $db="" )
  { // I can't save you from this.
    $sqlink = new mysqli( $host, $u, $p, $db );
  }

  // If you want to call query with the -> operator, be careful
  // link->query [does], returns reply.
  public function __get( $q )
  {
    return $sqlink->query( $q );
  } // That's all.

  // If you're not comfortable with the language, it's probably safer for you
  // to route query this way.
  public function query( $q )
  {
    return $sqlink->query( $q );
  }

};

$sql = new SQLink( "host", "uname", "pass", "db" );
$table = "arbitrary";
$q = "SELECT * FROM $table";

$res = $sql->$q;
$res = $sql->query( $q );

P.S. In case it's not clear, you'd instantiate this in a global include file for your purpose.
P.P.S. The object doesn't have to be global to be in scope.

Unimportant 18 Junior Poster

Include the relevant code, such as that which you use to draw it.

Unimportant 18 Junior Poster

That's already page scope, and you could use $row anywhere on the page.
If $row appeared in a function, you could only use it within that function.
The scope is important, perhaps you should provide the code you're using which causes your actual problem.

Unimportant 18 Junior Poster
string before = "Deleting 11 files.ABC: Total Time = 01:16:30, Remaining Time = 00:00:00";
string after = Regex.Replace( before, @"[,= ]", "" );
Unimportant 18 Junior Poster

POST to the URL of the php script.

Unimportant 18 Junior Poster
g.DrawImage(mybitmap, 0, 0, DRAW_WIDTH, DRAW_HEIGHT);
Unimportant 18 Junior Poster

In the copy constructor or method, copy all data or change all relevant pointers.

For example,

        struct Basic
        {
           char ** deep;
           int num;

           Basic & operator=(const Basic & b)
           {
             if( this == &b )   return *this;
             for(int i=0;i<num;++i) delete [] *(deep+i);
             delete [] deep;
             deep = new char * [b.num];
             for(int i=0;i<b.num;++i)
             {
               deep[i] = new char[MAX_LEN];
               memcpy(deep[i],b.deep[i],MAX_LEN);
             }
             return *this;
           }
        };

You do this because in the best case of a shallow copy, the pointer to array 'deep' is copied directly. There are many worse cases.

Alternatively, you can pass possession of the pointer to the newer object. Only one object should "own" the base pointer, assuming you [wisely] deallocate the memory during deconstruction.
That would look something like this

struct Basic
{
  // ...
  Basic & operator=(const Basic & b)
  {
    if( this == &b ) return *this;
    deep = b.deep;
    b.deep = NULL; // calling delete on a NULL ptr does nothing according to C standard.
    return *this;
  }
};

However, this means that the original class object can no longer access the "deep" array of string.
How you approach the problem is up to you.

rubberman commented: Please don't answer class problem questions like this! -3
Unimportant 18 Junior Poster

Once you're in the new windows context, and you've logged into windows 8, you should mount the partition and access it.

Unimportant 18 Junior Poster

Geez it really seems like you're overcomplicating the task, would you mind showing me the true file format of "4D database.txt"?

I'm not really a fan of your general approach to the problem, but I also don't want to tell you how to think.

To start with, can you demonstrate that the strings "FourD1char" and "FourD2char" are exactly what you expect? I see that you have print functions, but you didn't include any sample output here. I'm just some random stranger, so I need to have a little context in order to help you. =)

Unimportant 18 Junior Poster

The problem is that the LAN is infact exposed to external connection through routing.
You would have to explain to her the principles of routing and how the router's firewall really operates.
To be fair, it is possible to make your server public (as I'm sure you're aware). I don't know your mother and so I have no idea how I would teach her subtle concepts if she isn't willing to learn them in the first place.

Perhaps set up some way that she could prove her point (in this case, fail to).

Unimportant 18 Junior Poster

That's fair, it would probably be more sane to make a purely relational table. If the OP has to ask about this though, it makes me wonder what I could suggest that would remain feasible.

Unimportant 18 Junior Poster

Here is what the CPanel website has to say about shell access.

Unimportant 18 Junior Poster

I'm sorry, I don't ever use panels unless I have to because of a client or something.
You're kind of on your own there... basically there should be some button to access the shell.
It's important to note that you have to have permission to launch the shell, which depends on the server or virtual environment.

Unimportant 18 Junior Poster

Make a column called parents and list every parent in some order of inheritance which is sane to you, as a comma delimited list of IDs.

Unimportant 18 Junior Poster

super(YOUR_SUBCLASS_NAME,self).__init__()

Unimportant 18 Junior Poster

So, what files are you including?

Unimportant 18 Junior Poster

So create some function (fun(a, b)) such that,

1) 'a' creates a unique array of the input, bool[10], marking which digits exist
2) 'b' creates a unique array of the input, bool[10], which must have at least 3 elements in common
3) returns true if UNION(array_a, array_b) contains at least 3 elements
4) returns false otherwise

There are plenty of other ways to do this, I'm not saying this is the only way.
If you are given integers instead of strings, you'll want to find each digit individually,
that means you'll want to take the original integer 'a' and a while loop, eg:
while( tmp_a ) bool[ tmp_a % 10 ] = true; tmp_a /= 10;
Or some such...

In the case that the uniqueness of the digit doesn't matter, you'll want to use int[10] instead of bool[10] and count the number of occurences.
int[tmp_a%10]++;

Unimportant 18 Junior Poster

in the file where you set $_SESSION['var']
make it do this
<?php echo $_SESSION['var']; ?>
then in the other file,

$.get( "session_page.php", function(data) { $("#my_field_id").html(data); } );

and it will probably do what you're trying to accomplish.
Though, I'm using jQuery.

PoisonedHeart commented: Thanks! +3
Unimportant 18 Junior Poster

OK, are you ready? Don't fall asleep now.

Letters are numbers in a computer.
When you establish an array, you allocate a chunk of contiguous memory to crunch with.
In this case, you will need (1) times the number of characters required to hold your information.

That is to say, if you have some letter 'a' and you save it as an integer
int letter('a');
and then you subtract 'a'
letter -= 'a';
then letter == 0 or (!letter) is true

So if you have some arbitrary array letters[1024];
and a write position
int pos(0);
letters[pos++] = (get char result) + 3;
Then you're all OK.

I'm afraid I may have given you too much of the answer.

Unimportant 18 Junior Poster

Your server needs to have an SSHD process active, and you have to connect via SSH protocol.
CPanel probably has some feature that connects to the shell one way or another.

Unimportant 18 Junior Poster

Vi is a text editor, much like notepad. It has nothing to do with your question, probably...
Check out the locate command.

Unimportant 18 Junior Poster

Ah, well in that case you're also wrong "in this thread"
since the OP stated "Define an array of pointers to the array"

Maybe you should calm down.
I'm sure you think you're right, it's natural or you wouldn't be arguing in the first place.
It's good to remember that the person you're arguing with also feels that way.

I don't think you've made strong points, other than the fact that you think the language is difficult to use.

deceptikon commented: Complete fail. -3
Unimportant 18 Junior Poster

I suggest you start by opening a blank window within the parent window.
This is so you know that you can successfully open a window within another window, and also how to do it in the simplest case.

Unimportant 18 Junior Poster

@deceptikon

Reallocation in place
I'll conceed this point, realloc can equal new if there is not enough contiguous memory available; though this case is not the most frequent.

"For this thread"
I didn't like your general attack on realloc.
You're right that the OP is inexperienced and so malloc/free could cause him some problems.

Given my misunderstanding of the OP's phrasing and primarily of "index", I would say that my solution was generally wrong, too.

To be fair though, for all you know he doesn't need to use new/delete at all, and could allocate all memory onto the stack. I never suggested that realloc() should be used in a general case.

Unimportant 18 Junior Poster

@Deceptikon
For example, the A star algorithm performs nearly an order of magnitude faster with realloc.
I don't see how you can say the functionality of reallocation in place is useless.
You are wrong.

Edit:
@Mike
You're right about my use of index, that was my own misunderstanding.
I don't believe you understand the cases in which realloc can and should be used.

Unimportant 18 Junior Poster

Add an OnClick function (JavaScript) to the item ID.
Once the user is clicking something on the page, it's no longer the server's problem. You have to change it client side.

Unimportant 18 Junior Poster

I'm talking about line 84.

Unimportant 18 Junior Poster

While this won't answer your question, I thought I should bring it to your awareness...

echo "\t<option value=\" $data['ID'] \"> $data['Employer'] </option>\r\n";

Is totally valid, and you don't have to end php to produce HTML.
I say this because I feel that it would improve the readability of your code.

At any rate, why don't you check out the page in FireBug or something?

P.S. You </div> four times during <!-- SECOND --> while it is open only twice. I have no idea what it is nested in, but it could certainly matter.

Unimportant 18 Junior Poster

@deceptikon

Memory waste
I'm not sure you read my post correctly.
If you truly index by area then you have an array such that &array[area] is valid, that's not the same as a search. My intention in pointing out the memory waste was that many area values would be uninitialized or NULL pointers. Plus the nature of area is multiplicative, and so you would allocate a great deal of memory to create even 1 large area rectangle mapped in this way. It would also increase energy demands for a linear search of the array, because of wasted elements.

HENCE, "Indexing by area seems unwise"

P.S. I don't like your reason for avoiding malloc; that you assume the programmer is an idiot.
There are plenty of valid cases both for and against malloc in different circumstances.
That is not one of those.

Unimportant 18 Junior Poster

It will probably do what you expect if you get rid of calls to ToString(), because that value is an integer right?

Unimportant 18 Junior Poster

I don't believe you can "absorb" a process this way...
However, if you open the process within the context of the parent, you'll probably be fine.