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

At a guess, it's because you are passing the GdiPlus::Image class constructor (for the img member of your image class) a wchar_t when it wants a pointer to wchar_t, a WCHAR*.

Have you tried this:

image(  const string & filename)  : graphics(hdcimage),img(&(towstring(filename)))
    {
    //.............

That will pass the address of the wchar_t returned by your towstring function. Effectively converting it to a WCHAR* that I am fairly certain the GdiPlus::Image class will be able to accept as a parameter in its constructor.

I could be wrong, but it's probably worth a shot! :)

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

Took me a little while to spot this, but I think you are going to kick yourself!

Have a close look at what your loadSurface function is doing:
Line 140: You load the image into an SDL_surface pointer called loadedSurface.
Line 149: if the image loaded sucessfully, you optimise the image and store it in the SDL_surface pointer called optimizedSurface
Line 157: You delete the object pointed to by loadedSurface
Line 160: You return loadedSurface (which you just deleted.... Ooops!)

So your array gets filled with invalid pointers. Therefore when you try to blit an image at line 232, you are going to get a crash!

Also, with the code as it stands: Each time the loadSurface function gets called and returns and the optimizedSurface pointer drops out of scope, the pointer to the memory containing the optimized image/surface is lost. So you also have a memory leak!

I think you want to be returning optimizedImage at line 160 instead! :)
That will stop the crash AND plug the memory leak!

JasonHippy 739 Practically a Master Poster

You have a wide range of options:

On Windows you could install the free version of Visual C++ Express (or buy a licence for one of the full versions of VS) and use the Visual Studio IDE and compiler. Or you could use a free IDE like Code::Blocks with Mingw (windows port of the gcc/g++ compilers). Or if you want to compile from the command line, without an IDE you could install Cygwin (a Unix-like terminal environment for Windows with ports of common Unix/Linux tools including gcc/g++, make, cmake etc)

On Linux you could install gcc/g++ with some additional command-line build tools (gnu make, cmake, autotools etc). And if you want to use an IDE for C/C++ there are many available for install too - Code::Blocks, CodeLite, KDevelop, Geany, Anjuta, Eclipse etc..

The choice is yours! And my list above is not exhaustive by any means. There are tons of other free compilers out there that I have not mentioned like llvm/clang! Or Eclipse (Java IDE), which can be used as a C/C++ IDE via a plugin.

JasonHippy 739 Practically a Master Poster

The OPs questions are in the comments in the code.

@OP:
How you would populate the vector of records would depend entirely on how the data has been stored in the input file. You need to read the data from the file and convert that to records that you can store in the vector.
But without knowing the exact format of the data in the input file, nobody can tell you exactly how to do it. It will be down to you to work out that part.

I recommend having a go at this yourself. If you have any problems, please post an updated version of your code, with a description of the problems you are having and an sample of the data in the input file. Not the whole file BTW, just a sample of maybe two or three records, exactly as they appear in the file and somebody here will help you out!

In answer to your second question RE: your switch statement; You have defined a set of functions which all take a reference to a vector of records as a parameter. But in your calls to the functions in your switch statement, you aren't passing any parameters at all. So your compiler is giving you a whole bunch of error messages!

So you need to call the functions like this:
ListAllTheWetDays(records);

JasonHippy 739 Practically a Master Poster

The only obvious thing that I can see that would cause a crash is at lines 10 and 11.
At line 10, you attempt to open and get a pointer to a file with the filename you have set-up. But you haven't performed any kind of check on the pointer before using it in the call to fread at line 11. So if the file pointer is invalid (because fopen failed to find or open the file), you're likely to experience a crash!

So you should check the state of the pointer before attempting to read the file:

///Reads data from file
if(FILE* dat = fopen(fileName.str().c_str(),"rb"))
{
    fread(&myUser, sizeof(user), 1, dat);
    fclose(dat);
    //.... rest of your code
}
else
{
    // Failed to open the file!
}

Also, why are you using C style FILE pointers instead of C++ streams?

