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

Ha ha, oops. I completely forgot about this thread... :/ Sorry! Haven't been online a huge amount in the last year or so.

Looking at my HD, I still have the patch-file I put together for the 3.0.11 sources. But Daniweb still won't let me attach it to a message here.

My patch contains all of the changes that were in the gcc-4.3 patch, with additional changes that allow the library to build under gcc-4.8.x (on my machine at least - running Kubuntu 14.04 LTS, with gcc-4.8.4).

Assuming you are still using gcc-4.8.x it should be OK. But if you are using a more recent version of gcc, it might require further changes to allow the library to build. So I can't offer any guarantees.

I've just uploaded the all-in-one patch to my google-drive account and publicly shared it, so if you still want it, you can download it via the following link:
https://drive.google.com/file/d/0B5c6wR9mB0_pR1RrNlB2Ry1yYm8/view?usp=sharing
The patch file is called nurbsAllInOne.patch.gz

The file is compressed. So you'll need to decompress it - either via your file-manager/Desktop/GUI-based decompression program (file-roller, or some-such), or via the command-line using gunzip. After decompression, you should be left with a file called 'nurbsAllInOne.patch'.

To apply the patch:
- Open a terminal and navigate into the directory containing the nurbs-3.0.11 source-code
- Apply the patch using the following command:
[code]patch -p1 < /path/to/nurbsAllInOne.patch[/code]
Where '/path/to/nurbsAllInOne.patch' is the path to the decompressed patch-file.

Once the patch has been applied, it …

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

Ah.... Just re-read your post. Looks like you're already logged in as root.... Hmmmm.
Have you tried lsattr to see what attributes have been set on the files. I wonder if something like the immutable flag (i) has been set or something? That might cause chown to fail.
If the flag has been set, you can unset it using chattr:
chattr -i /path/to/file

And then try using chown to change ownership. Other than that, I'm not sure!

JasonHippy 739 Practically a Master Poster

As the old xkcd comic says: "sudo make me a sandwich"

The files you listed are all owned by root. So you'll need root privileges in order to change the ownership of the files.

Depending on which distro you have installed, either use 'sudo' at the start of the command, or switch to the root user using 'su root' to get root privileges and then run the chown command.

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

OK well, ignoring all of the usual niggly things in the code... Like the fact that main should return int and not void. And the fact that it makes programs much easier to understand if you have meaningful names for variables. etc etc. ad nauseum.

The most obvious logical error that I can see, which would be most problematic is the break condition for the for loop at line 23 of your program.

You are iterating backwards through your array of characters from c-1 to 0, therefore the break condition should be c>=0 not c<0. Using c<0 as the break condition would cause the for loop to exit immediately.

Once this is fixed, you'll see output after entering your number. But you will get no output if you enter 0 as the decimal number! I'll leave you to fix that!

JasonHippy 739 Practically a Master Poster

I had a problem a few days ago whilst messing around with JACK (Jack Audio Connection Kit), trying to set up a recording session with Ardour on my machine running Kubuntu 14.04 (which like Manjaro, uses KDE as its desktop environment ).

Somehow something went screwy and suddenly sound stopped working altogether. After looking in the KDE system settings, all of my sound was being routed through a virtual sound device. And for whatever reason the soundcard was listed, but was completely disabled and I couldn't find a way to re-enable it. Logging out and logging back in again didn't help. Neither did rebooting.

In the end I fixed the problem by restarting alsa using the command:
sudo alsa force-reload
That did the trick for me! All alsa related drivers/processes were restarted and the audio was correctly routed through the sound-card again.

Not sure if your problem is related to mine, but that might help!

Otherwise, as the others have said, it could be that a channel has been muted in the mixer. So either open alsamixer and check the levels for the various channels, or install and use something like pavucontrol, which is used to control pulse audio related settings (in case pulseaudio is the problem!)

JasonHippy 739 Practically a Master Poster

I listen to a lot of very different music, depending on my activity and my mood. Everything from classical, to blues/jazz/avante-garde, to pop, to hip-hop/electronica, to classic rock/metal/punk, right up to full-on extreme-metal and industrial/noise.

Artists I listen to a lot, off the top of my head:
Tool, Rush, AC/DC, Frank Zappa, Jimi Hendrix, Clutch, Alice In Chains, anything involving John Zorn, Cranes, Laibach, Front Line Assembly, Godflesh, Meshuggah, Napalm Death, Cynic, Melvins, Neurosis, Crass, Chu Ishikawa, Ozomatli, Seasick Steve, Johnny Cash, John Lee Hooker, Louis Armstrong, Nick Cave and the Bad Seeds, James Brown, Jack Johnson, Norah Jones... Hell, I could list bands/artists for hours. I listen to tons!

