deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Rather than down vote my post, please explain how those solutions are unsuitable for you. Did you even follow my link?

Edit:
I guess you really didn't want help after all. Thanks for saving me all of that time. By the way, I deleted your previous duplicate thread of this question because you clearly abandoned it.

Shft commented: No, Because I don't care if you're an administrator, that doesn's make you different from anybody else, and you're really grinding my gears by deleting my last post +0
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Because nobody answered the first one!

That's not a good reason when your first thread is still on page 1.

I really need help with coding the software!

If you're depending on random people on a forum to complete your project, you'll fail. Guaranteed. But I'll bite. Do you know anything about sockets? Your question suggests not, so I'll link you here. And your ability to ask an answerable question is also severely lacking, so I'll also link you to here.

Please read both links in their entirety and learn what they have to teach. If you post another thread asking the same question, I'll delete it as a duplicate.

Shft commented: No...No... Miser socket no es here, you go to other daniweb +0
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

At least you waited a whole 11 hours before complaining about not getting help. Keep in mind that the forum is a volunteer effort. If you want to guarantee immediate help, you'll need to find a paid support service.

I also notice that two of your articles are not trivial questions (fewer people are likely qualified to help you), and the third is a job offer.

Clearly you have unrealistic expectations.

happygeek commented: well said sir +0
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
void foo(void); // Declaration
void foo(void); // Declaration (redundant but legal)

void foo(void) {} // Definition
void foo(void) {} // Definition (redundant and illegal)

A function definition is where you give the function a body. A declaration has no body and only lists the function signature (return type, name, and parameters). So the statement could be simplified to "a function can only have one body".

saurabh.mehta.33234 commented: thankyou for your simple explanation +0
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

From what I understand is Java is mostly understanding, implementing, and manipulating algorithms.

That's universal, it's not unique to Java.

To me this seems like I just used a simple algorithm to obtain the desired result.

In my opinion, a good professional would start with the simplest algorithm that meets requirements and only make it more complex as necessary. While it might seem inefficient, for example, I'll often use a very simple linear search on collections that are unlikely to be large enough to warrant something "faster".

So in your professional opinion does this look professional and efficient?

Well, it's poorly formatted, so that makes it unprofessional. It's not inefficient, but it is one of the worst possible hashing methods[1], so I'd say it's an unprofessional function because it fails to meet the requirements of your typical hash function: fast and minimal collisions.

[1] See additive hashing on this website.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

As far as what the requirements are: a good candidate is an expert in their field

That's not a requirement, though active members who meet the other requirements have a very strong tendency to also be experts who give excellent help rather than receive it. As an example, we were far more likely to single out someone like mike_2000_17 as a potential candidate because he is an expert. He posts very often with confidence and because of that was able to inadvertently show off traits that we look for in moderators.

It is an invite-only thing :)

Kinda sorta. I have it on good authority that Narue originally requested to become a moderator. The usual debates amongst the team ensued, but there wasn't an initial recommendation; Narue started the process by asking, and it turned out well. ;)

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Delete line 6, you're hiding the global variable with a local variable. Any changes to the local variable are lost on each iteration of the loop.

TheSmartOne1 commented: ok thankyou much, im supposed to know why 0 is output.The code isnot supposed 2 run +0
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

but the second method is not working it is printing the last entered number infinitely..

My bad, I forgot to include the actual input request:

while (infile2.good()) {
    infile2 >> n;

    if (!infile2.good())
        continue;

    cout << '\n' << n;
}
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I used eof() and good() function but there is no change in the output.

They're both wrong, so I'm not surprised. The problem is that both eof() and good() will only switch state after you've tried to read from the file and that attempt fails. So you need some way to check the state after reading but before processing what was read, otherwise you'll accidentally process the previously read item again.

Convention is this:

while (infile2 >> n)
    cout << '\n' << n;

The extraction operator will return a reference to the stream object, which when used in boolean context will give you the current state. Alternatively you can still use the eof() or good() option, but a conditional inside the loop is needed:

while (infile2.good()) {
    if (!infile2.good())
        continue;

    cout << '\n' << n;
}

