deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Apparently it's built into the OS too, but IE10 has a version to check URLs. I'm guessing the OS level filter affects other browsers too, otherwise I'd agree that it shouldn't affect Chrome.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Just an update, I got a new hard drive and installed Windows 8 again but this time without the SmartScreen filter enabled by default. I'm now posting from that installation, so there's something about that filter that boogers up our sessions.

Still a high priority issue though, given that SmartScreen is enabled in the default custom settings and the express install settings.

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

Figure out what the package is intended to do and name it appropriately.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

What web browser?

All that were tried: IE10 and Chrome.

Does the problem happen when submitting any DaniWeb form, including trying to search

I didn't try. Sadly, the hard drive that I bought to house Windows 8 died last night...

Does the problem happen on other CodeIgniter-based sites, such as http://codeigniter.com/forums/

I didn't try, but that will be in my troubleshooting steps when I get a new hard drive and get the system back on its feet.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

What do you mean by "does not work"? If you mean that it doesn't sort the array properly, then your radix sort is broken and you need to check the algorithm. Perhaps compare what you're doing logically with a working radix sort.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Thanks again, it works........

Please don't use that longer loop for anything but your own instruction. The conventional method is strongly recommended.

I think In if statement we are checking the next position is good or not?

No, we're checking if the previous input request tried to read of the end of the stream or encountered an error.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Yes, but this only tells me how to build it and install the result.

Wrong, read the whole page. Specifically the part under the heading "Include Boost headers and link with Boost libraries" that I kindly but it seems pointlessly jumped to directly with the link.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

When creating a new article you can select both the type and the forum. So if you're posting from the C++ forum, the selected forum for the new article will be C++, but you can change it using the selection list before posting. I imagine that as a more general tutorial you'll want to post directly to the Software Development category.

Likewise, the "section" that the article goes to is defined by the article type. To post a tutorial, change the type from Discussion Thread to Tutorial.

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
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I don't want to tell you to give up, but judging from your question I'd say the likelihood of failure in this project is near 100%. Have you done any research before running for help?

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 compiler (or I suspect IDE) are you using?

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Sorry for providing a bad practice.

Apologies in advance, but that's not the worst practice in your example. My vote would go to this gem:

for(loop = 0; loop < strlen(string); loop = loop + 1 )

The inner loop exhibits the same problem, which is calling strlen() in the condition of a loop. The length of the string doesn't change throughout the program, so repeatedly calling strlen() is unnecessary overhead. In fact, it doubles the time complexity of your loops. That's not a big deal here, but given how simple it is to avoid the problem, there's really no excuse not to.

You also forgot to include conio.h for the use of getch(). I didn't dock any points for a silly use of getch() because it was also in the OP's code. ;)

On a side note, I'd probably solve the problem with printf() format specifiers:

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

void reverse_text_pyramid(const char *s)
{
    for (size_t len = strlen(s); len > 0; --len)
        printf("%.*s\n", len, s);
}

int main(void)
{
    reverse_text_pyramid("myname");
}

Admittedly that's a more advanced solution, but it's still cool. :D

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

You'll need to be more specific. What constitutes your "data"?

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

They'd probably charge you extra. Do you need a static IP for some reason?

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

how to install window

I can't imagine how anyone would think that's a coherent question. Try again.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

That's actually a good question because you've stumbled on a subtle behavior of keybd_event(). What it does is queue up key presses to the program with focus. In this case that program is itself (confused yet?). The problem is that this program isn't listening for input, and doesn't ever listen for input before terminating. Therefore the key presses will never be echoed.

The act of requesting input from stdin is what will cause the queued keys to echo, and you can also extract them at the same time:

#include <windows.h>

void SendKeyboardLine(const char *message)
{
    int lc = 0;

    while (*message) {
        keybd_event(VkKeyScan(*message), 0, 0, 0);
        keybd_event(VkKeyScan(*message), 0, KEYEVENTF_KEYUP, 0);
        ++message;
    }

    keybd_event(VK_RETURN, 0, KEYEVENTF_EXTENDEDKEY, 0);
    keybd_event(VK_RETURN, 0, KEYEVENTF_KEYUP, 0);
}

#include <iostream>
#include <string>

int main()
{
    std::string line;

    std::cout << "Sending keyboard input . . .\n";
    SendKeyboardLine("This is a test");
    std::cout << "Reading keyboard input . . .\n";

    if (getline(std::cin, line))
        std::cout << "You typed '" << line << "'\n";
}
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I gave you suggestions, did you apply them? The class you posted doesn't add any useful information.

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

Your base class is undefined. Check your spelling, then check to make sure that you're including the appropriate files and have appropriate declarations in place. Your question lacks necessary information to help any further.

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

may be i can download unix, linux on CD or some program that let me do this.

There are distros of Linux (such as Knoppix) that can be run from a live CD. Do a google search for "Linux live CD" and you'll get plenty of hits.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

No one said you have to use intellisense. I don't use it, or very seldom use it.

I don't use it for C or C++, but for C# and VB.NET it's mighty handy (and actually works).

As for the debugger, I use it often.

The debugger is the single biggest reason why I prefer Visual Studio. Replacing the default compiler with Comeau corrects the glaring problem of Microsoft trying to play God with standards conformance, and the only significant con you're left with, in my opinion, is VS being resource hog in general. ;)

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

Let's use t[z].suba = a[ w ][ v ]; as the example. Both suba and a have the same type (float**), so why are you subscripting a when trying to assign directly to suba? I suspect you're trying to copy the whole matrix:

t[z].suba = a;

