~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Posts are by any means, not an indication of your efforts.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

sand - oasis

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

@sk8ndestroy14
Better not use obscene language like "sl****". You don't want to get infracted, do you?

Immoral losers of Linux gate began proving their loving while contemplating to hit kitty Hilton.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

feel the same

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Is it just me or are some of these sentences really lame?
I guess its just you... ;-)

Super humans roam in metropolitan pa-yon.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

500 Yay... ;-)

Oh and btw, I love to see those monkeys die... *squish*

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

< intends on stealing the plot since even I have the same ranks to climb > ;-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Oh!! Pardon me. Looks like I should have tested the code after all. Programming in different languages (java, C, C++) has started to kill me after all... ;-)

Making the changes right away. Thanks for noticing the blooper.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Provided the character is a delimter, here is a simple (and untested!!) piece of code which attempts to implement explode()

#include <string>
#include <vector>
#include <iostream>
#include <cstring>
using namespace std;

vector<string*>* explode(string str, char delimiter)
{
    vector<string*>* vec = new vector<string*>();
    char* result = NULL;
    const char* x = str.c_str();
    char* myString = (char *)(x);

    result = strtok(myString, &delimiter);
    while(result != NULL)
    {
        string* tmp = new string(result);
        vec->push_back(tmp);
        result = strtok(NULL, &delimiter);
    }
    return vec;
}

int main()
{
    vector<string*>* vec = explode("asdf+sdf+dfs+dfsdf+fd", '+');
    size_t size = vec->size();
    for(size_t i = 0; i < size; ++i)
        cout << *vec->at(i) << endl;

    // Don't forget to free memory
    for(size_t i = 0; i < size; ++i)
        delete(vec->at(i));
    delete(vec);
    
    cin.get();
    return 0;
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Font face is a HTML lingo. <font face="verdana" size="10" color="red">Here the font face is verdana</font> And yes, I guess this is 10 or 11 pt Verdana.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

sos, I am really pretty happy with the fonts we use overall and am really just concerned with 11px versus 12px for post bodies, tutorial bodies, and blog bodies. All other fonts are remaining the same.

The font for the quick reply box has not changed, and so has the font for quoted text. The contrast between normal text and quoted text is too much. Not to mention that the font size for the inlinecode has adjusted to the change while the normal code enclosed in the code tags is still of the previous font size. Please do away with the inconsistency.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Yes, you got that right my friend.. :)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Just to let you know that the old smileys are deprecated, you are better off using the new ones, the ones which recent compiler..err Daniweb currently supports... ;-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

And now you, sos, are telling me the easier way is easier on the eyes and a breeze to read - which could go a long way towards making the forums "sticky".

Yes reading it sure is a breeze. Keep trying out different changes with your stylesheets (font face, color, size) and ask the people to give their feedback. How about doing something like this:

Style 1: (verdana, 10pt)

  • blah blah blah

Style 2: (arial, 9pt)

  • blah blah blah

Keeping this and letting us judge or make comments on the fonts which you think are suitable for the site. Can you embed different font's on the same page just for the sake of evaluation.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
a = (int **)malloc(sizeof(int) * 10);
for(x = 0; x < 10; x ++) {
    a[x] = (int *)malloc(sizeof(int) * 3);
}

In this case you were lucky enough to have the size of integer the same as the size of a pointer. If it would have been array of doubles, you would have messed big time. a = malloc(sizeof(int*) * 10); A better way would have been:

int main()
{
    const int SIZE = 10;

    double **arr = (double**)malloc(SIZE * sizeof(*arr));
    for(int i = 0; i < SIZE; ++i)
    {
        arr[i] = (double*)malloc(SIZE * sizeof(*arr[0]));
    }

    for(int i = 0; i < SIZE; ++i)
        for(int j = 0; j < SIZE; ++j)
            arr[i][j] = i * j + i + j;

    for(int i = 0; i < SIZE; ++i)
    {
        for(int j = 0; j < SIZE; ++j)
            cout << arr[i][j] << "\t";
        cout << '\n';
    }
    getchar();
    return 0;
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Hello there Danny, welcome to Daniweb.. ;-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

sos ... I'm confused by your reply. Are you pro or con? :) What do you mean by "even if this font size looks bad, this is more like it"?

I meant, even though it doesn't look pleasing (aesthetic), the current font goes easy on the eyes and makes reading the posts a breeze. And I also agree with Thomas, a little more reasearch into font faces to bring out a pleasing combination of font size and color would be more like it.

> I use firefox, so I guess I'll just make the font size smaller, manually. =/
Though this would wreck your display when visiting other sites. But since you don't browse a lot, I guess it should be OK.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Believe it or not, even if this font size looks bad, this is more like it. And btw Joey, 90% of the people don't think of increasing the size of their browser font, and end up reading as it is. Look at Devshed or any other professional site out there, its the same standard followed out there.

Though the font size is good, I think trying out a new font face would be not a problem for you, atleast for a day or even an hour. If you have decided to tweak, why not tweak it to the core.

Oh and btw Dani, if you haven't noticed, even the text area for typing on those sites hosts the same font as the font which is used for display. It feels weird to be typing in verdana 8pt, to see your quick reply rendered in 8pt and after refreshing your posts in 10pt verdana. Not really consistent, is it?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

With great powers, come great responsibility... ;-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Since I don't have PHP source code on my machine I can't help you in giving out the exact file name. But you can always open a file, and search for the word "explode". Half an hour of work should help you in finding the thing you are looking for.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You need to start learning C++ soon enough. Your code is nowhere near proper C++. We are here to solve your queries and not teach you how to compile your C++ programs. You are better off first reading some good books / tutorials and then come back if you have genuine problems.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

A lot of advices have been given to you already. What you are expecting here is someone to write the clean C++ code for the explode() function, which I don't think is going to happen. You last hope is to download the PHP source code and cut out the clean C++ implementation of the function. If not that, you are on your own.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You have an extra semicolon ( ; ) somewhere in your code. Since C++ (and many other languages) treat it as a blank or no processing statement, your compiler is throwing you out that warning. Remove the extra semicolon and you should be fine.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Please do so. The mods and super mods here are pretty helpful. Be sure to stay away from the super mod though -- he has a knack of giving infractions to potential spammers... :-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

PHP is open source. You can browse through its source code and see the way it is implemented.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Really interesting article. Worth a read. ;-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Oh so here it goes...

Hello my friend, welcome to Daniweb. Hope you enjoy your stay here. ;-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

A small part of it was performance, but that point is nearly moot these days. I was thinking more along the lines of matching a paradigm to a problem and to library availability and ease of use.

In the times where frameworks are in abundance, I don't think matching a paradigm to a problem should be an issue. And btw, modern programming languages come packed to the brim with features so rich, that you almost never need to write functions to perform trivial tasks, the way it is done in C/C++.

Python and Perl are are excellent examples of languages whose add on packages keep on adding more and more value and richness to the language itself. :-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

See this for namespaces. For difference between <iostream> and <iostream.h> see this.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

A small program to get you started:

import java.io.*;

public class Test
{
    public static void main(String[] args)
    {
        try
        {
            BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
            String userInput = in.readLine();
            System.out.println("\n\nUser entered -> " + userInput);
        }
        catch(IOException e)
        {
            System.out.println("IOException has been caught");
        }
    }
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

When they are appropriate.

Oh come on, I hope you are not talking about performance issues here. Either that or I missed your point completely... ;-)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

YOu don't need to redefine the member variables name and date of birth inside the Instructor class since Instructor inherits those from the Person class. Just make a Instructor which takes in three parameters and inside that call the constructor of Person class which takes in two parameters and you would be good to go. Also before asking questions, consider doing some research and studying rather than trying the syntax on your own.

Read this and this.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Make the member variables of the class as normal variables instead of pointers and you should be good to go. And btw, its not a good idea to make the member variables as private since it voilates the OO practices. Write getters and setters and make your data members as private.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Practice is the way to go. The more you practice, the more you know what goes under the hood, the more chances you have of avoiding errors and bugs. But Rashakil is right, if using lanauges like C, C++ bugs can't be avoided. Using modern languages like Ruby, Python etc is the way to go. They are much less of a headache.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

...and always avoid using floats for loop indices if you want to save yourself from future troubles.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

The only problem I have with the rep-system is that you can't rep someone twice, you would have to rep someone else first. There are a few members here that just post brilliant stuff... ;)

This has to be done to prevent Rep spamming...

@~s.o.s~: Sux that you didn't get a new rep-title, but you can always change your custom title!

:-/

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

The point here is that, are floating point numbers absolutely necessary in your program. Can't your task be performed without floating point numbers? If you still want, you can safely pass integers to functions which accept float and the compiler will take care of the upcasting.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You need to trim the string accepted from the file. Use something like this:

#include <iostream.h> 
 #include <string> 
 
using namespace std; 
 
string trimLeft(const string &value) 
  { 
   string::size_type where = value.find_first_not_of(' '); 
 
  if (where == string::npos) 
    // string has nothing but space 
    return string(); 
 
  if (where == 0) 
    // string has no leading space, don't copy its contents (assuming COW 
 strings) 
    return value; 
 
  return value.substr(where); 
  }
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Hm... that would make it tough to get more rep, huh.... :p
Yes sort of, but they are fun while they last... ;)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> why posting games suck

Because people evaluating them like the word "suck"....

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

These are disgusting! That's it, I'm moving to Canada.

Don't forget to change your location to Canada.....;)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Stop using floating point variables as your for loop counter and you should be good to go.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster
  • don't mess with x
  • is an unemployed nerd

I like these two.. :cool:

I wonder if Dani seriously considers coming up with a new title or is this the end of it...:'(

I'd venture that you won't have as much of a chance to demonstrate your insight in all the games. Almost all of my rep has come from the programming sections, where I can throw out bits of information better. 'Course, not everyone here's a programmer, but even in serious discussions in the Geek Lounge you'd probably have a better chance of getting more rep.

Serious discussions in the Geeks Lounge...you have got to be joking. The only serious discssions are those discussions which turn into a flame war and we don't get to see a lot of them nowadays...;)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Noooo, but I want a new title. :D Please come up with a good one Dani.. ;)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Assembly language.
Except for the fact that this is a C/C++ forum...

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Well guess what, I think Dani forgot to code titles after "is a name known to all", so I am just left with the same old title. A PM to Dani would clarify matters a bit... ;)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

How many reputation points does it take to get a block? Is it 100? Because I have 46 points at the moment.

It takes 50 points for a change of title and 50 points for an additional block, so together it becomes 100 points for a total change.

Yeah, I'm the person that spends most of my time in the geek's lounge playing word games hehe...

Yeah, you are the one all of them are looking after... ;)

BTW, I am happy with the Rep system except for some kids "derepping" me for no reason without knowing that my neg rep can affect them in a big way. I guess thats why they don't bother leaving their names behind. :D

PS: A couple of more points and something would surely change -- either my title or the shiny dots. :twisted:

John A commented: Here you go then... let's see what happens :mrgreen: --your blogger friend Joe +9
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Copy and paste the code posted by me in the previous post. It works. You don't need classname qualifiers in front of member functions when written inside classes.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

lancer