Excizted 67 Posting Whiz

Come on. What are you asking?

Do you need to be professional to earn money?
It's in the word.

Do you need to be the best? No, many mediocre developers get paid just fine.

Excizted 67 Posting Whiz

Thanks for all your answers.
I was sure I tested whether the output from the Java code corresponded to PHP's md5() function, but apparantly I did something wrong. Because I see @cereal was right actually.

Sorry for not noticing this myself!

Thanks again.

Excizted 67 Posting Whiz

In short, this would be a bug. Too harmless for anyone to care go through the incredibly backtrace of debugging it.

Thing is, graphics software and drivers are extremely complex and much can and will go wrong.

Maybe your computer is set up to use a given color profile, and then your buggy flash application (be it a game or an ad) mismatches with this color profile, and then show "nothing" (in the context of the application) - thus rendering the content beneath as per the graphics driver definitions.

I'm not an expert on the subject, but this is my idea from experience with working with and developing all sorts of applications.

RikTelner commented: It doesn't matter if you aren't expert. I see you really trying explain me what/how. =) +2
Excizted 67 Posting Whiz

Hi there,

When you are updating the text hint with Ajax, your Javascript code looks for the first element with ID="txtHint".

But you are creating multiple elements with ID="txtHint" and so your hint will always be shown in the first row.

To resolve this you need to correlate the Ajax call to a given row and make sure your ID's are unique.

For example when creating a new row (line 98 in your snippet) do something like

var numRows = 1; // keep track of how many rows you have
$('#addmore').on('click', function(){
numRows++; // when adding a row, increment the count
...
data += '<input type="text" name="conn_type[]" id="conn_type" onChange="showptype(this.value, \'txtHint' + numRows + '\');">...<div id="txtHint' + numRows + '"></div>...';
// use the number in the ID of your element ^ and when calling Ajax
...
}

Now you just need to use the second argument of showptype to find the right txtHint.

function showptype(str1, txtHintID) // second parameter added
{
if (str1=="")
  {
  // we use the variable txtHintID which should contain fx "txtHint2" or "txtHint7" depending on the row called from
  document.getElementById(txtHintID).innerHTML=""; 

  ... // and so on, update your other txtHint-references too

This should be more than enough to get you finished.

Remember - always keep unique IDs or things will break ;-)

Excizted 67 Posting Whiz

Hi there.

I assume you are using PHP as your programming language. You must use PHP to develop the logic of finding out whether or not something has been clicked on the HTML end.

When your PHP program knows this, fx by the POST-variable you mentioned

if(isset($_POST['like']))
{ // So the LIKE-button was pressed

}

You would add any logic to prevent liking multiple times in there too.

Then you can increment the database value independent of PHP-variables, with the query below. But first, you are saying your table columns "likes" and "dislikes" are varchar-type. Varchar is for characters, and I think you want "likes" and "dislikes" to be a count (number, integer). So please change their type to something like int(11), unsigned optionally.

Then you can do

UPDATE clicks SET likes = likes+1 WHERE user_associated = {$_SESSION['user_id']}

Where $_SESSION['user_id'] being an integer user id, you can change that to whatever variable you use.

I hope this helps.

Excizted 67 Posting Whiz

KVM over IP requires hardware.

Excizted 67 Posting Whiz

isdigit checks a character if it is a digit character.
The user entered string is parsed into a float (float fahrenheit; on line 10) and is automatically (if possible) converted to a digit.

This means you will not be able to check if the entered string was letters or numbers.

You would have to read the cin to a character array instead, and then check each character for validity.

You could do something like this:

char input[10]; // max length is 9 (tenth place is needed for terminating null)
cin >> input;
for(unsigned int i = 0; i < 10; i++) // 10 again, as we wrote it in input size
{
    if(input[i] == '\0') // we have reached the end of the input
        break; 
    if(!isdigit(input[i]))
    {
        cout << input << " contains invalid characters." << endl;
        return -1; // exit program
    }
}
Excizted 67 Posting Whiz

Initially store the descr of the selected one (get it from mysql).
Then in your while loop, you check if $r == $your_new_variable;

If it is, then you echo "selected" in your <option> tag.

pietpiraat commented: thanks for helping +1
Excizted 67 Posting Whiz

Sure, what's your address? :) Or do you have a 3D printer, then I could just do a 3D scan and send it over?

Excizted 67 Posting Whiz

Yes it is a different domain - setup to show the same content though.

In DNS it is usually setup like this
my.domain.com A 000.000.000
www.my.domain.com CNAME my.domain.com

Unless you use virtual servers in Apache, theres not much more to it.

But in all correctness, it is different domains.
WWW. prefix is nothing special, just some old guy who thought the world would be better if we put www. in front of everything ;)

Excizted 67 Posting Whiz

Well for no sensitivity, just do a MD5 of the image data before and image data after.

If they are not equal, it would mean the image has changed and you will have your program crank up the volume and play some annyoing sound.

Edit: Of course you could also just check every byte of each image for equality, but I think the MD5 way is faster.

3ndl3ss commented: good thought +1
Excizted 67 Posting Whiz

Oh god.. I can't believe this..
I talked to a Windows developer about this error too, he suggested I was including the file from inside a function, i stated NO I wouldn't do that.. And the very latest function in my program.. does that.. I couldn't even remember..

Well sorry for bothering :) Remember lads, don't include from inside functions xD