JasonHippy 739 Practically a Master Poster

Going back to the OPs post:

With ordinary variables, you have direct access to the value held by the variable, there is no need to dereference using the * operator.

Whereas as Schol-R-Lea explained, pointers do not hold values, they hold the memory address of the value they point to. In order to access the value pointed to by a pointer, you need to dereference the pointer using the * operator.

Going back to arrays, and putting my previous post into context.
In order to dereference an element in an array, it is most common to use square brackets:
int val = someArray[idx];

But because arrays are technically pointers, you can also use the dereference operator and pointer arithmetic:
int val = *(someArray+idx);

Both are valid. But for clarity, most people use square brackets to dereference values in arrays.

JasonHippy 739 Practically a Master Poster

Great post Schol-R-LEA, but I have one very minor correction:

An array is not a pointer; it is a regular variable, just one which names a block of values rather than a single value

Actually, an array is implicitly a pointer, it can be considered to be a pointer to the first element (element 0) of the block of memory reserved for the array. So if you have an array of integers, the array variable is also implicitly an int pointer.

To demonstrate the point here's a simple, yet completely impractical and contrived example:

#include <stdio.h>

/* Initialise an array of ints with a set value
 * \param <ptr> pointer to first element
 * \param <size> size of array
 * \param <val> value to initialise array with
 */
void initialiseArray(int *ptr, int size, int val)
{
    int count;
    for(count=0;count<size;++count)
    {
        *ptr = val;
        ++ptr;
    }
}

/* Modify the value held by an int pointer
 * \param <ptr> pointer to value
 * \param <val> new value
 */
void modifyValue(int *ptr, int val)
{
    *ptr = val;
}