EDIT: Ah, you self-solved while I was writing this! I was too slow!

JasonHippy 739 Practically a Master Poster

That's strange!
Are you saying that compiling the program causes the wrapper-library to throw an exception?? That doesn't seem at all right!

From what you've posted, it looks more like your code compiled just fine and that you're getting a crash at runtime, due to an unhandled exception thrown by a call to one of the library functions.

So one of the lines of code in your program is calling a function in the wrapper library with one or more bad parameters, causing it to throw an exception.

I recommend recompiling your code using the -g flag (which makes gcc/g++ generate debug info) and run your program through a debugger like gdb in order to determine exactly which function call is causing the exception to be thrown.

Once you've located the offending line of code, it might be worth enclosing it in a try..catch block, in order to allow your program to more gracefully handle any exceptions thrown by the library.

It might also be worth taking a look at whatever documentation comes with the library you are using (if any) to determine why the exception is being thrown at that part of your code and what you can do to avoid it.

Another thing of note in your code is that you have not performed any checks on any of the pointers which point to objects that you are dynamically allocating via calls to new. So you are taking it for granted that the creation of a new …

JasonHippy 739 Practically a Master Poster

If memory serves, there should be an example vimrc file at the following location:
/usr/share/vim/vimXX (where XX is the version of vim installed)
The file will be called something like vimrc_example.vim. This contains a sane set of defaults for vim, including auto-indent and syntax highlighting. You can copy that to your home directory and rename it .vimrc.
e.g.
`cp /usr/share/vim/vim74/vimrc_example.vim ~/.vimrc'

Optionally, you might want to edit it and make some changes to it.

I usually add a few custom settings/keybinds to the default .vimrc:

set incsearch           " do incremental searching
set number              " Show line numbers
set hls                 " Highlight search results

" Use enter/return to clear search-result highlights
nnoremap <CR> :noh<CR><CR>:<backspace>  

" Set up a keybind to switch from header to cpp
" F4 - Go to header/source
map <F4> :e %:p:s,.h$,.X123X,:s,.cpp$,.h,:s,.X123X$,.cpp,<CR>
" F3 - Open the file under the cursor 
" (good for opening headers in the include list
map <F3> gf<CR>

The comments explain what each setting does.

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

For me it has to be Crunchbang or Arch.

That said, I'm currently using Kubuntu 14.04 on my main laptop. But I rarely log into a KDE/Plasma desktop session anymore. I spend most of my time using a dwm session instead! (dynamic window manager - a simple tiling window manager)

I love dwm and install it alongside whatever Desktop/wm is installed by default on all of my machines. I even run it on my Windows PC at work (via Cygwin/X).

JasonHippy 739 Practically a Master Poster

I've been sporting a long goatee beard for the last 15 years or so. Don't know too many people in the IT/programming field with beards, but I know plenty of bearded bikers, metallers and musicians!

JasonHippy 739 Practically a Master Poster

I'm having a similar problem. I just tried attaching a patch file to one of my posts as .patch.gz (compressed), .patch (uncompressed) and .txt and it keeps telling me that it is not allowed.

I'm using Firefox on Kubuntu 14.04.

JasonHippy 739 Practically a Master Poster

EDIT: Damn, DW won't let me upload/attach my patch... :/

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

b is a byte string - I'm sure I mentioned these in one of your other python threads...I think it was one of your socket related threads.
Yup, here.

As long as you are happy using python 2 (tagpy isn't available for python 3 atm), the tagpy library will make your life a lot easier, you can just use the following syntax:

import tagpy

# open the file and read the tag
f = tagpy.FileRef("yourfile.mp3")
t = f.tag()

# print the existing tag info
print(t.artist)
print(t.title)
print(t.album)
print(t.year)

# change the info
t.artist = "Tone Deaf and the Eh?"
t.title = "Blah blah blah"
t.album = "You what?"
t.year = 2014

#print the new info
print(t.artist)
print(t.title)
print(t.album)
print(t.year)

# save the file with the new tag info
f.save()
JasonHippy 739 Practically a Master Poster

You could try installing and using the Tagpy library to tag the mp3 files.

Tagpy should be available in the repos of most distros - I think the package is called python-tagpy on Debian/Ubuntu based distros. Not sure what it's called on others.

JasonHippy 739 Practically a Master Poster

AFAIK, with most Linux distros which use Bash as the default shell; many of them already have $PATH set up to check for a bin sub-directory in the users home directory (or it might be something in .bashrc... can't remember offhand! But it's definitely there!).

So if you create a sub-directory called 'bin' in your home directory, you can copy any programs or scripts you've created into your personal bin folder and you should be able to access them from anywhere on the terminal without having to mess around with $PATH. Just type the name of the command as you would with any other program.

I always copy scripts/programs into my personal bin folder in my home directory if they are strictly for my own use. But if I come up with something that is useful to other users of my systems, I'll often copy them to /usr/local/bin/, which is already included in the system search path.

As a rule, I try to avoid copying my scripts into system directories like /bin/, /sbin/, /usr/bin/, /usr/sbin/ etc. Generally, the only scripts/programs that end up in those directories are ones that are put there by the package manager for whatever distro that particular machine happens to be running.

So my two cents is: Copy your own scripts/programs to /home/yourname/bin/ or /usr/local/bin/ depending on how accessible you need them to be.

JasonHippy 739 Practically a Master Poster

I'd have to echo Rubberman!

The first thing I'd suggest is clean up your indentation and your general code-formatting, it's all over the place. As your code currently stands, it's pretty unreadable. Nobody is going to try and read it in its current state.

Secondly, I recommend putting your classes into separate .h/.cpp files and then including them in your main program. Having the program broken up into smaller, logical units is far better than having a monolithic block of code like the one you posted above. It will make your code and your logic much easier to read and understand!

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

Your reverseNode function takes a double as a parameter.
But in your recursive call to reverseNode at line 56 you are dereferencing rest, which is declared as a pointer to a ListNode. So you are effectively passing a ListNode into the recursive call, NOT a double, which is what the compiler expects. Because it is not getting a double at that point, the compiler is displaying an error message.

Exactly what are you trying to do with your reverseNode function?
Are you trying to reverse the entire list? Or are you trying to do something else with it?

JasonHippy 739 Practically a Master Poster

I've never really messed with vi/vim scripts, other than making a few minor modifications to my .vimrc startup file.

Using vim, you could sort the file using the command :sort.
That will sort the file in exactly the manner you have described. It's only a simple alphabetic sort, so there is no need to pass any parameters.
So you start with this:

JOHN:Morgan:90:24
MIKE:Smith:95:11
JAYSON:Ty:99:9
TYLER:Edward:89:5

Running the :sort command will give you this:

JAYSON:Ty:99:9
JOHN:Morgan:90:24
MIKE:Smith:95:11
TYLER:Edward:89:5

Which is what you wanted isn't it?

From the terminal or a shell-script, you could use the sort utility:
e.g. Sort the file and write the sorted output to a different file:
sort ./file.txt -o ./sorted.txt

But offhand, I'm not sure how you'd go about calling the sort function in a vi/vim script. I really should look into scripting vim though. I currently have a few macros set up in vim to automate various repetetive tasks. But it would be good to be able to write scripts for some of them!

JasonHippy 739 Practically a Master Poster

The problem is that the QT headers get installed to a bunch of subfolders in /usr/include/qtx/ << where x is the version of QT that is installed. The QApplication and QLabel headers are in the QtGui subfolder.

Because the headers included in the program (e.g. #include <QApplication>) are not on the actual standard system include path (they are a couple of subfolders in), the program will not compile correctly unless g++ is given the correct paths for the header files.
It's the same story for linking with the QT libs.

qmake is the best way to compile QT programs on the command line IMHO. It will generate a Makefile for you and will take care of creating all of the appropriate settings for g++. Far quicker and easier than doing it manually!

JasonHippy 739 Practically a Master Poster

The command line used to compile the program looks completely incorrect.

When using QT, the best bet is to use qmake, I think it comes with QT when you download the QT development files, but it might be a separate package..... Been a long while since I installed it!

To use qmake: Open up a terminal, navigate to the directory which contains the code for your project and use qmake to create a project for your program.
qmake -project
This will create a file called xxxxx.pro << where xxxxx is the name of the directory your code resides in.
Next run qmake on the generated project file to generate a Makefile:
qmake xxxxx.pro

Finally run the make command to build your application.

BTW: Unless I am mistaken, Line 10 of the example program should be return app.exec();

JasonHippy 739 Practically a Master Poster

No worries, glad to have helped. Mark as solved??

JasonHippy 739 Practically a Master Poster

You need to be root in order to create directories at that location, so you need to use sudo at the beginning of the command.
Eg.
sudo mkdir -p /red5/blahblahblah..............

JasonHippy 739 Practically a Master Poster

As Labdabeta pointed out in your other thread, localtime_s takes a pointer to a tm struct as the 1st parameter and a pointer to a time_t as the 2nd.
So this is all you need:

time_t now = time(0);
tm ltm;
localtime_s(&ltm, &now);

Instead of a tm pointer, you now have a local instance of the tm struct and you pass a pointer to it to the localtime_s function.

With the above changes in place, the last piece of the puzzle should be to swap out the uses of the arrow operator for the dot operator in your other uses of ltm.
e.g.
ltm->tm_mon in line 16 of your snippet becomes ltm.tm_mon etc.

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

Do you have wxWidgets installed?
From the look of the one error you've listed, i'm guessing you don't.... Otherwise, it could be that the path to the wx libraries have not been set up properly.

The project templates in C::B will only work if the libraries the project depends on are installed and configured correctly.

For wxWidgets on Ubuntu, you'll need the wxwidgets-dev package. Can't remember the exact name for the package... On my phone ATM! I don't have my laptop handy!

JasonHippy 739 Practically a Master Poster

Tinstaafl is correct. You need to remove the cin.ignore() at line 29. That does not need to be there.

But wherever you use cin to get input from the user (i.e. using cin >>), you need to use a call to cin.ignore() immediately afterwards. But it's not necessary to use ignore after using std::getline.

So put a call to cin.ignore() between lines 36 and 37, 40 and 41, 46 and 47 etc...

JasonHippy 739 Practically a Master Poster

As somebody who has gone "full-freetard", I only run Linux at home and have no need for more than one OS on any of my machines.

But I have to use Windows at work and have no real justification to install any other OSes on my work machine either. So I've never really used virtualbox. (But I really should try at some point!)

However, I did miss the greatness of the Unix/Linux command-line whilst at work. Cmd and Powershell just do not compare! So I installed Cygwin and have used it pretty extensively for a number of years. Cygwin terminal is not the same as running a full Linux distro. But it does enhance your windows experience by making it a bit more like Linux.

It is also possible to run an X-server session with a Linux desktop (Gnome, KDE etc) via Cygwin. I use dwm - a tiling manager. Easier to set up and get running than any of the other desktops, less dependencies, more lightweight etc. But that is another story!

Personally, I'd say why make a choice between Cygwin or virtualbox??
Why not use both?! :)

JasonHippy 739 Practically a Master Poster

It should be possible to updgrade from 10.10 to 12.04, but to be honest, it would probably be quicker and easier to do a clean install of 12.04.

Assuming you still have the update manager installed:
(Note: You will still need the update manager - if you do not have it installed, run the following command: sudo apt-get install update-manager-core)

In order to perform the upgrade via the command-line:
First back up all important documents.
Next open the file /etc/update-manager/release-upgrades with a text editor and change the line that starts with Prompt= to Prompt=normal

Note: The 'lts' setting is not appropriate here. You can only update from one LTS version to another LTS version if the currently installed version is itself an LTS version.
10.10 is not an LTS and the next LTS is 12.04. So you will have to use the 'normal' option and then you'll have to upgrade from 10.10, to 11.04, to 11.10, to 12.04.

You can do this with sudo vim /etc/update-manager/release-upgrades.
NOTE: Substitute vim with whatever your preferred text editor is.
If you use a GUI text editor (e.g. gedit or kate) you should use gksudo instead of sudo.

After saving the file and exiting your text editor, the next step is to ensure that the current install is up to date and that any unused/unneeded packages are removed:
sudo apt-get update && sudo apt-get upgrade & sudo apt-get autoremove

Finally perform the upgrade from 10.10 to 11.04 using:

JasonHippy 739 Practically a Master Poster

To install sox in ubuntu, you can just use:
sudo apt-get install sox
According to the Package lists maintained by Ubuntu.com, Ubuntu 12.04 currently uses version 14.3.31. Which is newer than v12.xx of sox. So the version which is currently in the Ubuntu repos should be good enough!

But if you REALLY want to get the latest version of sox, you'll have to go here to download the source package and then go through the usual configure and build process. And if you have any missing dependencies for building sox, you'll have to go through the process of getting them installed before you can build sox.
Personally, I'd try installing the version in the Ubuntu repos first.

Note:
When attempting to install any program on Linux, your first port of call should always be your distros repositories.
You can search for packages on the command line in Ubuntu using:
apt-cache search xxxx
Once you've identified some packages you want to install, you can use sudo apt-get install xxxx yyyy zzzz to install the packages (again, where xxxx, yyyy and zzzz are the names of the packages you want to install)

By default, apt-cache search searches through the names and descriptions of all packages for the specified search term.
This can sometimes yield a lot of irrelevant results. If you want to cut down the number of irrelevant results, you can use the --names-only switch.
So in order to track …

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

You should just be able to right click the zip file and choose extract, unless it is in an odd format.

True - That would work on the desktop, or in a file-manager like Nautilus or Dolphin.

But on the command line, I heartily recommend dtrx. Especially if you use the command line often and you have a lot of compressed archives in several different file-formats.

It saves you from having to remember all of the command-line switches for all of the different decompression programs. It also saves you from having to trawl the man-pages for the appropriate switches when you forget them. Simply leave it to dtrx to handle all of that for you!

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

To expand Mochops answer a little: The modulus operator '%' divides the number to its left, by the number to its right and returns the remainder.

As moschops pointed out 10%20 is 10.
Because 10 divides by 20 zero times, leaving a remainder of 10.

Whereas 20%10 is 0.
Because 20 divides by 10 twice, leaving a remainder of 0.

JasonHippy 739 Practically a Master Poster

Rubberman was suggesting that you use the strdup function found in string.h.
In his post he posted the definition of the function as found in the header:
char* strdup(const char* source);
In other words strdup is a function which takes a const char* as a parameter and returns a char*.
You would use it in code like this:
char* copy = strdup(originalString);
Where originalString is the char* that you want to create a copy of.
The strdup function will create a duplicate of the string and returns a pointer to the copied string. So the variable "copy" will point to the copy of originalString.

JasonHippy 739 Practically a Master Poster

I know this has already been solved. But as an addendum:
If you use a lot of different compressed formats(.7z, .zip, .tar.gz, .rar, .ace) and you want to be able to extract them on the command line, but without having to remember all of the different command line switches and options for each format; there is a nifty little python script called dtrx (Do The Right Extraction).
Extracting archives is then just a case of:
dtrx archivename.tar.gz or .7z, or .zip or whatever!

dtrx is available from the Ubuntu repos:
sudo apt-get install dtrx

Note: in order for dtrx to work with different archive types, you'll need to ensure that you have the appropriate programs installed for those file-types. So it will not extract .7z files if you do not have 7zip installed. As long as you have whatever programs you need installed, dtrx will deal with extracting the archives appropriately!