Ancient Dragon commented: Great going on your research :) +28
Excizted 67 Posting Whiz

Very nice! :)
I think that could come in handy for someone at least ;)
I could probably use it - would it be too hard to build it for Linux? :)
You could also put up the source, then maybe I could rewrite it myself...
If you want to of course! :)

Excizted 67 Posting Whiz

If you're on Windows, DarkGDK is simple and (once it was atleast) Microsoft supported.

Excizted 67 Posting Whiz

You might wanna post your solution for others that stumbles upon this thread next week, maybe next month maybe in a few years! :)

At least i hate googling and then being cheered up by finding a post exactly regarding my problem, and the solution is: "I found the solution".

Excizted 67 Posting Whiz

Hello and welcome to Daniweb.
Usually all the friendly people here would give a prompte response.
You haven't had any yet. I'm not gonna go into your code right now, but instead take a look at your posting problem.

First of all, you want to get rid of your last error. What is the error? What part is working and which doesn't?

Secondly, where's your code tags? Wrap your code in [code] tags, to make it easily readable and to give some syntax highlighting.

Lastly, your copying of the code seemed to miss out your code formatting. Or maybe you haven't even done your formatting at all? This is important, otherwise your code is junk to read and hard to manage and maintain.

Fix those problems by editing your original post, and I'm sure you'll get your help! :)
Good luck!

Excizted 67 Posting Whiz

Maybe if you included a bit more code? It seems complicated what you're trying to do, at least I didn't really understand what your goal is from your post. Take a look at this example and let me know if it's any help.

int* array1 = new int[100]; // pointer to array of 100 ints. 
int* array2 = new int[50]; // pointer to array of 50 ints. 
int* array3 = new int[25]; // pointer to array of 25 ints. 
int* topArray[] = {array1, array2, array3}; // array of int pointers 
/* Then topArray could be in heap and addressed from a pointer, fx: */
int** topArrayPtr = &topArray; // pointer to array of pointers to array of ints 
// maybe it's &topArray[] actually

Well I dunno if this small sample crosses your problem, but there ya go anyway.

Excizted 67 Posting Whiz

No problem, buy me an ice cream now :)

