deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I have a better challenge: prove that you're not just looking to trick other people into doing your homework for you or I'll find you in violation of Daniweb's rules and act accordingly.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

The concatenation operator for std::string doesn't convert non-string (or character) types to strings. Try this instead:

#include <iostream>
#include <string>

using namespace std;

int main()
{
    string s;

    for (int i=0; i<10000; i++)
    {
        s+="1";
        for (int j=0; j<i; j++)
            {s+="0";}
    }

    cout << s;
}
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

near and far were keywords used to modify pointers back when the segmented memory architecture was both used and transparent. Near pointers would access the current segment while far pointers could reach across segments. Compilers that supported such keywords probably still support them for backward compatibility, but on modern systems they're pretty useless as everyone uses or at least simulates a flat memory model now.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Why can't you just use inline code such as http://www.daniweb.com ?

Because it doesn't work. ;) This is one of those places where the live editor still doesn't match the final post.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

when the user input numbers, it should be arranged just like an actual tree

If the tree is required to be displayed top-down then you're looking at some form of level order traversal to get the nodes in the proper order for display and a relatively non-trivial algorithm for determining the grid positioning of each node for printing. If you can get away with it, rotating the tree by 90 degrees is leaps and bounds simpler, and looks just as good:

#include <cstdlib>
#include <iostream>

using namespace std;

struct node
{
    int data;
    node* left;
    node* right;

    node(int data): data(data), left(0), right(0) {}
};

node* insert(node* root, int data)
{
    if (root == 0)
    {
        return new node(data);
    }
    else if (data < root->data)
    {
        root->left = insert(root->left, data);
    }
    else
    {
        root->right = insert(root->right, data);
    }

    return root;
}

void prettyprint_node(node* root, int level)
{
    for (int i = 0; i < level; i++)
    {
        cout << '\t';
    }

    if (root == 0)
    {
        cout << "--\n";
    }
    else
    {
        cout << root->data << '\n';
    }
}

void prettyprint_90(node* root, int level)
{
    if (root == 0)
    {
        prettyprint_node(root, level);
    }
    else
    {
        prettyprint_90(root->right, level + 1);
        prettyprint_node(root, level);
        prettyprint_90(root->left, level + 1);
    }
}

int main()
{
    node *root = 0;

    for (int i = 0; i < 10; i++)
    {
        root = insert(root, rand() % 100);
    }

    prettyprint_90(root, 0);
}
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Your functions represent two extremes:

  1. Reading and writing character-by-character
  2. Reading and writing whole files as a string

You can get performance benefits without excessive memory usage by reading and writing the files in blocks. This is a happy medium from the two extremes, look into the read() and write() member functions for doing block I/O.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Both are acceptable, but take note that this only applies to when both the declaration and definition are in the same file. Once you start modularizing your files, the accepted format is a header with the declarations, an implementation file, and one or more usage files:

Header
#ifndef MY_HEADER_H
#define MY_HEADER_H

float power(float,float); //function declaration

#endif
Implementation
#include <cmath>
#include "my_header.h"

float power(float bas, float expo) //function definition
{
      return std::pow(bas, expo);
}
Usage
#include <iostream>
#include <iomanip>
#include "my_header.h"

using namespace std;

int main()
{
    float base;
    float exp;
    float answer;

    cout << "This program finds the base raise to an exponent." << endl;
    cout << "Please input the base number." << endl;
    cin >> base;

    cout << "Please input the exponent." << endl;
    cin >> exp;

    answer = power(base,exp); //function call

    cout << fixed << setprecision(2); //# of decimal places
    cout << "The base is " << base << endl;
    cout << "Raised to the " << exp << " power" << endl;
    cout << "It is equal to " << answer << endl;
}
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Is there a way to stop urls parsing automatically?

I saw this one coming. ;) My answer from before isn't valid anymore because both the live editor and back-end parser are converting HTML into straight text rather than parsing it. However, the automatic linkification of a URL only applies if you include the protocol at the beginning, so http://www.google.com will be linkified while www.google.com will not. This is a convenient quirk of the heuristic being used to match a URL.

