JasonHippy 739 Practically a Master Poster

To be honest, I haven’t distro hopped since Linux distros started moving from the venerable Gnome 2, to the frankly horrific Gnome 3. And have never really paid any attention to what’s happening on distrowatch.com.

During my last big distro-hop I tried lots of different distros. I ended up using Arch for a few years, with suckless.orgs dwm (tiling window manager) which I fell in love with. Before eventually settling down with Debian (installed via the minimal net installer, so I could avoid Gnome 3) and manually installed X11 and my beloved dwm.
And I’ve stuck with the Debian/dwm combo ever since.

So I have very little first-hand experience with more recent Linux distros.

A couple of months ago, I installed POPOS on my girlfriends nephew’s PC. He was frustrated with Windows and decided he wanted to switch to Linux, after seeing Linux running on my laptop.

POPOS’s setup was an absolute doddle. And being a Ubuntu based, Debian family distro, maintenance is a doddle too.

He got the hang of things pretty quickly after a short guided tour/tutorial from myself.

Also, after installing Steam on there for him (along with Discord and Spotify) - he was extremely happy to discover that ALL of the games in his Steam library were playable in Linux (at least, they were after enabling ‘Steam Play’).

And he has since claimed that most of his games seem to perform better on Linux than they ever did on Windows. So that’s a glowing endorsement …

Reverend Jim commented: doddle? +15
JasonHippy 739 Practically a Master Poster

@Dani:
I started visiting less often around the time that all of the separate programming language topic forums were munged together. But this wasn't the cause of my decrease in activity.

I'm more of an answers person. I come here to try and help others, rather than to ask questions.

When I was most active on the site, I used to log-in and lurk - waiting for new posts to answer. But over time, I'd noticed that there were a lot less new questions being posted in the areas that I'm interested in (primarily C, C++, Python and Linux). So I'd lurk less and only log in occasionally.

And a lot of the time, by the time I got around to reading any new questions - they had already been satisfactorily answered by other other regulars here. So there was no point adding anything!

And ever since then - I still check the site - albeit much more infrequently than I used to. And I will log in and put in my 2 cents when appropriate. Nowadays, I spend more of my time on Linux.org answering Linux related questions and helping to solve coding related questions there.

I'm not a huge fan of the bigger sites like SO and Reddit - sometimes they feel more like a dick-swinging contest for geeks than a community. I prefer to participate in smaller communities.

Daniweb is a great community, I really like it here. I like spending …

ernie.cordell commented: I believe you achieved "DaniWeb maturity" in the correct way: I should have trodden your path. +0
JasonHippy 739 Practically a Master Poster

There is no need to convert it to C. It is already C code. But it uses conio.h, which is a non-standard C extension that is not supported by all compilers.

Remove the include for conio and remove the call to getch at the end and you're left with standard, portable C code.

JasonHippy 739 Practically a Master Poster

Depending on the actual content of myScript.sh, you might be able to use input redirection to use the file as input to the script:
./myScript.sh < /path/to/file

Or if file contains a list of file-names to search - you might be able to use xargs:
cat file | xargs ./myScript.sh
But again, xargs usage would depend on what myScript.sh actually does. We don't really know anything about your script, what parameters it is set up to take etc etc.

Or you could just set up your script to explicitly take the path to a file as a parameter:
e.g.

#!/usr/bin/env bash

# if number of parameters to script is 1 AND the parameter is the path to a file
if [ $# -eq 1 ] && [ -f $1 ] ; then
    grep -iHn --color "regex" $1         # Search the file
else
    echo "ERROR - Script takes 1 parameter which must be the path to an existing file"
    exit 1                                    # Exit with error status
fi

And then you would run your script like this:
./myScript.sh /path/to/file

Obviously the above example was completley contrived. I don't know what your actual script does. But my example should give you an idea on how to modify your script to take a file-name as a parameter, if that is what you want to do.....

JasonHippy 739 Practically a Master Poster

From my understanding:
Arrays are a thin wrapper on C style arrays. They can only contain objects of the same basic data-type, so they are more strongly typed - but they can only deal with numeric C-style data types. They are a lot more basic than lists or sets. Arrays are probably best used in situations where you know up front, how many items they will contain and that the array will not need to grow. But if you're going to be dealing with a dynamic set of data that could grow or shrink - you're probably better off using List or Set.

Sets can hold pretty much anything - as long as it is hashable. Objects in the set are sorted/ordered based on each objects hash values. Also, sets do not allow duplicates. And I'm not sure how set deals with hash collisions (where two different objects have the same hash-values). And because sets use hash-tables, lookups are pretty fast.
So if you are dealing with hashable types and you don't want duplicates (and you aren't worried about possible hash-collisions) - sets are the way to go.

Lists can hold pretty much anything and don't care about duplicates. Objects remain in the order in which they were added. If a list runs out of space and needs to reallocate - it will reallocate much more space than it needs. So lists can become quite large. But this does mean that they can be appended to efficiently, …

