669 Posted Topics
Re: This should work: def texten(): filehandle=open ( 'savetonight.txt', 'r' ) text=filehandle.read() return text def smabokstavertext(): text = texten() print text.lower() Basically, where you were calling texten, you need to create a variable to store the returned value. So inside your texten function a local variable called 'text' is created, populated … | |
Re: Take a look at my reply in the thread you posted in the Linux/unix forum: http://www.daniweb.com/hardware-and-software/linux-and-unix/threads/434063/python3-linux-directory There are instructions at the end of the post that should allow you to setup geany to use python3 instead of python2. | |
Re: Another way is to open up a command line and use the which command. The which command will tell you the path of an executable. So if you want to find out which python3 executable is being used you would simply use: `which python3`. This will output the path to … | |
Re: AFAIK zlib support should be built into Python. So I think it's most likely that you just need to install the zlib libraries/.so's onto your system. Just open your package manager and search for zlib and then install the appropriate files. Although, from seeing some of your previous posts; I … | |
Re: OK, it's been a while since I took a look at Unity, so my memory of it is a little hazy. But at a guess, you might want to check that the keyboard shortcut to lock the screen hasn't been changed or disabled somehow. If you go to System settings->Keyboard->Shortcuts, … | |
Re: Actually, the problem is that iostream is a c++ header file. Also namespaces are a c++ thing. If you are using GCC for C, then you need to #include <stdio.h> for scanf. If you are trying to compile C++, you need to use g++ not GCC. You might also want … | |
Re: If you are using a version of Visual Studio, you could just pass the `__FUNCTION__` macro into your logging function. e.g. `_log.debug("message", __FUNCTION__);` The function macro will pass the name of the current function as a string. see: http://msdn.microsoft.com/en-us/library/b0084kay%28v=vs.80%29.aspx I think the `__FUNCTION__` macro is also defined in gcc, so … | |
Re: As the code stands, the two literal values in the calculation are implicitly treated as doubles. Have you tried changing c to a double, or you can change the literals to floats by putting an f at the end of each e.g. 4.0f - 1.99999990f. Those are about the only … | |
Re: Continue is a reserved keyword in C and C++, so give your char array a different name. | |
Re: With std::vector, you can do either! If you know what the vector should contain when your class is instantiated, you can initialise the vector with whatever it needs to contain in your class constructor. Or if you know how many elements it will need to contain, you could initialise it … | |
Re: I haven't used Mint in a long while, so I don't know the exact name for this package. But try running the following command and see what results it lists: `apt-cache search libglib` The libglib package usually has the version number appended after it, so see what the above command … | |
Re: OK, a couple of things: Firstly you've posted in the wrong forum. This is C code, not C++! (Not the end of the world, but FYI!) Secondly, well done for using the code tags feature (most noobs forget this), but please remember to correctly indent your code in future as … | |
Re: OK, so you've forward declared the classes in the header files. And I could be wrong, but from what I've seen; you haven't included the header files for the forward declared classes in the corresponding .cpp files. Which is most likely why you're getting the error messages you've reported. So … | |
Re: @OP: The page you posted lists folders with all of the available versions of CentOS. Assuming you want to use the latest version, open the link for '6.3'. Then open the 'isos' link/folder. From here you'll have two choices, 'i386' or 'x86_64'. Depending on your systems architecture, open the appropriate … | |
![]() | Re: I have an old RM Tablet PC (which uses a Wacom tablet/screen) at home which is currently running Ubuntu 9.04 on it with no problems. The stylus works fine for the usual mouse-like activities (e.g. navigating the file-system and for drawing in gimp, blender and Inkscape etc.) Regarding handwriting to … |
Re: At the end of the day, Linux desktop environments are a very subjective topic. You could ask ten different Linux users and get ten completely different answers. Everybody has their own preference, but there isn't necessarily a 'best' desktop environment per-se. It's more a case of finding the one that … | |
Re: Currently reliving my youth, listening to some classic UK Thrash (Slammer, Toranaga and Acid Reign) and some old UK Anarcho/Punk stuff (Crass, Conflict, Discharge, Disorder, Chaos UK, Exploited, MTA and Toy Dolls) :P Aaah nostalgia! | |
Re: Wow, that is truly a mess! Here are some of the problems I've spotted from an initial look (after pasting into a text editor and auto-indenting the code): 1. Your class and functions have all been declared and defined inside main. I recommend that you take the class definition and … | |
Re: The page you've gone into there has a bunch of bit-torrent files. You can download the torrent files and then open them with a torrent program like Transmission, which will then allow you to download the dvd images from other users who have seeded the files on their PC's. If … | |
Re: Well, if you are unsure about whether it will work or not, you could just try a live cd. If you have a spare 8gb USB stick knocking about and you wanted to test more thoroughly you could even install a live cd image with persistent storage onto the USB … | |
Re: The link you mentioned seeing on the desktop is the installer for backtrack! Double clicking on it will run the installer. | |
Re: Sounds like you're missing the glu package (libglu1-mesa-dev). A quick 'sudo apt-get libglu1-mesa-dev' should solve that problem for you! :) | |
Re: I don't know about Seamonkey extensions, but there is a Firefox extension called ChmFox which can be used to view chm files (Not sure if that's compatible with Seamonkey though). There are also several standalone programs which can be used to view chm files in Linux. xchm is a chm … | |
Re: They aren't ASCII characters, they're Unicode. See [this!](http://en.wikipedia.org/wiki/Chess_symbols_in_Unicode) . | |
Re: I could be wrong, but I think you just need to open up /etc/network/interfaces (or create it if it doesn't exist) and add the following lines: auto eth0 iface eth0 inet dhcp | |
Re: Vern, from what I can gather from the little portuguese I know, it's kinda like a substitution cypher where the letters T E N I S are substituted for P O L A R and vice versa. Incidentally, tenis is portuguese for shoes! So the sentence "A polar bear wearing … | |
Re: Which will be your problem. You have two sets of definitions for those variables. Remove the declarations from main and include globals.h in main and any other files which need to use the globals. And don't forget to set up some inclusion guards in globals.h if you haven't already. And … | |
Re: Not sure if it's any help, but I had a similar problem with my old tablet pc. Turned out that the main speakers and the headphones were on different channels. I eventually realised when I took a look at the user options/settings for the mixer and found (and enabled) a … | |
Re: Ubuntu is based on Debian, so other than the UI (No Unity or Gnome 3 in Debian. Debian 6 uses Gnome 2.6) there aren't really many differences. The main differences are: 1. By default, Debian tends to use slightly older, better tested packages. Which pretty much assures a stable and … | |
Re: With the ls command, the 'l' flag uses a longer listing format, 't' sorts by modification time and 'r' reverses the order of the sort. To list folders recursively you'd need to use the 'R' flag! Remember man pages are your friend. To see all of the available options for … | |
Re: You can't return null unless you are returning a pointer from a function. But if you don't want to use pointers there are a couple of options. You could do something like this: Contact getContact(){ Contact c; // initialise c to some default state which indicates it's uninitialised // do … | |
Re: Can you post the code in question? It may help to shed some more light on the problems you're having! | |
Re: In short, the private members of your base class should be declared as protected rather than private if you want derived objects to be able to access them directly. | |
Re: Well, take a look at what you're doing there: bot.y = player.y - bot.y So if the player is at y=0 and the bot is at y=4: The bot would be moved to y=-4. So the bot jumps suddenly from a y-pos of 4, to a y-pos of -4. Lets … | |
Re: When you initially declare your array, this is ok: `GLfloat Light_Position[]= {0.0f, 1.0f, 3.5f, 1.0f};` That will create an array and initialise it with the specified values at declaration. But later in your program where you do this: `light_Position[]={tVector3.x,tVector3.y,tVector3.z, 1.0f};` Depending on which version of the C++ standard you are … | |
Re: From what I can see, any compiler should compile the code, but most should issue a warning about the pointer being uninitialised. As far as I understand things: With most compilers, when you declare a pointer and you don't initialise it to point to anything; it will point to an … | |
Re: Take a closer look at your code. The problem is occurring because you need to input the year **before** doing any of your calculations. As your code stands, the value of EasterDay is being calculated before the user has even input the year. So the uninitialised year variable is used … | |
Re: ls and rm are a couple of command-line/system programs in Unix and Linux operating systems, they aren't regular expressions. `ls` is used to list the files/directories in the current directory and `rm` is used to remove/delete files. As stated, `ls -l` lists the files/folders in the current directory. The l … | |
Re: 01001010 01110101 01110011 01110100 00100000 01100001 00100000 01110100 01101000 01101111 01110101 01100111 01101000 01110100 00101100 00100000 01110111 01101111 01110101 01101100 01100100 00100000 01101001 01110100 00100000 01100010 01100101 00100000 01110111 01101001 01110011 01100101 00100000 01110100 01101111 00100000 01110000 01101111 01110011 01110100 00100000 01101111 01100011 01110100 01100001 01101100 00100000 01101111 01110010 00100000 … | |
Re: In your .cpp file you are redefining the Circle class, which was already defined in the header. This would certainly cause a linker error. Remove the entire class statement from your cpp file (lines 7-24 in your 2nd snippet) and you should be good to go. | |
Re: Because you're passing rect by value into the area function, a copy of the Rectangle object is created inside the function using the default copy constructor (which will be automatically created by the compiler as you haven't created a copy constructor). The first call to the Rectangle destructor occurs when … | |
Re: [QUOTE=;][/QUOTE] In my experience most companies just want somebody who can do the job. Personal appearance isn't always that big a factor. However, at the same time attitudes towards personal appearance can vary wildly from company to company, it can also vary depending on the nature of the position you … | |
Re: For future reference, please post your code here on the forum rather than on a 3rd party site. And please don't forget to use code tags! For everybody elses benefit, here's the OP's code: [CODE] #include <iostream> #include <string> #include <time.h> using namespace std; const int MAX_SIZE = 100; string … | |
Re: [QUOTE=;][/QUOTE] A variable preceded by an asterisk * is a pointer. The asterisk is called the indirection operator and is used to dereference pointers. As it's name suggests a pointer is a variable which points to a variable of a specific type. So all a pointer holds is the memory … | |
Re: [QUOTE=FraMazz;1673540]Isn't it sufficient to remove CentOS partition and to resize Win 7 one with Win 7 Disk Management tool?[/QUOTE] No, because CentOS (and other Linux distros) replace the windows MBR/bootloader with an alternative bootloader like Grub or Grub2. So simply removing the CentOS partition and resizing the Windows 7 partition … | |
Re: Personally I use [ICODE]sudo[/ICODE] on the command line for most administrative tasks on my Debian/Ubuntu based installs. Except if I have a lot to do, in which case I'll switch to root using [ICODE]sudo su[/ICODE]. You can open a root terminal using the command [ICODE]gksudo gnome-terminal[/ICODE] In older versions of … | |
Re: I have heard that it is possible to set up a cross-compiler environment which will allow you to build executables for other platforms from within Linux, but I've never looked into it. The few cross-platform apps I've worked on have been done as per Rubbermans post. e.g. Using cross-platform libraries … | |
Re: As far as I'm aware libxerces is the same as pretty much any other library in Debian based systems. It should be available in the repositories (the exact version will depend on which version of Ubuntu you're running). You can use apt-get to install the packages for the library and … | |
Re: Ubuntu, Mint, Debian, Opensuse and Fedora tend to be quite popular choices of distro, but I don't think there is any such thing as 'one true distro'. Peoples views are different about Gnu/Linux and it's many different flavours. What one person prefers, another may detest! The other thing to remember … | |
|
The End.