int main()
{
    const int size = 5;
    int iArray[size];
    int count;

    /* initialise all elements of the array with the value 999
     * Note: passing the array variable, because it is implicitly an int pointer */
    initialiseArray(iArray, size, 999);

    /* This will let us pass the first element of the array to the modify function */
    modifyValue(iArray, 25);

    /* In order to pass a specific element to the modify …
JasonHippy 739 Practically a Master Poster

Not by choice, no! At home I've been using Linux exclusively for a good number of years now and I don't see myself ever switching to a non POSIX/non unix-like system.

At work, where I have to use Windows and I get no say in that; I do exactly what Mike mentioned. I install Cygwin with X11, dwm and all of my favourite tools and programming languages/libraries. Makes my day to day Windows experience a little more unix-like.

Cygwin is a far superior terminal environment to cmd or powershell IMO. Powershell seems like a half-arsed attempt at creating a unix-like terminal/shell. And cmd is pretty much useless in comparison to both. After using the Linux command-line as much as I do, using the Windows equivalents just irritates/frustrates me beyond belief. On Windows, Cygwin is a must-have. With Cygwin, I have a much better toolset to help me to do my job!

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

@Froweey:
os.startfile is Windows only. It doesn't exist for Unix/Linux based OSes.

To use a specific program to open a file on Unix/Linux, then you would need to use Pythons subprocess module as per snippsats previous post!

JasonHippy 739 Practically a Master Poster

The easiest way would be to install a python game/media library like pygame, pyglet or pySFML and use that to play your mp3. There are plenty of other media libraries with python language bindings.

Search your Linux distros package lists for one of the above python modules, or you could install pip (the python2.x package manager) or pip3 (for python3) and use that to install the appropriate library instead.

The exact installation instructions will depend on which Linux distribution you have installed.

There are some examples using various python media libraries here:
http://guzalexander.com/2012/08/17/playing-a-sound-with-python.html

pyglet looks like it will require the least code!

JasonHippy 739 Practically a Master Poster

Nice find. Never heard of that one before! Will check it out at some point. Not done a lot of ruby programming. Would be a great excuse to give it another go!

JasonHippy 739 Practically a Master Poster

What do you mean you "cannot execute it separately"??

I understand you have added a module consisting of some .cc and .h files to an existing project. But exactly what are you having problems with?

Are you having problems compiling? Or are you having problems actually using the functionality you have added? Can you provide any more information? I don't fully understand the nature of your problem.

EDIT:
After a bit of duckduckgo-fu, I assume that the ns2.34 you are talking about is the network simulator... Can't say I am familiar with it, but if you explain your problem more clearly, I, or somebody else here may be able to help you.

Also, a bit more duckduckgo-fu yielded this: Click here - A blog post from 2010, written by somebody who has created their own module for ns2.34.

There is a white-paper and source code available in the post. You could perhaps take a look at their code and see how the implementation of their module differs from yours.

Looking at the code available on that page, it looks like adding a module to ns2.34 involves adding your cc/h files to the source tree of ns2.34; modifying the ns2.34 makefiles to include your module; re-building ns2.34 and finally writing a tcl script that you can run in ns2.34 to test your module.

Hopefully some of that helps. Otherwise, post again with more information.

JasonHippy 739 Practically a Master Poster

Are you sure you entered the entire line correctly?
Here it is again - pasted directly from my .vimrc file:
map <F4> :e %:p:s,.h$,.X123X,:s,.cpp$,.h,:s,.X123X$,.cpp,<CR>

Try copy/pasting the entire line into your .vimrc. It should all go into a single line.

As long as you have it exactly as it is above; it should work.... Works for me at least! :/

I've been using this mapping with vim on several different systems, for a number of years with no problems so far!

With a .cpp file open in vim, pressing F4 should cause vim to open its corresponding header. F4 again should take you back to the cpp file.

The F3 key-bind at line 13 (open file under cursor) is a bit twitchy sometimes. Unless the file path is absolute, it depends on the path to the file that you are trying to open and vims current working directory. But I've never had a problem with my F4 keybind.

JasonHippy 739 Practically a Master Poster

Also there is pyQT - The python bindings for the QT GUI library.

JasonHippy 739 Practically a Master Poster

Take a look at this. Should tell you all you need to know know:
http://cinnamon.linuxmint.com/?p=144

As for the clock, I have no idea. Could it be conky, with a custom theme? Can you post a link to the image you saw it in? Might yield more clues!

JasonHippy 739 Practically a Master Poster

Aha, just fired up a plasma session. My method does work, it just depends on how you close the terminal. I knew I wasn't going crazy!

If you close the konsole session with the close button on the window, or if you force kill the konsole process, both the dolphin and konsole windows will close.

But if you use ctrl-d or type exit to end konsole, then konsole will close, but dolphin will remain open until you close it.

I get the same results with terminator, uxterm and the other terminals I've tried.
I guess when you use exit or ctrl-d, the terminal window will close, but it waits in the background for its child processes to terminate before closing down fully?? IDK?!

When using dwm, I always use ctrl-d to close my terminal sessions!
If I close the terminal using the close window shortcut (super + alt + c), which is equivalent to pressing the x in the top corner (but there are no close, minimise or maximise buttons in dwm - hence the keyboard shortcut!) I've just discovered that the terminal and the file-manager will close. Which fits the pattern I've already seen in plasma!

JasonHippy 739 Practically a Master Poster

Oh right! :/ works for me on my kde system, but I use terminator instead of konsole. I also use dwm as my DE/WM, instead of plasma... Perhaps this only works with my specific setup. :/

Screen or another terminal multiplexer, like tmux are more elegant solutions.

JasonHippy 739 Practically a Master Poster

Another way would just be to run the file manager in the background like this:
name-of-file-manager ./ &> /dev/null &
Substitute name-of-file-manager for your file-manager of choice (nautilus, dolphin, thunar etc etc.)

With the file manager running in the background, the terminal should still be reponsive. If you close the terminal down the file-manager should still remain running onscreen until you close it.

NOTE: The & at the end of the line makes the command run in the background. The &> redirects all stdout/stderr output to /dev/null to prevent the terminal getting flooded with output from the file manager (error messages/warnings from the GUI library etc.)

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

It is true that you can get vim to to this, but you will have to learn a lot of commands by heart.

True, but it is worth learning to use some of the commands in Vim (and Emacs for that matter) as they can really boost your productivity once you know what you are doing with them. It is surprising how functionality they contain.

Personally, I found Vim a lot easier to learn than Emacs. Emacs has tons of esoteric keyboard shortcuts and named commands that take ages to memorise - I still have problems remembering Emacs shortcuts and commands from time to time. Plus there's the risk of RSI from contorting your hand to hit some of the keybinds, heh heh! Viper mode helps in Emacs - allows you to use Vi/Vim keybinds and commands in Emacs, heh heh!

Not wanting to start a holy war here or anything, but I find Vim much more intuitive to use. And that's just my opinion/experience, no offence intended to followers of the church of Emacs!

Nano is great for simple text editing tasks and is extremely lightweight, but if you want more advanced functionality/capabilities that is where Vim and Emacs excel!

I am currently using vim but I keep forgetting to go to insert mode when I open it.

Ha! After all these years using Vim, I still forget to do that sometimes.
Doesn't really bother me though!

JasonHippy 739 Practically a Master Poster

But sublime isn't a command-line based text editor is it?

Edit: Nevermind, just looked it up, sublime can run in the terminal or in a window.... Didn't know that!

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

I have a copy of 'version control with git' too. I also have 'pragmatic version control using git' by Travis Swicegood.

Both are extremely good references for learning to use git.

I like both books but IMHO, the 'pragmatic....' book is written in a more beginner friendly way. So you might get on better with the pragmatic book, it's almost certainly worth a look. Both books cover pretty much identical material. The Loeliger/McCullough book just presents things slightly differently!

EDIT: The book recommended by Mike(above) is also really good! I downloaded the ebook version of it a while ago. Forgot I had that one!

JasonHippy 739 Practically a Master Poster

Off the top of my head, a couple of obvious things to check are:

  1. Is the script executable?
    I don't know how much you know about the Linux terminal commands, so apologies if you already know this; but you can determine whether the file is executable using ls:
    ls -l ./install.sh
    Check the permissions in the listing to see if the executable (x) flag is set.
    If it is not set, you can use chmod to make the file executable:
    chmod +x ./install.sh

  2. Were you running the install script as root?
    If you ran the installer as a normal/unprivileged user, that would cause problems!
    Try using sudo ./install.sh to run the script as root.

NOTE: I'm not familiar with Manjaro. I know it's based on Arch, but I don't know what software is installed by default on Manjaro. If sudo is not installed, then use whatever mechanism is in place to allow you escalate your privileges to root (su?).

If none of these suggestions are of any help, please post again listing the exact errors output by your attempts to run the script.

JasonHippy 739 Practically a Master Poster

You could also create a singleton class to deal with storage and management of all of the textures for your game.

The singleton should load a single copy of each texture used in the game. Either by loading all textures for the entire game at startup, or do it on a per level basis and load all textures used in the level at the start of each level. Then for your game objects you can simply get pointers to the textures you want to use, as all of the textures will already be available in memory.

That way if you want to create one rock or a hundred, you can use the same texture for all of them. That should remove a lot of unecessary overhead!

JasonHippy 739 Practically a Master Poster

After cleaning up your code by removing commented out code, extra whitespace and the redundant checks against hep in the if statements inside your switch statement, we are left with this:
(NOTE: This is just what the code you posted above boils down to logically - I haven't fixed anything. This is just your code!):

if(item.type==ITEM_MISC && item.mesh && Dist(test_pos, item.mesh->box*item.matrixScaled())<=ctrl.radius()+0.1f)
{
        int hep=0;

        switch(hep)
        {
        case 0:
                if ( item.name=="barrel" ) // no need for && hep == 0, we already know it is 0. We wouldn't be here otherwise!
                        ++hep;
                AddMessage(S+"000er"+ hep);
                break;
        case 1:
                if ( item.name=="biggun" )
                        ++hep;
                AddMessage(S+"111111er"+ hep);
                break;
        case 2:
                if ( item.name=="Spirit" )
                        ++hep;
                AddMessage(S+"333333er"+hep);
                itemPickUp(*item);
                break;
        }
}

The only thing that is ever going to be executed in that block is the first bit under case 0 of the switch. Take a look at the logic of what is going on in the code:
1. Assuming that we pass the conditions of the initial if statement, we enter the block of code under the if statement and create an int variable called hep and initialise it to 0.
2. We enter the switch statement. hep is 0, therefore the code under case 0 is executed.
3. If item.name is "barrel", hep is incremented
4. Message is written out regardless of the item name
5. We hit the break statement, so we are taken to the closing brace of the switch statement;
6. …

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

As a native resident of the UK, I think floods and high-winds are about the worst of it. I live in Somerset, very near the levels which were badly affected by flooding earlier in the year. Luckily where I live we've been spared from any flooding so far. But I don't know how long that will last. Flooding is an issue that is very close to home, as it were! :/

And I'm with Agilemind on the snow thing, heh heh. I really don't get why there is such panic in the media here in the UK whenever there is a light dusting of snow. And it's not just reserved for snow, the media also seem to try to induce panic when there's going to be high winds or heavy rain too. :/

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

What's your question?

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

Can you post a link to the original video? That might yield further clues!

It's definitely not one of the major distros (unless it has simply been heavily modified). And I agree with Mike the bottom bar definitely hints that the desktop could be Kde or lxde based. The dock on the left could be any of a number of dock apps/widgets.

Just from that one screenshot, it is really hard to tell what distro is installed on that machine!

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