JasonHippy 739 Practically a Master Poster

Of course, you need to restart bash after modifying ~/.bashrc.

Actually you don't have to restart bash at all. You can re-load/re-source any of the changed config files in the running shell using the dot command ('.') which is a built-in. So after changing .bashrc, you can re-load it by using the following command:

. ~/.bashrc

This will reload and execute the config file, any changes that were made to the .bashrc file will then affect the running shell. No need to shut down bash and open a new instance. Just use the dot command in all open terminals to re-load the latest config!

As it is a built-in, there is no man page, but the help command will show you more information about it:

help .
Gribouillis commented: good point +14
JasonHippy 739 Practically a Master Poster

I'm not at all familiar with the nosetests package, I've never used it.
And from taking a look at its man-page online, I can't see anything that mentions a --html-file option.

However, I do know shell scripting. So here's a quick, simple shell-script to execute all .py files in the current directory, which renames the results.html file to filename.py.html - where filename.py is the name of the python file being tested.
runtests.sh

#!/bin/bash

#default html file output by nosetests
OUTFILE=results.html 

for FILE in ./*.py;
do
    nosetests $FILE --with-html-out # run test
    if [ -f $OUTFILE ]; then     # if results.txt exists
        mv $OUTFILE $FILE.html   # rename it to testfile.py.html
    fi
done

The above script would have to be in the same directory as the python files you are testing. Make sure you set the execute permissions-bit on the script (chmod +x ./runtests.sh), then you can use ./runtests.sh to run the tests.

After running the script, you should see a bunch of html files alongside your python files, containing the results of the tests.

That is just a simple script that I knocked together quickly. If you want to make it more useful - it would be trivial to modify the script to take a path to a directory as a parameter. That way you could move the script into /home/yourusername/bin/ and you could use it as a general tool to run tests on ANY directory containing python files.

You could modify it further to use something like …

JasonHippy 739 Practically a Master Poster

It's a nice start I suppose. There are a few bugs and other improvements that could be made here and there, to make it a bit more robust and more cross-platform.

For starters, the biggest problem:
You haven't included the listing for your PyEditorErrors module. That's a bit of a deal-breaker right there!

But commenting out that import statement should allow your program to run - at least until we hit a line which tries to call a function in the errors module! :) Commenting out those calls should fix that too (in leiu of the actual listing of that module).

The other bugs/problems I spotted stem from using hard-coded paths in your program.

For example: Trying to create a new file will fail if the user doesn't have a sub-directory called 'Programs' in the current working directory, where the user is running your editor from.

Ideally, the user should be able to choose where to save their new file to, rather than it going to a hard-coded location that might not even exist on the users machine.

Also, you have some code in your program to set up alternative keyboard shortcuts for mac based OSes. But in your 'run' functionality, you are using hard-coded, windows-only paths to the python3.4 executable.

So what if the user is using a different version of python (2.6, 2.7, 3.2)? Or Python is installed elsewhere? Or they are using a different OS (Linux, Mac, BSD)?

Sure, the user could edit your script to …

JasonHippy 739 Practically a Master Poster

I'm not really familiar with volatility, but at a guess, I'd say that it wants you to specify a dump directory using the --dump-dir command line option.
So I'd guess you'd need to add --dump-dir /path/to/dump/dir/ or --dump-dir=/path/to/dump/dir/ to your volatility procdump command (depending on how it takes parameters to the --dump-dir option).

NOTE: /path/to/dump/dir/ should be a valid path to a directory which already exists somewhere on your machine.

Once you have specified a directory to use as the dump-dir, I guess it will use that directory to write additional files to.

JasonHippy 739 Practically a Master Poster

Rubbermans suggestion is the best one for last line mode.

But in command mode there are several methods of removing text other than using x.

Assuming the cursor is placed under the first letter of the word you wish to remove; Other than using x, which removes a single character you also use the following commands:
3x = delete 3 characters, would remove 'and' for you
dw = delete word - deletes the entire word under the cursor (up to any special, non-alphanumeric character or whitespace character)
dW = delete word - deletes the entire word under the cursor (up to the next whitespace character, regardless of any special non-alphanumeric characters)

There are several other deletion commands in command mode that will allow you to delete entire lines of text (dd, 2dd etc), or from the cursor to the start/end of the line (d0, d$) and plenty more besides!

vi and vim are extremely powerful text editors. There are a lot of commands available in them. By using combinations of commands, you can perform complex editing tasks quickly and easily. You can even compile commands into macros/scripts and automate common editing tasks. It is worth taking the time to learn how to use these editors properly as they can really boost your productivity!

Try out vimtutor, the built-in interactive vi/vim tutorial. That will give you a good headstart on using vi/vim. Also read the man pages and browse vi/vim's built-in help (using the :help command) as this …

rubberman commented: Good advice. +12
JasonHippy 739 Practically a Master Poster

If you want an example of creating a boot-loader, you might want to take a look at MikeOS - a simple, open source 16 bit OS for x86 based systems, written in assembly.

The site has a great tutorial here, which shows you how to create your own bootloader using assembly and how to turn it into a bootable image that you can put onto a floppy or a USB drive. Also you can download and examine the source code for MikeOS and refer to the developer guides on the website.

OK, it's only 16 bit, but it's a start isn't it?!

JasonHippy 739 Practically a Master Poster

To enable syntax highlighting in nano you can do the following:
Use ls to list the contents of /usr/share/nano
ls /usr/share/nano
This will give you a list of files with names like {filename}.nanorc. These are the syntax highlight modules that are available.

Assuming you managed to find some syntax highlight modules, to enable them you need to create a file called .nanorc in your home directory.
So as you are using nano, lets do that with nano:
`nano ~/.nanorc'

In the file, you should include the syntax highlight modules that you want to use (or you could just include all of them!):

include /usr/share/nano/c.nanorc
include /usr/share/nano/python.nanorc
etc etc...

Finally save the file and quit. Now you should be able to see syntax highlighting any files that are of a type that you added the highlighting module for.

Personally, Vim is my command-line editor of choice. But I am also comfortable using Emacs and Nano. Vim and Emacs are both extremely powerful editors and IMHO are well worth investing some time in learning to use properly!

JasonHippy 739 Practically a Master Poster

It's so your server can serve pages over http and https/ssl.

Port 80 is the default port for http traffic (in your case, you've redirected http to port 8080 on your server, which is fair enough). And port 443 is the default port for https.

Typically on a dedicated web server, you wouldn't have Skype installed. So normally this isn't an issue. But your server must be running on a desktop or laptop PC that you use for general day to day usage.

To stop the problem, you have disabled the use of port 443 in skype.
The other option would be to use a different port for https on your server (442?), just like you did with port 8080 for http.

If ssl/https is not required, I imagine it should also be possible to disable it. That said, I haven't done any serious web development for a number of years, so I've had no need for a server. Consequently, I haven't really messed around with setting up and running an Apache web-server for a looong time. So I can't really offer any detailed info. But I'm sure that someone else here will be able to help!

JasonHippy 739 Practically a Master Poster

Your set-top-box must either be using a different implementation or a much older version of find that doesn't have the execdir option. It was added to GNU find as a safer alternative to exec. But exec will do the trick if execdir is not available.

From looking at the man page for find, there is also the -delete option, which I've never noticed before. As you have no need for the maxdepth option, that would leave you with this:

find ./ -type l -delete

Which is even more concise and requires a little less typing. (If your set-top-boxes version of find supports it that is!)

Also, for the sake of completeness:
Depending on the age of the tools that are installed on your set-top-box, some of the commands might not be able to handle file-names containing spaces very well. So the examples I've posted so far could be problematic if any of your files contain spaces in their names.
If files with spaces in their names are a problem to remove, another alternative would be to pipe the list of files output by find to the rm command using xargs:

find ./ -type l -print0 | xargs -0 rm

Finds print0 option will print the full path of each file found, with a null character appended at the end (as opposed to a newline). And then in xargs, the -0 parameter (or --null) will cause xargs to read all characters up to the null character as …

JasonHippy 739 Practically a Master Poster

Or from the command-line you should simply be able to do this:

find ./ -type l -execdir rm {} \;

NOTE: The above will recursively find all sym-links in the current directory (and all sub-directories of the current dir) and remove them with rm. If you only want to find to search the current directory, without going into any subdirectories, you can use the -maxdepth option like this:

find ./ -maxdepth 1 -type l -execdir rm {} \;

Or you could put it into a shellscript:

#!/bin/sh

find /path/to/folder/ -maxdepth 1 -type l -execdir rm {} \;

etc...

EDIT:
For extra safety, you might also want to consider using the -i switch/option with the rm command. This will prompt whether you want to delete each individual file.
e.g.

find ./ -maxdepth 1 -type l -execdir rm -i {} \;

I wouldn't want you to accidentally hose your system using any of my suggestions! ;)

JasonHippy 739 Practically a Master Poster

It's almost certainly because you are using a mixture of cin >> and std::getline to get input from the user.

You might want to consider changing line 17 to use getline because cin >> will only take everything up to the first newline or whitespace character. So if the user enters a multiple word college name; because of the spaces, only the first word will be written to the variable. The rest of the characters (and the newline) will remain in the input stream and will end up being consumed by a subsequent call to cin or getline.

Also, in your main menu; after you prompt the user to enter their preferred option and get the value via cin, you might want to consider using cin.ignore afterwards with some appropriate parameters to allow it to disregard any remaining characters/newlines in the buffer.

To discard extraneous characters from the input buffer after a call to cin, many people tend to use things like: cin.ignore(std::numeric_limits<int>::max(), '\n');

Personally, I side-step this issue in my command-line programs by getting all user input as a string via std::getline. Then I parse and validate the user input before converting it to the required type and range-checking it... Might seem a bit overkill and a PITA, but that's just me. All user input should be considered guilty until proven innocent, heh heh!

WRT your program displaying all colleges in the list, try setting up a boolean sentinel flag/variable just before your for loop at line 31 and …

JasonHippy 739 Practically a Master Poster

Mathematics is the least of your worries if you are planning on using no libraries whatsoever. Especially where graphics is concerned!

In C++ there is nothing in the standard library that can deal with graphics, so you would literally have to write everything yourself. You'd need to do a lot of low-level programming, interfacing directly with the hardware or its drivers in order to do anything graphical. And if you know nothing about C or C++, then that will only compound matters!

I'd say that you are definitely going to need to use some 3rd party libraries. At the very least, you'll need OpenGL. It's pretty much a de-facto standard nowadays for graphical apps - especially if you want to develop cross-platform programs.

To develop your own low-level graphics library to replace OpenGL would take an extremely long time unless you are some kind of brilliant programming prodigy! (Not to say that you aren't, merely pointing out that this would not be a trivial thing to implement!)

But there is nothing to stop you from building your own engine on top of GL.
For example:
All cross-platform game engines (at least all of the ones I am aware of) use openGL for all of the low-level graphics stuff. But they create their own APIs to abstract things away in their engine; making it easier for programmers use their library to work on games/applications at a higher level of abstraction than with GL.

WRT compiling for multiple operating systems, …

JasonHippy 739 Practically a Master Poster

Have you tried Editra? Editra is a lightweight text editor (written entirely in Python) with really fast code-completion/auto-completion for python.

It also has call-tips/code-hinting for variables in your code (as per your screenshot!), but the call-tips are a little slower than the auto-completion. You have to select the variable-name and hover for a second or two before the call-tips/hints appear.

This functionality also relies heavily on docstrings. It works well for most libraries as they tend to be clearly documented, but for it to work well with your own code, you need to ensure that you clearly document your own classes/methods etc using docstrings for the tips to be really useful.

Also, whilst Editra is only a simple text editor, you can use Editras built-in plugin manager to download and install a few plugins that will turn Editra into a fully fledged, but still extremely fast and lightweight Python IDE.

Tcll commented: nice and descriptive :) +3
JasonHippy 739 Practically a Master Poster

I strongly suggest that you have a go at doing your own homework as per the community rules:
https://www.daniweb.com/community/rules

If you have trouble finding it, under the "Keep It Organized" section is this rule:
Do provide evidence of having done some work yourself if posting questions from school or work assignments.

Your post above displays no evidence that you have tried to do any of your homework. The community here will not do your homework for you, or spoon-feed you code. We will only help you when you get stuck with something specific.

Start writing your program. If you hit upon any problems that you cannot solve, post the code that you have so far and describe the problems/errors you are experiencing and someone here will help you!

Remember: The amount of effort that you put into your posts will determine the amount of effort that others will put in to help you!

JasonHippy 739 Practically a Master Poster

I strongly suggest that you have a go at doing your own homework as per the community rules:
https://www.daniweb.com/community/rules

If you have trouble finding it, under the "Keep It Organized" section is this rule:
Do provide evidence of having done some work yourself if posting questions from school or work assignments.

Your post above displays no evidence that you have tried to do any of your homework. The community here will not do your homework for you, or spoon-feed you code. We will only help you when you get stuck with something specific.

Start writing your program. If you hit upon any problems that you cannot solve, post the code that you have so far and describe the problems/errors you are experiencing and someone here will help you!

Remember: The amount of effort that you put into your posts will determine the amount of effort that others will put in to help you!

ddanbe commented: Well Said. +15
JasonHippy 739 Practically a Master Poster

Oh no! Really sad to hear that.
I never met him in person, but like many members of the community, I've had a fair bit of interaction with him here on DW and elsewhere on the net.

Mel was a top bloke. Extremely knowledgeable, friendly and always willing to help. He will be sorely missed. RIP Mel! :'(

JasonHippy 739 Practically a Master Poster

Heh heh, to paraphrase that famous bit of badly translated script from Zero Wing:
All your post are belong to Dani! XD

JasonHippy 739 Practically a Master Poster

A quick bit of duckduckgo-fu yielded this:
http://xlinux.nist.gov/dads//HTML/btree.html
Which looks like it contains all the information you need to get started, including links to tutorials/implementations and descriptions of the various specialisations of B-trees.
Is that any help?

hurtmemore commented: already visited that site sir but it only gves a brief description about b* tree's. any way, thanks for the help sir :) Can't found any detailed articles in the internet tho +0
JasonHippy 739 Practically a Master Poster

Line 9: Remove the & from &friends. That'll fix it!
Using &friends causes the address of the int variable called friends to be printed via printf. Remove the & and the value stored in the friends variable will be printed!

JasonHippy 739 Practically a Master Poster

Another alternative to SDL is SFML - Small Fast Media Library. It's in C++ and is extremely simple to use!

Gribouillis commented: It looks nice, and there are python bindings! +14
JasonHippy 739 Practically a Master Poster

Here's some great advice for Linux sys-admins who want to detect and block attempts by would-be attackers who are testing your servers for this bug, or who have already taken advantage of it:
http://www.linuxbrigade.com/bash-shellshock-bug-find-youve-tested/

Even if your server has already been patched, it probably makes sense to block anybody who is testing for the presence of the bug as they are obviously up to no good!

JasonHippy 739 Practically a Master Poster

There are a number of ways that you could install Ubuntu on a USB drive and it all depends on what you want. Do you just want a live environment on the USB drive? or do you want to be able to save documents and make changes to the settings and have them persist across sessions? Or do you just want to treat the USB drive as if it was a hard-drive and do a traditional install on there instead?

Also, do you plan to do this from Windows or Linux?

Whatever you plan to do, here are several ways that I have used in the past to get Linux live .iso's onto USB:
If you boot to the desktop via a Ubuntu live CD/DVD, there should be a program called something like USB creator (can't remember the exact name, but it should be on the LiveCD, do a search for it in the HUD). This will allow you to create a live USB install from the CD/DVD you booted from.

Alternatively, there is unetbootin, a free program which is available for Windows and Linux which allows you install any Linux .iso onto a USB drive.
There is a thread about unetbootin here:
https://www.daniweb.com/hardware-and-software/linux-and-unix/threads/397711/how-to-install-opensuse-linux-from-a-bootable-flash-drive

If you plan to do this from Windows, then unetbootin is pretty much your only option!

With USB Creator and unetbootin, you can also set up persistent storage (this allows you to set aside some space on the USB drive for …

JasonHippy 739 Practically a Master Poster

I don't think I could make it any easier without actually doing your homework for you. And let's make this clear: I'm NOT going to do your homework for you. That's not what Daniweb is about! The community here exists to help guide you, not do your homework for you.

Please see the community rules, particularly this one from the 'Keep It Organized' section which states:

Do provide evidence of having done some work yourself if posting questions from school or work assignments

From what can be seen in this thread so far, you have made no attempt to do any of this yourself. I have already explained what you need to do as clearly and as simply as I can.

If you have a problem understanding anything about your homework questions, or anything that I or another user have presented to you, then please ask specific questions about the things you do not understand and one or more of us here will attempt to answer your questions.

So which part/parts of your homework do you not understand?

JasonHippy 739 Practically a Master Poster

OK, so that's your homework. What part of it are you having a problem with?

It's not too difficult. The instructions are pretty clear.
It might help you to understand the algorithm if you indent the pseudo-code in the same way that you would indent C++ code:

Input A
C = 0
D = A

Repeat
  Input B
  If B > D
    D = B
  endif
  C = C + 1
Until B = 0

Print D, B, C

And this DATA: 4, 6, 3, 7, 8, 5, 3, 9, 2, 0, 5, 1 must be the list of all values fed to the Input statements for a single run-through of the algorithm.

So, for part a) of your homework you simply need to make a table of all of the variables and their state/value at each step of the algorithm. You have four variables A, B, C and D.

So for the first statement in the algorithm Input A; according to the list of inputs (DATA:) the value will be 4, so A=4, B,C and D are undefined. So put that into your table against the first statement.

Then you move to the next statement in the algorithm and log the value of all four variables and continue until you have reached the end of the algorithm. Go through the loop as many times as required by the algorithm. Each time you reach an Input statement in the algorithm, record the next value in DATA against …

JasonHippy 739 Practically a Master Poster

Out of curiousity I took a look at this when I got home last night. It turns out that the patch mentioned above was not enough to get the program to compile under gcc 4.8. But with a little work I was eventually able to get it to build successfully.

As soon as I get a chance, I'll try to generate an all-in-one patch that will apply all of the necessary changes on top of 3.0.11. This should allow the library to build with gcc 4.8. I'll attach it to another post in this thread!

JasonHippy 739 Practically a Master Poster

Looking at the projects sourceforge page there is a patch to get the program to compile on gcc 4.3.
I suggest you download and apply that patch and see if it builds on gcc 4.8.

In case you don't know, you can install the patch using the following command in the terminal:
patch -p1 < /path/to/patch_file.patch

Note: You will need to be inside the directory containing the source code. e.g. inside the '/path/to/nurbs++-3.0.11/' directory. Where /path/to/ is wherever you have extracted the original source tarball to!

Like I said, with any luck it will compile without any problems once the patch is applied. But if there are any problems, they should be relatively trivial to fix!

JasonHippy 739 Practically a Master Poster

First you'll need to install some form of Linux distro, then you need to install and configure Apache web server, MySQL (Or some other database engine) and PHP, before installing Wordpress on top of that!

But the exact instructions would depend on how you plan to use your server and which Linux distro you plan to use.

For example, are you just trying to set the server up on your day to day desktop PC/laptop, perhaps as a development server, so you can create and test your wordpress website locally before uploading it to a remote server elsewhere? Or will this be a dedicated server on your network that will do nothing more than host and serve your site?

If it is to be a dedicated server, you might want to install a distro with no desktop environment by default. I understand that Ubuntu server edition gives you many different options at install time, so you can install it with or without a desktop environment and you can also set up the type of server/services you want to install (LAMP webserver, mailserver etc). There are a plethora of other options to choose from it all depends on what you want to do.

If it's on your day to day computer: after installing your Linux distro of choice, you just need to install the relevant software using your chosen distros package manager. All of the relevant packages will be available in its repos. Again, the exact steps would depend on which …

RikTelner commented: First two lines, say it all. +2
JasonHippy 739 Practically a Master Poster

At the end of the day, it is your life and your decision.

What do you want to do with your life and your career?
There are a lot of career paths you could take. If you know what you want to do, or what areas you are particularly interested in, then try to find a qualification/training programme in that field.

If you have no interest in ethical hacking, then there is probably no point in attempting to get certified as an ethical hacker. These types of qualifications require an in-depth knowledge of a wide range of CS related subjects. If you don't have a really, REALLY strong interest in the field of ethical hacking/security, you are probably going to get bored and/or frustrated. And then you'll either give up, or fail!

If you don't want to do it, or aren't interested in it or have any other kind of doubts, don't do it! Simple as that!

But if you do decide to go for it and you manage to get certified - good on you. With a well recognised ethical hacking qualification you would probably find it easy to get into a number of security related positions - Network security, penetration tester, software/hardware security researcher (identifying/patching vulnerabilities in software/hardware), malware analyst for an antivirus company etc.

With the Red Hat qualification, you will gain the necessary skills to administer a Linux network using Red-Hat Linux products (RHEL, Fedora) and other Red-Hat derived distros (SUSE, CentOS, Scientific Linux etc). …

morfious90 commented: the best answer +0
JasonHippy 739 Practically a Master Poster

As the MyCon objects have all been allocated on the heap with new, you should probably iterate through the map and delete all of the MyCon elements before the std::map drops out of scope!

So iterate through the map, delete each MyCon pointer and perhaps use map.erase to remove each pair from the map as you go (probably not necessary, but couldn't hurt!):

const map<string, MyCon*>::iterator end = myConMap.end();
map<string, MyCon*>::iterator it = myConMap.begin();
for(;it!=end; ++it)
{
    MyCon *con = it->second;
    delete con;
    myConMap.erase(it);
}
Jsplinter commented: Thank you! +2
JasonHippy 739 Practically a Master Poster

That looks a lot like Python code to me. I think the OP has misposted in the C section.

To compound things, he seems to have a load of line numbers included in the code he posted. I've just cleaned it up.
Here's the OPs original python code:

"""
withdraw_money()
a.  prompt user for a money amount in US Dollars (no cents, i.e. no
    fractional part allowed)
b.  print a preamble which says that user will see the breakdown of the
    money in banknotes
c.  print maximum number of $100 bills that can be given for the amount
    given by user
d.  print maximum number of $50 bills that can be given for the amount left
    over from previous step
e.  print maximum number of $20 bills that can be given for the amount left
    over from previous step
f.  print maximum number of $10 bills that can be given for the amount left
    over from previous step
g.  print maximum number of $5 bills that can be given for the amount left
    over from previous step
h.  print maximum number of $2 bills that can be given for the amount
    left over from previous step
i.  print maximum number of $1 bills that can be given for the amount left
    over from previous step
"""
import math
import string

def withdraw_money():
    withdraw = 0
    hundreds = 0
    fifty = 0
    twenty = 0
    ten = 0
    five = 0
    two = 0
    one = 0
    withdraw = …
JasonHippy 739 Practically a Master Poster

I have a copy of Apress Pro Linux Systems Administration by James Turnbull, Peter Lieverdink and Dennis Matotek.

It covers pretty much everything from the basics, including partitioning and user management. Right up to much more advanced topics like managing large-scale deployment/configuration of Linux over a network using Puppet.

It also covers package management in Red-hat and Debian/Ubuntu based systems, and covers building and installing software from source too. So the information in the book can be applied to pretty much any Linux distribution.

The material in the book covers a lot of ground. Unless you aim to become a sys-admin for a large network of Linux machines, you probably won't use most of the stuff in the book. But it does contain a lot of very useful info.

The book itself is quite a hefty tome, with 20 chapters and over 1000 pages. It also has a pretty hefty price tag: $49.99 USD.
That said, I got my copy for free a couple of years ago when I renewed my subscription to Linux Format! Heh heh!

Anyway, I find myself referring to it from time to time and would definitely recommend it!

JasonHippy 739 Practically a Master Poster

EDIT: Nevermind Moschops got there first! :)

JasonHippy 739 Practically a Master Poster

It is almost certain that the kernel module/driver for the sound-card is in use. If Alsa is running, that would also be using the kernel module for the sound card. So something (either the driver or ALSA) is claiming ownership of the sound device and this is most likely stopping libusb from being able to access it - Giving you the 'device busy' error message. (BTW: I'm not sure ownership is the right term, but you get what I mean!)

Why are you using libusb to get data from your sound card? Why not go through another API like ALSA or JACK?
This article might be of some help to you:
http://www.linuxdevcenter.com/pub/a/linux/2007/08/02/an-introduction-to-linux-audio.html

JasonHippy 739 Practically a Master Poster

It depends on whether OpenMeetings wants the path to the tools that make up ImageMagick, or the path to the ImageMagick libraries. The ImageMagick tools (convert, identify, mogrify, composite, montage etc) should all be installed to /usr/bin/.
To confirm you have them installed, try which convert, which should give you the path to ImageMagick's image conversion program.

If it wants the path to the ImageMagick libraries, they should be located at /usr/lib/ImageMagick-x.y.z/ (Where x.y.z is the currently installed version/build of ImageMagick.)
Try using locate ImageMagick (note the capitalisation) and you should see the path to the library files. Alternatively, use the -i switch to ignore the case of the search term: locate -i imagemagick

Likewise, if ffmpeg is installed it should be in /usr/bin/.
Try which ffmpeg to confirm the path to the ffmpeg binary.
If it does not display anything, you almost certainly don't have it installed. If this is the case, you can install it from the repos using sudo apt-get install ffmpeg

Gribouillis commented: good help +14
JasonHippy 739 Practically a Master Poster

It depends how you interpret the OPs original question.
I'd interpret it in the same way as ddanbe. Rather than wanting to count each occurrence of each individual character in those ranges, the OP wants to count the following:
- The number of numeric digit characters
- The number of lowercase alphabetic characters
- The number of uppercase alphabetic characters

So as far as I see it, the OP needs to define three counter variables and then inside the loop that processes the characters he needs to use the following functions:
isdigit - to determine if it is 0-9, if so - increment the appropriate counter
islower - to determine if it is lowercase, if so - increment the appropriate counter
isupper - to determine if it is uppercase, if so - increment the appropriate counter
The functions named above are all found in ctype.h.

I really don't think anything more complicated is called for!
However, if my interpretation of this problem is incorrect, then AD's advice is spot on!

JasonHippy 739 Practically a Master Poster

See that semicolon at the end of line 70?
That's your problem!
Thanks to the semicolon, you've effectively set up an infinite loop at line 70.

JasonHippy 739 Practically a Master Poster

Actually, Sanchit is incorrect. You need to be using sudo to move the file. root is the owner of /usr/lib/, so in order to move the red52 folder to /usr/lib/, you will need to be root.
So try this instead:
sudo mv red52/ /usr/lib/
That should work!

JasonHippy 739 Practically a Master Poster

OK, first off; you have posted in the incorrect section of the site. This question belongs in the C section, NOT the web development section.... But I'm sure one of the mods will rectify that shortly!

Secondly, can you post more details on the program that is experiencing the segfault? For starters, is this a program you have written yourself? Or a program you have installed from your chosen distros repositories? Or something you have downloaded from elsewhere? Which Linux distro are you running? Do you have the source code for the program?

With the very vague information you have given, the only advice I can give you is equally vague:
1. Get the source code for the program if you do not already have it.
2. Build a debug version of the program by including the -g flag (you might need to alter some makefiles to do this).
3. Run the program through gdb (GNU debugger) until it crashes.
4. Examine the code around the point of the crash and try to determine what is causing the crash and why.
5. Alter the source code to fix the problem.
6. Rebuild the program - again generating debugging symbols with -g.
7. Run the program to see if the fix worked. If the program still crashes, keep running through steps 4-7 until the problem is fixed.
8. Once the problem is fixed, build a release version of the program (remove the -g …

JasonHippy 739 Practically a Master Poster

Or as you want to go up a level from the current path, perhaps use find_last_of:

#include <iostream>
#include <string>

int main () {
    std::string src, dst;
    src = "C:\\Windows\\subfolder";
    dst = src.substr (0, src.find_last_of ("\\") + 1);
    std::cout << "Original: " << src << std::endl;
    std::cout << "Modified: " << dst << std::endl;
    return 0;
}
kal_crazy commented: Works perfectly. Thanks +4
JasonHippy 739 Practically a Master Poster

You are using the wrong operator in your if statements. You need to be using the == operator in your if statements, not the = operator!

= is the assignment operator, used to assign a value to a variable.
Whereas == is the test for equality.

EDIT:
In fact, the == operator is incorrect. After looking at your code again, you need to be using the >= (greater than or equal to) operator:
e.g.

if (num >= 400 && num <=424)
    cout<< “ Violet “;
else if (num >= 425 && num <= 491)
    cout<< “ Blue “;
else if (num >= 492 && num <= 575)
    cout<< “ Green “;
else if (num >= 576 && num <= 585)
    cout<< “ Yellow “;
else if (num >= 586 && num <= 647)
    cout<< “ Orange “;
else if ( num >= 648 && num <= 700)
    cout<< “ Red “;
else
    cout<< “ Wavelength outside visual range “;
JasonHippy 739 Practically a Master Poster

Personally, I've been using FLOSS exclusively at home for a number of years now. Even at work I try to use free-software for as many tasks as possible. The only non-free software I use at work ATM is Windows OS and Visual Studio. But I don't get any choice over those.

But wherever I do have a choice, I choose free software. I don't see any point in getting my boss to pay for a licence for me to use Photoshop or Illustrator for creating things like icons or any of the other simple graphical items I might have to create in the course of doing my job. There is no point. I can simply download one of any number of FLOSS programs and do it for free!

I was discussing free-software with a couple of former colleagues from my days at an elearning company who are professional graphics geeks doing 2D and 3D CGI GFX and animations for various companies now.

As mentioned in my previous thread, the main obstacle that we all saw that could prevent wide-spead adoption of free software by professionals was the entrenchment of other proprietary programs.

Many companies just have so much data stored in proprietary formats that are specific to a particular program, they cannot easily switch (unless there is a simple way to convert files to an open format without any loss of quality or data - Which in most cases there isn't). So even if the free-software was up to the …

mike_2000_17 commented: Very complete answer! +14
JasonHippy 739 Practically a Master Poster

Have you searched your linux machine for ntstatus.h?
Open a terminal and try the following command:
find / -type f -iname "ntstatus.h"
This will recursively search from the root of your file-system and try to find the file.

If it lists any files called ntstatus.h, then you know it is a problem with the compilers paths (and in which case, I'm not sure how to fix it offhand!).

But if it does NOT list any files, you'll probably need to download and install the Windows SDK on your Kali Linux machine (because ntstatus.h is part of the Windows SDK).

BTW: If memory serves, when you download the SDK from Microsoft, it is usually a self-extracting archive in .exe format. So I'm not sure whether you'd be best served installing it via Wine, onto Wines virtual C:, or by extracting/installing it on a Windows machine and copying all of the include and library files to your Kali box via a USB thumb-drive.... IDK!

Either way, the first thing you need to do is determine whether or not you have ntstatus.h. I suspect that you do not!

JasonHippy 739 Practically a Master Poster

I agree. Free software has come a long way in the last 10 years or so! It is stunning what can be done with free tools nowadays. There are many free programs that can at least come close to their highly polished, proprietary cousins. There are probably also a few that can give them a run for their money or even better them! Heh heh!

As for things being 'industry standard', that seems to have happened in pretty much all of the creative industries. All of them have some expensive proprietary piece/pieces of software which are seen as the best/only way of doing things. There may be viable, free alternatives to all of these programs, but I don't think that any of the proprietary programs which are currently considered de-facto standards are likely to be knocked off their top spots any time soon. Mainly because they have been so entrenched in the culture of those industries.

However, for your average computer user, students or perhaps even startups that are looking to minimise their costs; free software is becoming a more enticing and viable alternative to expensive proprietary software day by day!

JasonHippy 739 Practically a Master Poster

I remember reading an article somewhere online in the last couple of weeks discussing this very issue.

Pear OS was a one man effort, so it is possible that David Tavares simply decided to end the project. However that is unlikely because before the Pear OS website was taken down (the site is now offline) - David announced that the project was closing because it had been bought from him by a well-known tech company who wanted to remain anonymous for now and who want to develop and improve Pear OS for their products. I don't like to think that David would have lied about that. So it is almost certain that somebody has bought Pear OS.

But without knowing who bought Pear OS and their exact plans for it, we can do little more than speculate.

I too doubt that Apple would have bought it. They have no real need for it. And if Apple wanted it shut down, they have lawyers for that.. Unless it was cheaper to buy Pear out than to sue... Which is possible - but again, extremely unlikely! Personally, I don't think that Pear OS would even have been on Apples radar.

From the vague information that was given by David before the Pear website disappeared, perhaps a harware/OEM type company has bought it and plans to ship their new hardware with PearOS pre-installed. This is a very distinct and feasible possibility. There may be a sincere OEM out there who wants a modern-looking, …

JasonHippy 739 Practically a Master Poster

The compiler is complaining because it cannot find ntstatus.h.
Either you do not have it installed, or it has been put somewhere outside of the systems search path for header files.

Also you should be aware that ntstatus.h is a windows-only header file. It is not available for Linux.
You will need to have a copy of all of the windows header files and the windows versions of the corresponding libraries somewhere on your machine if you do not already have them. Once you do have them, you need to either put them on a path that is recognised by the compiler, or tell the compiler where to find the files.

Personally I've never tried cross-compiling Windows binaries on a Linux machine, so I can't really help beyond that! I know it is possible to do it, but I've never had the desire (or the need) to do so, or to find out for myself. But if anybody here at Daniweb knows anything about this kind of thing, it will probably be Rubberman or Mike!