That's redundant, verbose, and logically confusing, so I don't recommend it.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

The error suggests that mysql_query() returned FALSE as mentioned is one possible return value here. You need to extract more information to properly diagnose the failure:

$query = ''SELECT * FROM internet_shop';
$result = mysql_query($query);

if (!$result) {
    die("'$query' failed with error: " . mysql_error());
}
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

What version of Opera? I just tested with both 11.64 and 12.10 with no ill effect. Have you tried clearing your cache? The site attempts to force it when there are script changes, but it doesn't always seem to work. ;)

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

What is "FYP"? Anyway, if you're looking for a fuzzy string comparison then a good start would be with Levenshtein distances or Soundex.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I'm not seeing a lot of complaints, bug reports or suggestions for improvement so it looks to me like most users are either happy with the new system or not upset enough to give voice.

Or the worst case: that they're so upset that they leave quickly without voicing any complaints. Unfortunately, the vast majority of new members fit that bill because they're one shot students, get put off by the community rather than the system, or get banned for breaking the rules. I'm sure we could analyze the numbers, but I'd like to think that the active members would be conscientious enough to complain if something weren't right.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I personally believe that this thread is a complete waste of time... There was no use of it.

I strongly disagree. If riahc3 had sent me or Dani a PM instead of starting a thread, pritaeas wouldn't have confirmed the bug on IE that we weren't aware of unless we went out of our way to ask. The existence of this thread is the sole reason why we're presently working on that bug.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Man Im really trying to stay calm but your stupidity grows and grows.....

pritaeas reproduced the exact issue with the severity that I suggested. He shows screenshots. What else do you want? Pay me a plane ticket and Ill show it on your PC if thats what you need!

  1. The IE issue has been confirmed and is being worked on.
  2. All other reports in this thread that could not be reproduced are closed as "not reproducible".
  3. Your report about terminology is closed as "by design".

I won't reply to you in this thread again, and it's only because of my desire to help that I'm not ignoring you completely after your constant insults and lack of cooperation.

If you have any more useful information that may help with reproducing your problems, please send me a private message with the details.

diafol commented: Nice sign off. Don't think I would be so polite. :) +0
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Noone can seem to reproduce the issueS? Excuse me?

Read the full sentence before getting insulted. Nobody can seem to reproduce the issues to the severity that you suggest.

Read everything, not only the things you want to....

Oh, the irony.

pritaeas mentioned in this thread that one of the bugs happens to him as well.

In IE only, which we've confirmed and are working on, so it's no longer relavant to my requests for more information. However, you say it happens all the time regardless of browser, which I cannot reproduce or find anyone aside from you who can do so. I'll also note that the confirmed problem is only a subset of the problems you claim work together to make Daniweb completely unusable for you.

I'm truly sorry, but I can't fix a bug that I can't reproduce. At this point (and until there are reproduction steps) I can only conclude one of two things, neither of which you'll like:

  1. You're exaggerating about the severity of the problems, and it's really nothing more than the confirmed cursor bug in IE.
  2. The problems as stated are real, and as bad as you say, but they're environmental in nature and there's nothing I can do about it.
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

If this forum sucks that bad, then you also have the option to just not simply not revisiting this site.

Of course, if the forum sucks that bad I'd prefer to be notified of it than just drive people away silently. At least with the former there's the possibility of improving things. ;)

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

i want to show from 100 to 999 but it start at 701 !!!

It doesn't start at 701, that's just where as far back as the command prompt allows you to scroll. Try this and use the Enter key to continue to the next "page":

for (n1 = 1; n1 < 10; n1++)
{
    for (n2 = 0; n2 < 10; n2++)
    {
        for (n3 = 0; n3 < 10; n3++)
        {
            cout << i << "   " << n1 << " " << n2 << " " << n3  << endl;
        }
    }

    cin.get();
}
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

A great example just happened to me of the shitty posting system here.....

I typed up a long post and for some reason, Daniweb logged me out. First, why does Daniweb allow me to write a post if I cant post unless Im logged it? Flaw. Anyways....

