Excizted 67 Posting Whiz

This topic is two months old!?

Excizted 67 Posting Whiz

The path you are setting must be the directory containing "gcc.exe" - otherwise you can't execute gcc directly from the cmd. Otherwise you have to write the full path to execute the the gcc program.

Excizted 67 Posting Whiz

Yep.

Excizted 67 Posting Whiz

If you're very into this, I could give you some help over IM to get you started :)

Excizted 67 Posting Whiz

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

Excizted 67 Posting Whiz

The heap got corrupted somewhere else.
Looks like you are using arrays. Make sure there's no overruns, or any other writes beyond the allocated memory, or double deletes, etc, etc, etc. After you find the problem, dump arrays altogether and rewrite everything with vectors.

thank you for your reply - I'll look for what you described tomorrow and get back to you later. :)

Excizted 67 Posting Whiz

Any specific? Theres a lot of code on the Call Stack..

d_handler = &handler;

        RawDataContainer rawXMLData;
        System::getSingleton().getResourceProvider()->loadRawDataContainer(filename, rawXMLData, resourceGroup);

        // Create a buffer with extra bytes for a newline and a terminating null
        size_t size = rawXMLData.getSize(); // debugger says 1957
        char* buf = new char[size + 2];
        memcpy(buf, rawXMLData.getDataPtr(), size);
        buf[size] = '\n';
        buf[size+1] = 0;
Excizted 67 Posting Whiz

Yes and as I skimmed that is what you're doing already?

Excizted 67 Posting Whiz

Use code tags!!!!!!
And btw, what are you trying to achieve?

Excizted 67 Posting Whiz

Please define 'validation'? :D

Excizted 67 Posting Whiz

Hehe goodie :P
Lol and I'm actually unsure what a BTree is :0)

Excizted 67 Posting Whiz

Also, I just found that I forgot to answer your questions...
I believe Allegro is cross platform, so should work under Windows..
To make an RPG you have to sit down and write some flowcharts... Think of your code like a big company...
There is the main office where all orders originates from, then there is a graphics department, ai department and so on... If you have a big blackboard available, that's a good place for writing thoughts.

Also you ofc need to figure what your game should feature, and what to do for graphics (3d graphics requires a 3d modeller, if you aren't one yourself - otherwise paint will do :P).

Start out simple - Like a game where you have to move from one spot to another and then you win. Try something like that, when you succeed, expand...

Excizted 67 Posting Whiz

Hi and welcome to the business - and welcome to DaniWeb :)

Well I hear a lot of newbies go with Allegro, but 2 years ago when I first time wanted to make a video game, I found Allegro confusing - maybe it was just me, but I never got it running.

I'm very satisfied with the Ogre library (www.ogre3d.org) - It's a fully featured crossplatform rendering library, that means it is advanced. They have very friendly forums - and some beginners tutorials I believe.

I started with something more simple than a video game though, I did some useful applications for my own needs - Developed almost exact copies of some simple software that I didn't want to buy for a few dollars.

Also made a chat program to chat with some friends, was fun :P

Anyway, if you want some help getting started, I could assist you and explain how to set up your environment over IM? :) *limited offer :o*

Excizted 67 Posting Whiz

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

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

Excizted 67 Posting Whiz

Hello :)

My program is supposed to load some data into a buffer - but it fails.
This is where i get a segmentation fault...

char* buf = new char[size + 2];

Where my debugging tells me that size is correctly containing the value "1957" which is the actual size of the file I'm loading.

I have absolutely no clue why this is happening - my only guess is that the class that calls the code above, isn't instanced... But that doesn't seem to be the problem, as the this value seem sane:

(this=0x7fffffffe010,handler=<value optimized out>,filename=@0x7fffffffe1e0: {static npos = 18446744073709551615, d_cplength = 22, d_reserve = 32, d_encodedbuff = 0x8bc4f0 "MyGUI.scheme", d_encodeddatlen = 23, d_encodedbufflen = 23, d_quickbuff = {66, 108, 97, 110, 121, 101, 69, 110, 103, 105, 110, 101, 71, 85, 73, 46, 115, 99, 104, 101, 109, 101, 0, 0, 0, 1, 6512536, 0, 4152271862, 32767, 6512600, 0}, d_buffer = 0x0},resourceGroup=@0x7fffffffe290: {static npos = 18446744073709551615, d_cplength = 3, d_reserve = 32, d_encodedbuff = 0x8c4d00 "GUI", d_encodeddatlen = 4, d_encodedbufflen = 4, d_quickbuff = {71, 85, 73, 0, 4160565248, 32767, 6512952, 0, 4160569344, 32767, 6513000, 0, 4294967295, 0, 6513064, 0, 4152131584, 32767, 6513128, 0, 4155236576, 32767, 6513176, 0, 4155237048, 32767, 6513240, 0, 4158575052, 32767, 6513304, 0}, d_buffer = 0x0}

Any clues? :) Thanks!