If that's not enough, I can hack in an exclusion character such that something like ^http://www.google.com would disable linkification and the exclusion character (a leading caret in this example) wouldn't show up in your post. But I suspect that's not necessary as just trimming off the protocol should be sufficient. :)

And Quotes just seem to be a pain in general. Isn't there any way to quote without copy/paste -- like before the change?

Quotes aren't line based, they're paragraph based. Maybe they seem to be a pain because the quote button prefers to place a quote starter on each line. However, you can just plop down a quote starter at the beginning of each paragraph (ie. block of text without a blank line at the end) and it'll be properly quoted.

diafol commented: great ^ it is then :) +0
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Probably a stupid question, but do you have Firefox set up to remember form data in your privacy options?

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

It's not standard Markdown, it's one of the forks with extensions: https://github.com/egil/php-markdown-extra-extended#readme. In particular, the ~~~ syntax is for fenced code blocks.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

also I did not receive any rep points from AD(twice) and Eagletalon when they commented on my post at the C, C++ and Windows forum even though they have a +14 and a +3 power to affect someone elses reputation

Note that all votes are created equal in the new system, and a vote without rep still counts toward the 24 hour lock on rep power. So if for example, AD gave one of your other posts an up vote without a comment and then voted with a comment on another post, the second vote would not apply any rep because the first vote put a 24 hour lock on AD's rep power against you.

I'll get Dani's opinion on that as she has the final say, but limiting that lock only to votes that have a comment seems more intuitive to me.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

at 1,000 posts my user title at the left still says that I'm still a practically a posting shark though my profile shows that I'm now a veteran poster

I suspect that this is an artifact of the migration. Your default title from before the migration was stored in the database as a custom title, so you were "Practically a Posting Shark" despite having jumped up two default titles. The fix is to edit the custom title in your profile to be blank, then the default post calculations will take effect.

I did this for you, and now your posts are showing the correct title of "Veteran Poster". :)

zeroliken commented: thanks +0
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Are you using Internet Explorer? I believe Dani is presently looking into a bug with that browser where the result is your error message.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Casting in C says 'treat me like something else at the byte level'. "10" is not the same thing as 10 at the byte level, so the cast doesn't do what you want.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Well one more doubt, are users allowed to take back the reps too... That right was reserved for Ms dani in last version!!

Dani was kind enough to give the rest of us that ability. Any verified member can undo reputation.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

BBCode no longer works for new posts, it's all Markdown based now. As far as making a code block, it's a matter of indentation (at least 4 spaces). Presently the code button only pastes an example into the editor if there's no text selected. To paste actual code, you would just paste it in, then select the entire block and hit tab or click the code button.

Another option is wrapping your code in ~~~, which will force a code block without the need for indentation.

I recognize that selecting the code to turn it into a code block is awkward, we're working on making the editor more convenient. ;)

I tried using the Code button but that didn't seem to work either (i.e. past code into editor, highlight, then hit the Code button).

I just tested and it appears to work properly. Can you reproduce the problem consistently with all options described above?

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

The difference isn't immediately obvious, but if you hover over the up arrow to get a comment box then the box represents positive rep. If you hover over the down array, it represents negative rep.

Once we work out the list of bugs, I think a decent UI change would be to show either an up arrow or down arrow on that comment box to make it clear exactly what kind of rep you're applying.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Booya. :)

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

It was just poorly designed I guess.

Thank god I wasn't the one who wrote the private messaging subsystem...oh wait, it was me. ;)

By the way, I'd like to upload an avatar but don't remember the limitations i.e. max. kilobytes/pixels?

Current limitations are GIF, JPG, or PNG at up to 640x480 or 500kb to upload. From there we'll resize down to 80x80. It looks like that resize isn't working properly, because I get a broken image in all cases. Chalk up another bug for the list. ;)

mitrmkar commented: Thanks +0
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Huh? Ms Dani owns DaniWeb so there should be no pressure to upgrade, she is free to do what she wants when she wants to. Only Ms Dani makes the deadlines.

What about pressure from the mods who are pissed off about excessive spam from vBulletin bots? What about pressure from users about feature requests and bug fixes that are difficult or impossible due to the restrictions from the vBulletin back end? What about pressure from revenue loss due to development efforts of the new system causing a failure to keep up with SEO efforts? What about pressure to announce the new system near a Daniweb event as a means of advertisement? Owning the company doesn't alleviate outside pressure to set unreasonable deadlines.