I noticed this and I tried to "Select All.........Copy" the textbox. ITS IMPOSSIBLE TO DO. Keyboard shortcuts, select with mouse and right click select/copy, edit select all copy, etc. IT DOESNT SELECT IT AND/OR COPY. And now I have to rewrite the entire post again.

And now a new bug is happening, when I post code, if I click on a certain area in the reply box, text Ive typed before, moves around to the bottom. Its just horrible.....

Let's try this again. What OS and browser are you using and what versions? You've said you're having problems with Chrome, Firefox, and IE, but there's definitely something else going on because nobody can seem to reproduce the issues to the severity that you suggest.

Surely you don't think that we'd release something as bad as the above and claim that it's not broken. :rolleyes:

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I have got an integer as 0010000001.

Just so you're aware, leading zeros are typically truncated as they don't contribute to the value and are conceptually infinite. So your number would be 10000001 unless otherwise formatted to ten digits with leading zeros. That doesn't affect your algorithm, but it's something to keep in mind.

Solution: i tried using num/10000 but i dont think this is feasible solution.

Why don't you think it's a feasible solution?

anukavi commented: aware abt the truncation of d leading zeros. In case if the number is 1234567890 and xpected result:123456.Division by 10000 is easier solution and just wanted to know if thr r any other way to get the first 6digits. +0
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

The best way to enhance your skill is through practice.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Just tested this on a clean Win7 Pro install, and this happens in IE9. In code the cursor moves a line down.

So it does. Only on Internet Explorer. Chrome, Firefox, and Opera all work correctly, so this is no doubt a case of IE being stupid when it comes to javascript. I'll check and see if Dani has been playing with the javascript to deal with the file upload issue in Firefox or updated CodeMirror recently. There may have been an unintended side effect.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I tried and I tried and I just cant because other forums are not like that.

No offense, but that's kind of like saying you can't learn to drive both an automatic and a stick shift because they're too different.

Um....I think I read a THREAD about it on here....

There was such an issue in the past, and it was fixed. There haven't been any bug reports on the editor in months.

If you post code and then with your mouse, try to click on where you want to edit words or something, the cursor jumps somewhere completely different (the line above, below, left right, etc) and writes there. This happens on FF, Chrome and IE.

That sounds like the bug that we fixed. I use Daniweb from all three browsers and haven't seen that behavior since mid summer when we upgraded our version of CodeMirror. And yes, I do post code, and I edit my posts religiously.

Unfortunately, I can't troubleshoot a problem that I cannot reproduce. Please provide details about your OS version, browser version, and email me the content of an exact post that exhibits the problem. The exact spot where you're clicking to edit might be helpful as well.

And how about the inconsistency I posted?

Dani likes it and I couldn't care less. There's no urgency to fix an "inconsistency" that bothers exactly one person. You're the only one who cares enough to bring it up …

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I take it you're going to air your dirty laundry every few months just to remind us that you're unhappy with the new system?

Every forum uses your regular [code][/code] but no, not Daniweb.

Not every forum, just forums based around or inspired by vBulletin. Hop on over to StackOverflow and see how well BBCode works. I'll wait...

You have to tab your code. Imagine if Im on a old DOS box and tab isnt supported in the OS (this is a extreme example but just to show) AFAIK, you cant tab on Android/iOS either.

You can use spaces too, or the Code button on the editor. Or you could not use an old DOS box because extreme examples are often stupid. And let's be honest here, if you're posting from a phone or a tablet, you shouldn't really expect the same experience as you would from a computer. We may even provide a mobile version of Daniweb in the future.

Having used forums from a tablet before, I recognize that there are usability issues. But it's not unique to Daniweb. I think the problem is that you've become used to vBulletin based forums and simply don't like being forced to learn new workarounds.

Then there is the "jumping cursor" bug

That's such an informative bug report. Could you be more specific? Maybe provide a set of reproduction steps? As far as I'm aware, there aren't any outstanding bugs in the editor, so that …

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

if i connect with server with username pass which is hardcoded then if someone reverse eng. it he will get userpass how to tackle that??