Excizted 67 Posting Whiz

Hi,

I find CodeBlocks a bit too unstable and generally lacking a lot.

Have you tried NetBeans? It is an IDE that supports several programming languages - All I do is basically programming, and I've tried many IDE's - I really like NetBeans as the best IDE. It both available for Windows and my Linux<3. I use it for Java, C++, C, Ruby (on Rails), PHP, HTML, CSS and more.

I'd say give it a try, you might just be wasting time in CodeBlocks :)

And hey people, no flame war here, I'm not ragging down on CodeBlocks, just suggestion him to try NetBeans as it is in my opinion and personal preference better.

Excizted 67 Posting Whiz

Hello :)

I've got this resource (as in files on the pc) management system, that had been tested but now seems to be malfunctioning.

I've been debugging for way too long now, and I can't figure out the issue.

I'm going to post some of my code first, and then specify the errors afterwards.

Note String is a typedef for std::string;

In my Class.hpp, in the private section, I'm creating my std::map

typedef std::map<String, ResourceGroup*> resourceGroupMap;
resourceGroupMap m_ResourceGroups;

ResourceGroup is a quite small class.

In my Class.cpp, as the first action in a function, I do this

String name = "some-name-here";
resourceGroupMap::iterator it = m_ResourceGroups.find(name);

That line is what starts the trouble!

GDB marks it as a call stack line, and dives into stl_map as the next call stack:

iterator
find(const key_type& __x)
{ return _M_t.find(__x); }

The last line is the next call stack:

iterator __j = _M_lower_bound(_M_begin(), _M_end(), __k);

_M_begin is the last call stack:

_Link_type
_M_begin()
{ return static_cast<_Link_type>(this->_M_impl._M_header._M_parent); }

The last line is where i get the segmentation fault signal.

I'm really confused with this, as I find it odd that STL encounters a run-time error with such a simple thing as what I'm doing here.

If you need more code, please tell me so :D

I hope someone can assist me in this nutness!

Thanks! ;)

Hours has past and finally my leet debugging skills solves my own problem...

A function that should create a class and return a pointer was simply missing the part where it return the …

Excizted 67 Posting Whiz

Well, you can use the string functions to find each number.. example with comma-separated numbers, spaces not allowed:

std::vector<int> v;
std::string numbers; // this is the string with your numbers
std::string::size_type pos = 0;// current position
while(pos != std::string::npos) // as long as current position is valid
{
    std::string::size_type start = pos; // temp storing pos in start
    pos = numbers.find_first_of(',', start); // setting pos to the next pos, which is comma
    v.push_back(atoi(numbers.substr(start, pos-start).c_str())); // cut from start to (next-comma-position minus current-position)
    pos++; // skip next comma, so we should be positioned at the next number
}

Then take a look at
http://www.cplusplus.com/reference/algorithm/sort/

Excizted 67 Posting Whiz

What that dude said!

Excizted 67 Posting Whiz

Hello :)

I've got this resource (as in files on the pc) management system, that had been tested but now seems to be malfunctioning.

I've been debugging for way too long now, and I can't figure out the issue.

I'm going to post some of my code first, and then specify the errors afterwards.

Note String is a typedef for std::string;

In my Class.hpp, in the private section, I'm creating my std::map

typedef std::map<String, ResourceGroup*> resourceGroupMap;
resourceGroupMap m_ResourceGroups;

ResourceGroup is a quite small class.

In my Class.cpp, as the first action in a function, I do this

String name = "some-name-here";
resourceGroupMap::iterator it = m_ResourceGroups.find(name);

That line is what starts the trouble!

GDB marks it as a call stack line, and dives into stl_map as the next call stack:

iterator
find(const key_type& __x)
{ return _M_t.find(__x); }

The last line is the next call stack:

iterator __j = _M_lower_bound(_M_begin(), _M_end(), __k);

_M_begin is the last call stack:

_Link_type
_M_begin()
{ return static_cast<_Link_type>(this->_M_impl._M_header._M_parent); }

The last line is where i get the segmentation fault signal.

I'm really confused with this, as I find it odd that STL encounters a run-time error with such a simple thing as what I'm doing here.

If you need more code, please tell me so :D

I hope someone can assist me in this nutness!

Thanks! ;)

Excizted 67 Posting Whiz

Your code works perfectly for me unfortunately.
I made four elements, entered them 1, 2, 3, 4 and it posted back all the elements and stated that the highest was 4.

Excizted 67 Posting Whiz

Well because working perfectly for me doesn't help my sister :)

Excizted 67 Posting Whiz

I usually use Linux yes, where everything works perfectly, but on Windows by using MSKLC to make my keyboard layout, shortcuts remain at the physical location on the keyboard.

Excizted 67 Posting Whiz

Daimn!

Excizted 67 Posting Whiz

If you edit your original post so that the code is in CODE tags, and then indent the code like this (which is only possible in code tags)

{
   stuff happens;
}

Then I'd be happy to read your code and help you further.

Excizted 67 Posting Whiz

Hello.
First of all: Use code tags.
Great now that's settled I'm not completely able to understand your problem.
Anyway, to list all the elements in a vector, look at this:

typedef std::vector<int> integerVector; // a standard typedef of our vector type
integerVector mNumbers; // here we actually make an instance of the vector based on our typedef
mNumbers.push_back(25); // could be any number
mNumbers.push_back(72); // could be any number
mNumbers.push_back(12); // could be any number

/* Ok, lets get the vector content */
unsigned int highest = 0; // create a variable to keep track of highest value, note this approach will only work with positive  numbers

integerVector::const_iterator pos; // an iterator to store the current vector element
for(pos = mNumbers.begin(); pos != mNumbers.end(); ++pos)
{
    // this loop will run for each item in mNumbers, and the item is accessible in pos

    std::cout << (*pos) << std::endl; // output pos, dereferenced with a *, otherwise we output the address
    if((*pos) > highest) // if this element is the highest yet
        highest = (*pos); // then register it
} // now we've been through all the elements