But I'm not about to stop visiting DaniWeb just because there are a few problems with it now. It's still a great community.

Indeed. And the problems are temporary. Just consider them growing pains because the system is 100% new; we were expecting some unforseen issues to arise from higher volume than was used during development and testing. Anything less would be the height of stupidity. ;)

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Yes, I see both buttons. Reason should not be reqired unless person editing the post is a mod or admin

Agreed. I've added that to the list of bugs, pending Dani's approval of intended use for the reason box.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Another bug/missing feature is the lack of filtering for private messages. I think it's confusing now because we sort by unread first, then read, but there's no option to view either unread or read.

Before:

  1. unread A
  2. unread B
  3. unread C
  4. read D
  5. read E
  6. read F

After reading A:

  1. unread B
  2. unread C
  3. read A
  4. read D
  5. read E
  6. read F

If you have multiple pages then A will seem to disappear after reading it.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Actually, I get a broken image. But that still counts as a bug, so it's being added to the list. :D

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

That's close, Tony. The subforums are still there as before, but now we also allow posting directly to a category such as Software Development or Web Development (something that wasn't allowed in vBulletin) where the tagging system can optionally be used to locate those threads through the tag cloud.

The forum hierarchy concept remains the same, it's just loosened up a little bit to support threads that don't quite fit into any single subforum.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I don't think this works. I tried it in http://www.daniweb.com/community-center/daniweb-community-feedback/threads/418509/copying-code-to-clipboard- then went to the forums in the tags and my post did not show up in those forums.

I'm not sure I understand what you were expecting to happen. The post lives in the community feedback forum and due to the tags will show up when you do a search from the tag cloud. Adding a "c++" tag to a post in the community feedback forum won't make that post appear in the C++ forum.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I've added that to my running list of feature requests.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Is there a way to see the threads by last post first in the new system ?

Not presently, but that wouldn't be a difficult feature to add. Can I get a rain check until we clear up some of the post-deployment hiccups? :)

Gribouillis commented: ok +0
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

The permissions appear to be correct. When the edit box shows up after clicking the Edit Post link there should be a button labeled "Edit Post" next to a reason text box, assuming the post is younger than the editing time limit of 30 minutes. This button is the submit button. Could you verify this for me? Unfortunately I'm not in a position to adjust my permissions status to test.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

As a senior systems engineer for a tier-one world-wide engineering company, you must be familiar with the mutually exclusive goals of getting things perfect and meeting deadlines. There was immense pressure to get this system rolling before a hard and somewhat unreasonable deadline, and we'll be working equally hard to "sort out this cruft" as quickly as possible.

In the meantime, I hope you enjoy whatever alternative you choose for spending time that would otherwise have been spent on Daniweb.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

So, Like on Stack Overflow?

It's a move in that direction, yes. Stack Overflow is all about tags while Daniweb will still be a traditional forum with stronger focus on tags for refined searching. The biggest difference is that you can post directly to Web Development, for example, instead of being forced to dig down into a specific forum.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

1) Why I want to delete?

I want to delete my account because I've never used Daniweb, so it's useless for me.

... Note that I'm registered since 2009 and rarely (2 times) I came on Daniweb to find answers (sorry but it's the true)

What's wrong with simply abandoning your account? If we don't care about a dead account on our database, why should you care? ;) Just remove any personal information and call it a day, no loss, no foul.

2) Why it should be done?

Because you should honor the wish of your users if it is feasible (see next point)

We try to honor requests when they make sense and are possible. In many cases it doesn't make sense because it would create a precedent that complicates the interpretation of our rules. In the case of deleting an account, we simply cannot honor the request and still adhere to anti-spam laws.

3) Is it feasible to clean/remove an account?

Yes, don't tell me not, I'm an IT specialist and I know you can, it's a question to write the right piece of code in any language of this world.

Let's consider it then: We're legally obligated to retain records of all registrations as proof of opt-in because we send bulk emails. So there are two options to handle the deletion of an account:

  1. Store separate registration information such that an account could be physically deleted.
  2. Fake it by hiding "deleted" accounts.