Well, you can't defend against proper reverse engineering completely, but a combination of secure strings, obfuscated assemblies, and a non-hardcoded authentication key along with the credentials (such as one generated from a license code) would go a long way toward making it much harder to crack.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I'm not James :/

That's a good thing, because then Daniweb would crash due to overflowing awesome. ;)

~s.o.s~ commented: Haha, I like that ^_^ +0
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

For communicating with a server, I'd probably start with a web service. The server exposes a WSDL which the not-keylogger connects to and calls methods on. The only issue with that in my experience is the relatively hard coded nature of web service references in the client.

If the WSDL is basically static then all is well and you can follow tutorials, but if it could change and needs to be arbitrary in the client, you can't conveniently use a web service reference (at least you couldn't the last time I wrote something like this and did the research). So in the past I've used a little helper function that lets you hit an arbitrary WSDL:

WebServiceProxy.CallWebService(
    wsdlUri, 
    "NotKeyLoggerService", 
    "SaveLoggedData", 
    new object[] { loggedData, screenshot });

I know you didn't ask for code, but this helper isn't obvious, so I'll give it to you anyway:

using System;
using System.IO;
using System.Net;
using System.Text;
using System.CodeDom;
using System.Xml.Schema;
using System.Reflection;
using System.Diagnostics;
using System.CodeDom.Compiler;
using System.Xml.Serialization;
using System.Collections.Generic;
using System.Security.Permissions;
using System.Web.Services.Description;

namespace Proxies {
    public static class WebServiceProxy {
        /// <summary>
        /// Calls a web service method with default credentials.
        /// </summary>
        /// <param name="wsdl">Web service URL.</param>
        /// <param name="serviceName">Name of the web service containing the desired method.</param>
        /// <param name="methodName">Name of the method being invoked.</param>
        /// <param name="args">Possibly empty array of method arguments.</param>
        /// <returns>The result of the method as an object.</returns>
        /// <remarks>
        /// If the method has a return type of void, the return …
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Well, the specific syntax you posted is a GCC extension. but C99 does support variadic macros with more or less the same syntax as variadic functions. The big difference is how the argument list is retrieved (__VA_ARGS__ for C99 and args for GNU).

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I'd like to say beer but they're a bit fussy about you drinking in the office...

That's what telecommuting is for. :D

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Are you asking what we snack on while coding, or what we eat in general? What I eat in general is mostly a healthy diet of whole foods. Staples include:

  • Tea
  • Coffee
  • Oatmeal
  • Peanut butter
  • Cheese
  • Chicken
  • Veggie burgers
  • Frozen Fruit
  • Frozen vegetables
  • Greek yogurt (full fat, of course)
  • Almonds (ideally cinnamon roasted)
  • Spiced Rum
  • Scotch

I'm not a big snacker anymore, but crackers and dry cereal (without milk) would be my go-to snacks while gaming or coding. I like salty things, sweet not so much. :)

<M/> commented: i don't see how alcoholic drinks or veggie burgers are good for you... +0
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Yes.

AndreRet commented: lmao, okie dokie. :) +12
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Put simply, the point is to enforce a trailing semicolon on calls to the macro without losing the massive benefits of having the macro wrapped in its own scope.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I guess my question should be "Why is it undefined?".

I'll raise your question with a counter question: what's stopping an implementation from using completely independent allocation pools and mechanisms for new/delete versus new[]/delete[]?

++K;
delete[] K; //Does that delete all instances of F?

No, that should crash because you're trying to delete a pointer that's different from the one given to you by new. If you didn't increment K then it would correctly free the memory, and you'd need to take into consideration that F and K both alias the freed memory.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Why is it safe to use delete[] without getting a crash or something?

You consider undefined behavior "safe"?

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I dont know how to use pointers.

That's your problem, and the fix is learn how to use pointers. But since you'll probably get mad if I don't offer an exact solution to your immediate problem, change this:

t_matriu *Crea_M ( int dim )

To this:

t_matriu Crea_M ( int dim )
Despairy commented: hahah... good one +2
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Given that the code was pinched verbatim from this article, my initial question is why do you think it needs debugging in the first place? Does it not work? That's somewhat likely, but I'd like to believe the article's author wouldn't publish untested code. Or does it just do something different than you wanted?

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

You could certainly do it that way, but it's excessively complicated. The pattern adjusts predictably for each row, so just keep it simple:

#include <iomanip>
#include <iostream>

using namespace std;

int main(void)
{
    int distance = 7;
    int i = -1;

    while (++i < distance / 2)
        cout << setw(i) << "" << '+' << setw(distance - i * 2 - 2) << "" << 'X' << endl;

    cout << setw(i) << "" << '*' << endl;

    while (--i >= 0)
        cout << setw(i) << "" << '+' << setw(distance - i * 2 - 2) << "" << 'X' << endl;
}
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Is it generally a better practice to define all the functions you're going to use before you define main() ?

It depends on your prefered style, neither is better than the other. However, for larger projects you'll end up moving the declarations to a header anyway, and the definitions to an implementation file. So the choice of defining before or after main() only applies when you're not modularizing those functions.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

What does this error mean?

It means you must declare something before you use it. Specifically, getMatrix() and displayMatrix() are defined (and declared) after main(), but you use them in main(). Add a prototype to declare each:

void getMatrix(int number);
void displayMatrix(int number);

int main(void)
{

More fundamentally, is my code inherently bad? As in, is it a poor way to achieve what I wanted to achieve?

Inherently? No, but it could be improved. However, those are nitpicks that are best left for later.

Why is coding so hard? :(

Programming is difficult. Welcome to reality.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

This is my original code

That's also the third time you posted your original code; we get it. If you're not willing to read our replies and do the work suggested, while instead asking for "help" with the conversion that clearly means "do it for me", kindly piss off.

I think I'm done with this thread, since it's becoming more and more apparent that you're a leech. kthxbye.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Either get a new compiler (free) or forget about your program.

You could queue up the keystrokes and process them in sequence. Provided they're processed quickly enough, the end result should be comparable to a threaded solution. It's not like games weren't written with Turbo C when it wasn't too old. ;)

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

character=getch means?????

It means you need to realize that this isn't Twitter. You don't have a 140 character limit, so please engage your brain and try to communicate like an intelligent human being. You'll get much better answers if you ask comprehensible questions.

kthxbye.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

that sounds good... any code exapmples?

That's something you could (and should!) search for yourself, but I'll bite:

#include <stdio.h>
#include <string.h>

int main(void)
{
    char src[] = "This is a test"; /* Note that it's an array and not a pointer */
    char *tok = strtok(src, " ");

    while (tok) {
        puts(tok);
        tok = strtok(NULL, " ");
    }

    return 0;
}

The single most important thing to remember about strtok() is that it modifies the source string. Thus you can't use a pointer to a string literal, and if you want to retain the original string you must make a copy for strtok() to consume.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

i have to do division without divison/multiplication/mod operator.

Yet another dumb assignment that serves no purpose in reality. Can't educators think of more practical exercises?

nitin1 commented: seriously , if u were my teacher than today i may be somwhere else ;) +2
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

What result are you trying to achieve here?

Nomi55 commented: wanted to print a shape like that in row 1 and 3 there are 4 astericks... +0
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Are these all parts of the draw methods?

http://msdn.microsoft.com/en-us/library/e06tc8a5.aspx

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

That's somewhat high level and vague on functionality details, but it's certainly a good start.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

If the only requirements are to use switch, for, and if constructs then your imagination is the limit. Start by writing down use cases for a car rental service, this will help you get a feel for features the application will need to support.

You can't write a program that you don't understand, so understanding the problem to solve is priority #1.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

All members have a one time option to change their name from their profile page. The link is at the bottom and is cleverly disguised as a button labeled "Edit Username".

Mike Askew commented: Damn this sly button, I shall start a hunt for it. +0
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I mean i know that i am accessing data outside the array but where?

You use a debugger to figure it out. Most debuggers will give you the option of setting a break condition; you can use a condition of the array index being out of range. Alternatively, you can go old school and just add debug output at strategic locations and take note of the program's current state when it bombs.