Nick Evan commented: <8 (it's icecream rotated 90 degrees) +12
Excizted 67 Posting Whiz

I don't understand your last post.
I can tell you that when you make some variable, it magically appears in the computers memory. Magic.
A pointer contains a memory address. They are used to access whatever is a that memory position.

References and pointers are basically the same.
Except pointers may change their address.

Example:

float* numPtr = new float(10); // the new operator creates a float that isn't associated to a scope. Means it lives until it is manually deleted.
std::cout << *numPtr; // We have to write * in front of our pointer, otherwise the pointers contained address is output, instead of the value of the memory at that address
numPtr = new float(133);
std::cout << *numPtr; // we output the same pointer, but it has a different value. MAGIC!
// Oh well, now where here. What now? Oh yes, we gotta delete the floats we created:
delete numPtr;
delete ... // Oh gawd, we don't have the address of the other float anymore. This is a memory leek. But don't worry, exit the app and your OS will delete the associated memory anyway.

So what is the point of it?
Well in C++ you may have a whole lot of objects, but only one is to be active at a time. So you have a pointer, and your code will work with that pointer. But you dynamically change the address in that pointer, and the code has a whole other …

Excizted 67 Posting Whiz

how to delete a string index inside an array that the user inputs???,, could someone pls
help??

Useless title - but indeed, your post is so short, you might just written it in the title.

Also, I don't even understand what you want to do.
You have a user inputted string? Alright.
An array? With what? Predefined size?

More info, and you will get help. And while you update your post to be useful, (and of course you'll update your existing one instead of making a reply, I'm sure) then update the title to something relevant. "Delete String inside Array" or whatever you mean.

Salem commented: Nicely put +19
Excizted 67 Posting Whiz

You seem friendly. God I want to help you. You have an error, I must help.
The only problem is.... I don't know what your problem is.
- Compiler error? Post it here.
- Runtime expectation mismatch? What happens, and what doesn't?

Almost a good and useable post that could get answers, would just make life easier for us to do so, if we knew a bit more about the mentioned error you have.

Excizted 67 Posting Whiz

Hey, please download my 100 dollars and upload it when you have made it a billion dollars.
You see whats wrong? This is a forum. We help each other. We don't work for each other.

shouvik.d commented: well said! +4
Excizted 67 Posting Whiz

+rep WaltP :D

Excizted 67 Posting Whiz

Do you want help?

More seems like a challenge or something?
At least to achieve this you really only need very basic knowledge of C++. A friend of mine was able to do almost the same with no programming knowledge of any kind, just using his intuition and the one hint about std::cin, std::cout and std::string to exist, but not how to use them.

Excizted 67 Posting Whiz

Use code tags, man! :(

Excizted 67 Posting Whiz

Correct me if I'm wrong...

So since the params in the constructor are only used to initialise the name and age variables, declaring them as const/reference is more a safety/performance advantage as opposed to any difference in functionality?

("difference in functionality" - for example, if name and age were declared const, they would not be able to be mutated later on in the program)

Indeed that is correct.

When you then copy the data from the const reference parameters, it will still be the same data, and the type of the new variable you create is not affected.

To summarize, not using reference would mean something like this:

std::string name = "something"; // < A string is created and is now taking up memory
classe(name); // < classe(string inputName); is making a new string with the same content as name.
classe(string inputName) : classname(inputName){} // < finally, the copied string is now copied once again

This is odd, to make 3 strings, for the same data, when you only need two, maybe even just one.
So using references is the way to do it to win performance.

Maybe you later add functionality to the ctor, and you might risk changing inputName, which is a reference to the original string. So you change the original string, which may be used by several other functions too *gasp*. So by making it const, you make sure you are unable to do that.

Excizted 67 Posting Whiz

Because the filenames are the same, VC++ can't guess which way to handle it. No loop tho :)

Excizted 67 Posting Whiz

Well I've had this kind of behavior with #include.

If I in file 1 include file 2, and in file 2 include file 1, the both files would simply seem not to be there at compile time.

I guess it's the same for you. You told it to use a library, which you made two available of, then VC++ says "Hello Trashcan".

You should instead have a configuration for x86 and one for x64, and then include the respective folders in their configuration. Then prior to compilation, you choose which configuration to use, and VS will take care of including the right libraries.

Excizted 67 Posting Whiz

Looks like a school assignment...
Can't believe you go to school if you don't want to learn anything, which is what comes out of this kinda stuff.. No learning.

Excizted 67 Posting Whiz

Files too. Sorry I forgot to mention that.

Then with the windows header (windows.h) you can use FindFirstFile.

Example of usage:

WIN32_FIND_DATA findFileData;
HANDLE hFind;
hFind = FindFirstFile((LPCSTR)"C:\\Users\\Local Settings\\Temp\\*", &findFileData);
if(hFind != INVALID_HANDLE_VALUE)
{
string filename(findFileData.cFileName);
cout << filename;
} 

while(FindNextFile(hFind, &findFileData))
{
string filename(findFileData.cFileName);
cout << filename;
}

That should get you started, otherwise ask :)

iDevelop commented: Thank You SO Much!! +0
Excizted 67 Posting Whiz

No one has a clue?