…

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Jeez - I didn't realise that you were dropping vBulletin. Is this a custom forum site coded from scratch or is it based on another setup?

It's completely written from scratch based on Daniweb's specific needs. Of course it follows similar forum behaviors like forums, threads, and posts, so the feel will be very similar.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

hello !
well today i got two down votes , i dont think that there is any thing wrong with my post , as we know who add reputation to us , can we know the person who is down voting us , and is there any way to balance them , well this thing make me feel very bad , i always tried to help others and to share my knowledge and to learn something new from you experienced people.but this thing is very bad , :( , i spend lots of time when someone post a question to answer him , am i doing all this to get down votes :( ,

Regards

I'm sorry you feel bad about getting downvoted, and I'm also sorry for the harsh tone of this reply, but I can't think of a softer way to say what I want to say at the moment.

No matter what you say, someone will always disagree with you. If you think you're being harassed, we can look into who might be doing it. As far as wanting to know who an anonymous voter is, the only other reason I can think of is you want to reciprocate, and nothing good can come from that.

as we can not give reputation with out giving any reason , they can make it possible with down vote also .

We may do that in the future, but for now the intended design of the voting …

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

It'll be more prominent in the new system. :)

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Some of those overlap with the standard C# library, what's the benefit of using your versions?

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Visual Studio doesn't support variadic templates yet.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Wait for the new version of DW.

The new version also pages threads and posts, but it couldn't hurt to get some experience with the new design and base suggestions off of that instead of vBulletin, which is going away shortly. :)

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

I declared queue class as "public" but problem is same.

It's a member inside the queue class that's private and being accessed from outside of the class definition. I can't tell you exactly what it is because you didn't post your most recent code.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

More like it's filtering out the better candidates because they won't consider an employer that cares more about trivia than real skills.

zeroliken commented: Agree :) +9
deceptikon 1,790 Code Sniper Team Colleague Featured Poster

but also the questions asked in the HR round of interview

What little respect I had for the business world has just died.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

well it seems the code will not work in codeblocks.

They use the same compiler, just different versions... And there's no way to say what you did wrong unless you post the code here.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Modern programming education: where you learn totally useless stuff at the expense of useful stuff.

can i know how to find greatest of two numbers?
the condition is we should not use any comparision operators..

You can easily find the answer to this on google. I can't in good conscience enable stupid teachers by assisting with stupid homework. Sorry.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

The default construtor doesn't do anything with the classList pointer, so it's still uninitialized when you call user_Input(). The ideal would be to eschew a dynamic array in favor of a standard vector object, but if you must use a dynamic array, it might be a good idea to ditch the default constructor entirely, or move your initialization steps to user_Input().

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Yes, it's possible. No, it's not portable. Yes, you need to say what compiler and OS you're using.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

is c case sensitive???i thought java was only case sensitive

Nope, Java didn't corner the market on case sensitivity. A lot of languages that aren't Java are case sensitive, most of them, in fact. :D

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Mine was almost a random choice when I couldn't come up with anything better. The misspelling is intended to differentiate myself a little bit from the rather pervasive correct spelling from Transformers.

Other candidates included ragecoder, algorhythm, and James2.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Because Event is a reserved keyword in C#, I don't think your code will work as you intended.

C# is case sensitive. event is a reserved keyword, but Event is not. It may be a standard class, but I don't think so.

@ Deceptikon - What do you mean by null?

I mean this:

private Event myEventParticipating;

Is equivalent to this:

private Event myEventParticipating = null;

If you never say athelete1.EventPart = new Event() or something similar, then athelete.EventPart is equal to null and you cannot access the members of a null object.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

myEventParticipating is null by default and you never set it in the snippets.

deceptikon 1,790 Code Sniper Team Colleague Featured Poster

Replace reverseString() in your original code with this:

int reverseString(string a[])
{
    for (int i = 0; i < 1; i++)
    {
        std::string rstr = a[i];
        std::reverse(rstr.begin(), rstr.end());
        std::cout << rstr << std::endl;
    }
}

I'd offer other suggestions, but I don't want to overwhelm you.