/* highest should now contain the biggest integer element
std::cout << "The highest element was: " << highest << std::endl;

Hope this is of any help.
Also note that you can easily get the number of elements with mNumbers.size()

Excizted 67 Posting Whiz

He said it!
And please in your next post, could you do your even better at making some more readable text? Because oh gosh you don't have to tell us English isn't your first language, but you should know some general grammar! :)
Good luck to you.

Excizted 67 Posting Whiz

Hello,
I've been using Dvorak on my Linux machine for a long time, and I've finally convinced my sister to do the switch as well.

Using Microsoft Keyboard Layout Creator (MSKLC) I easily managed to install Dvorak layout, but shortcuts like Ctrl+C doesn't move, it's the same spot, so after moving the keys around I actually press Ctrl+J.

It's kinda hard when it comes to irregular shortcuts in other programs. Because the program will tell me to use Ctrl+B, but then I'd have to rethink that it actually is Ctrl+X.

How do I make a keyboard layout that works completely, and doesn't just affect the letter appearing when pressing the buttons?

Thank you! :)

Excizted 67 Posting Whiz

Actually it seems that the error is raised from my original action although moving it... Guess I'll have to live with that.

Excizted 67 Posting Whiz

Thank you, works like a charm.
Unfortunately the action SSH is called from, is giantic with lots of different functionality depending on post params, but I'll just make a new action dedicated for the SSH connection and then call that action from the original action.

Thanks again ;)

Excizted 67 Posting Whiz

I'm able to do what I want to achieve with your code, but it also overrides all other errors, making it hard to debug - also seems to override my 'Insufficient admin priviliges' system.

Is there some way to tune the functionality so that it render :text if it is the Net::SSH related error, or yield if not?

Thank you :)

Excizted 67 Posting Whiz

Hi.

I'm just trying out Ruby on Rails, and I'm trying to create some application that takes a hostname from the user and then checks if it is connectible through Net::SSH and if it is, it should check if a file is present.

Quite simple, and I also almost reached goal. But I can't seem to implement what should happen if Net::SSH.start fails?

I just get a big Rails error page with param dumps and stuff, but actually I'd just like to do a render :text => 'Hey couldn't connect dewd' or something.

How is that doable? Do I have to make my own error page of some kind?
Thank you.

Excizted 67 Posting Whiz

Oh well sorry then but I have no clue how to create that slide-down thingy.
It's probably not a good place to look for that in the PHP forums, maybe try some HTML/CSS forums?

Excizted 67 Posting Whiz

You want to print some text, without that having to be to an <input> box? Well make a <div> object with an id and set its innerHTML, look:

<script type="text/javascript">
function postResult(myResult)
{
    document.getElementById('output').innerHTML = myResult;
}
</script>
<div id="output">Please search</div>

innerHTML is at the start "Please search" but then with the sample function "Please search" will be replaced with the content of 'myResult'.

Excizted 67 Posting Whiz

I wanted to wrap your code in code tags so it's many times easier for me to read and understand.

Excizted 67 Posting Whiz

Wanted to help you there, but your code is not very nice to read. Edit your post and put the code in code tags, you have to remember that! :)

Excizted 67 Posting Whiz

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

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

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

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

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

Excizted 67 Posting Whiz

Something like this?

int** mainArray = new int*[5]; // example number
for(int i = 0; i < 5; i++)
     mainArray[i] = new int[3]; // two numbers and a sum

void sumThem(int** mArray, int which)
{
     mArray[which][0] = mArray[which][1]+mArray[which][2];
}
Excizted 67 Posting Whiz

I suppose your problem is simply that you're not, by HTML, setting the charset?
Try putting the following in the head area of your HTML output, or just output it at top if you don't have any advanced HTML yet.

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Excizted 67 Posting Whiz

Nice outline of what you want your program to do; copied from your school assignment?
Don't you think it is a good idea to tell us what you've tried, what you suppose could be wrong and other information like that? Not to talk about those subjects of common sense actually are rules of this forum.

Excizted 67 Posting Whiz

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

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

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

Excizted 67 Posting Whiz

Ahh haha, you got me there, silly me ;)
I thought it would be some server configuration or something.

Well thank you very much! :D

Excizted 67 Posting Whiz

Hi.

I have multi-language functionality on my page, and the settings are saved in a cookie, so that the user may change something different than his browser language.

But this is whats happening:

/home.php?setlanguague=en
The page shows it's text in English, and prints my user info aswell as the content of the language cookie, which is "en".

/admin/users.php
The page shows in my browser language. Meaning the set language from /home.php haven't persisted.

/home.php
The page still shows in English.

So basically as I navigate around my site, as soon as the page is in another dir, the cookie is unique for that dir.

Hope this explanation is possible to understand.

So, why does this happen? I thought cookies were domain specific?
How do I solve this? Links are fine.

Excizted 67 Posting Whiz

Ehh, I'm pretty sure you can't translate a wildcard in this case, so that *.peoplelist.com transfers whatever the wildcard represents to peoplelist.com/users/*

So you have to make some automated zone editor for making A records in your DNS server, and then do the Apache configuration.

Excizted 67 Posting Whiz

I supposed so as well. Guess I'll just have to stop being lazy and make that server.

Thank you.

Excizted 67 Posting Whiz

Hi people.

I'd like to use MySQL in my application - would be an easy way for me to store users.

But then I'd have MySQL credentials in my app, visible for everyone with a HEX editor, I'd suppose?

And even though that MySQL user will have low privileges, then still too much info would be accessible.

Is there a secure way to use MySQL, or would I have to make my own server app, as a relay?

Thank you :)

Excizted 67 Posting Whiz

so as I see it, its the same form just with some plastic somewhere? So it should be no problem connecting the PGA478 CPU to the socket where the PPGA478 CPU used to be?

Excizted 67 Posting Whiz

Yep it is a Dual Core.
And the PPGA I already have, is too.

Excizted 67 Posting Whiz

But the PGA478 CPU's I'm looking at is after all called a Mobile Processor, so shouldn't it be made for running in laptops?

Excizted 67 Posting Whiz

Hello.

I'm in possesion of this laptop with an old Pentium Dual-Core T2080, of socket type PPGA478 (says Intel web).

I wanted to upgrade it, and found a lot of processors called PGA478.

So now comes the billion dollar question: Is there any difference? Can I use the PGA processor in the PPGA socket?

Thanks! :)