This of course has other problems because all of the suba's in t will refer to the same matrix due to pointer aliasing, but fixing that involves allocating memory and changing how you copy the matrix from a direct pointer assignment to an element by element copy.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Oh ok now that I re-read the problem, instead of the function cos(), now I have to write double cos().

They're both the same thing...

So are my exponent file and util file correct?

At a glance, yes. Your code is a little complicated for what it's doing, in my opinion, and close_enough() should check the absolute value of the subtraction to be strictly correct, but it's probably fine for this exercise.

But how can I check to know if the last function is given two doubles and returns true if they are within 0.00005 of each other?

O_o

You're asking me about a project that's been poorly described to an outsider. These are really questions you should ask your teacher. All I can do is give you a complete example of what you already know:

#include <float.h>
#include <math.h>
#include <stdio.h>

#define THRESHOLD 0.00005

double factorial(int x)
{
    double result = 1;

    while (x > 1)
        result *= x--;

    return result;
}

double cosine(double x)
{
    double result = 0;
    int i;

    for (i = 0; i < DBL_DIG; ++i)
        result += pow(-1.0, i) / factorial(2 * i) * pow(x, 2 * i);

    return result;
}

int close_enough(double a, double b)
{
    return fabs(a - b) < THRESHOLD;
}

int main()
{
    double a, b;

    printf("Enter two floating point numbers: ");
    fflush(stdout);

    if (scanf("%lf%lf", &a, &b) == 2) {
        double cosa = cosine(a);
        double cosb = cosine(b);

        printf("cos(a) = %f\ncos(b) = %f\n", …
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Everything you get from the keyboard is a character. To extract an integer you need to read multiple characters and append them to an integer value, or store them as a string and then subsequently convert that string to an integer value. Either way you're doing a string to integer conversion.

Since you're using printf, why not also use scanf? That way scanf will do all of the hard work in converting:

extern  scanf
extern  printf

global  main

section .data

; Don't forget terminating null characters to match C's expectation
ifmt: db "%d", 10, 0
ofmt: db "The number is %d.", 10, 0

section .bss

input:  resd    1       ; resd reserves N dwords, not 1 dword if N length

section.text

main:
    push    dword[input]    ; Variables can be added directly in NASM
    push    ifmt
    call    scanf
    add esp, 8

    push    dword[input]
    push    ofmt
    call    printf
    add esp, 8

    mov eax, 0      ; Return 0 for consistency with C programs
    ret
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

A note on terminology, a char is a single character. You want to split a string of char.

As for how to go about it, look up strtok().

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

You can't overload the same operator with the same signature more than once because then the two overloads would be ambiguous. Your best option here is to discard operator overloading and use regular member functions, with the simplest solution being one per task:

bool Point2D::lessX(const math& p) { return x < p.x; }
bool Point2D::lessY(const math& p) { return y < p.y; }
bool Point2D::greaterX(const math& p) { return x > p.x; }
bool Point2D::greaterY(const math& p) { return y > p.y; }

But I'm curious why the comparison won't work as checking x first, then y if the x's are equal:

bool Point2D::operator<(const math& p) { return x != p.x ? x < p.x : y < p.y; }
bool Point2D::operator>(const math& p) { return x != p.x ? x > p.x : y > p.y; }

That's the usual method of doing a comparison with multiple terms.

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

I need to put the function double cos(float) in the trig.c file, but I don't know what to do with it when the function cos() is in there too

I'm not sure I understand the problem. You're defining the cos() function as double cos(float). There aren't two functions, just the one. You may also have issues with the compiler if it loads the standard cos() function as an intrinsic, because then you'd be conflicting with the standard function by using the same name.

how can I make it to be only even and just like in the Taylor series?

The cos() function defines the Taylor series. It might help to use the more general form to write your loop: cos(x) = (-1)^n / (2n)! * x^(2n). This follows more directly into an algorithm than trying to decompose a partial expansion of the series into the general concept.

So you'd get something like this:

for (i = 0; i < LIMIT; ++i)
    result += pow(-1, n) / factorial(2 * n) * pow(x, 2 * n);

And should I put the Taylor series in driver.c?

You'd call the cos() function in driver.c, probably. Your requirements suggest a certain amount of inside knowledge about the project that you didn't explain, so I can only speculate.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

can we implement these concepts in c using linkedlist and array????

Yes, of course. Though typically when working with anything called a "matrix", arrays are the more natural data structure. For storage efficiency reasons, linked lists become useful when your matrices aren't very full. This is where the sparse matrix concepts come into play.

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

the fact that i am here states that i have allready been to your url and couldnt understant anything!

Then maybe you should ask a real question. If you've read the documentation then you should have no problem pointing out exactly what you don't understand instead of expecting us to either divine it out of your head, or magically write a complete GMP tutorial that's perfectly suited to you.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

A search for "GMP manual" on Google produced this as the first hit: http://gmplib.org/manual/

All totaled up it took me all of 2 seconds. How hard did you search before giving up?

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Is this by design?

Yes. The idea is that when you view the first thread in a forum, all subsequent threads are marked read. If you respond to a thread then that thread becomes the first, and by viewing it the marked read logic applies.

My expectation is that the NEW flags should not be reset until I have actually opened the associated thread, or clicked "Mark Forum Read".

Include the age threshold which also currently is in place (I can't remember the exact amount, maybe a week?), and I agree. I'm not a fan of the first thread feature, but Dani seems to think it's necessary. Maybe she'll hop on with the explanations that I've since forgotten. ;)

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Your question makes no sense. Can you provide a detailed example of what you want to happen?

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I don't know if it is just me but does the footer look different by any chance?

Things are always being tweaked for SEO or user experience purposes. Most of the time nobody notices. ;)

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Sorry, I can't read Swedish.

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 …