Category: How To

Windows 7: Solutions to can’t sleep problems.

by
Inf

win7-logo

Hello folks. Sorry for lack of recent posts. Been taken up with uni lately. Anyway, I have recently migrated to Windows 7. I have to say Microsoft has done a magnificent job this time, especially when I compare Win7 and Vista. Performance on Win7 is awesome. And there are lots of usability improvements, which makes 7 a very nice software.

However, I was having a problem: I couldn’t manually sleep my computer. If I did it from the Orb/Start menu, the screen would turn off, the PC would shut for like a millisecond, before starting back up, and prompting me for login.

Turns out there are a few things that can cause this error, and they are easy to troubleshoot. Try these steps if you are having the same problem as me.

1) Update your drivers.

This should be pretty obvious. An old driver might be causing an issue. So just update your drivers, specially for your video card and it should correct any problem. If it still doesn’t work, move on.

2) Try to see which requests are keeping the PC on.

Open a Command Prompt. You can do it by typing “cmd” from the Run menu, or simply open the Start Menu, and type “Command Prompt” in the “Search Programs and Files” bar.

Type this command: “powercfg -requests” without quotes. Then press Enter. You will see a list of programs that could be making requests. Windows Media Player is a usual culprit. Just close them, and it should work. If you have “None.” marked, move on.

3) A specific device is keeping the PC from sleeping

Still in the command prompt, type “powercfg -devicequery wake_armed”. You will see a list of devices that can wake up your PC. For me, I got my Network card, Keyboard and Mouse in that list. Turns out it was my mouse that was responsible for waking up the machine.

What to do? Simple: Go to device manager ( Start Menu – Control Panel (View by: Large Icons, top right)Β  – System – Device Manager (left sidebar) ). Find your device that you think is causing the problem. For me it was the mouse, but I had to try disabling each individually. So, find your mouse in that list, e.g. Mice and other pointing devices, right-click it, choose Properties and go to the Power Management tab. Uncheck the box “Allow this device to wake the computer“.

Validate the windows with Ok, close Control Panel, and you should be all ok. Try sleeping your computer now.

That’s it for this small guide. I hope it helps you. Step 3 solved my problem. My computer now sleeps when I want it to sleep. πŸ™‚

Installing GLUT on Dev C++

by
Inf

We are currently using the GLUT library at University in our Interface Design and Computer Graphics module. We were told to use Linux (Kubuntu) to write and compile our OpenGL/GLUT programs. But for ease of use, I wanted to install the GLUT library on Windows. I am a user of Dev C++ 4.9.9.2. I know it is no longer under active development, but it still remains my IDE of choice for C++ and C on Windows. And yes, I do know about Code::Blocks, so don’t flame me if I use Dev C++.

So here’s a guide if ever you want to install GLUT on Dev C++. Don’t worry, it’s easy.

Note, this guide is just about installing GLUT, not how to use it. I’ll probably have a small guide on that later on, but for now, this (and the Red Book) should get you started.

  • First, get Dev C++ if you don’t already have it. It’s available on bloodshed.net. Get version 4.9.9.2 (Beta).
  • Of course, install it. It’s pretty straightforward till now.
  • After installing it, go to Tools – Check for Updates/Packages.
  • In “Select Devpak server” dropdown menu, choose “devpaks.org Community Devpaks
  • Click on “Check for Updates“. Wait a bit while the list downloads.
  • In the list, find “glut“, or a compatible GLUT package like freeglut or OpenGLUT (if you know how to use these, else stick to “glut”).
    • You might want to filter the results using “OpenGL” from the “Groups” dropdown menu. Else, you might click on the “Update” title bar in the list to sort entries alphabetically.
  • Then, check the small box on the left of “glut” or other compatible glut libraries. Finalize by clicking the “Download Selected” button. Wait for the package to download and install.
  • You will be prompted for an installer window. Just read instructions and click Next a couple of times.
  • Now, check if glut was correctly installed by going to Tools – Package Manager. See if you can see “glut” or other compatible libraries (whatever you downloaded) there.

After you install glut, you can do “File – New Project – Multimedia tab” and see that glut has created templates for you. Quite complex things if you ask me. I tend to stay away from those if I can.

Now, before you use any library, you need to link it, else you will get loads of “Linker errors” and “Undefined reference” errors. Here’s how to link the libraries: (read the Dev C++ FAQ!)

9. How can i use the OpenGL library and others ?

All the libraries that comes with Mingw reside in the Lib directory. They are all named in the following way: lib*.a
To link a library with your project, just add in Project Options – Parameters tab – Linker box:
-lopengl32 (including the – symbol)
This is for including the libopengl32.a library. To add any other library, just follow the same syntax:
Type -l (L in lowercase) plus the base name of the library (filename without “lib” and the “.a” extension). Or you can use the “Add Library or Object” button in the parameters tab for simplicity.

I have these libraries linked: “-lglut32 -lglu32 -lopengl32 -lwinmm -lgdi32” and it works fine for me. You can try removing some of the parameters and see if it still works for you. NOTE: The order in which these parameters are supplied is actually important! If you are using a library, and having “undefined reference” errors, try shifting that library’s link parameter to the front of them all.

That’s if you want to use projects. If you are using plain source files, you can put those link parameters in Tools – Compiler Options. Then put them in the “Add these commands to the linker command line“. Make sure the box is checked too. I’d advise you to create a compiler profile just for OpenGL and glut with those parameters. Don’t mess with the “default compiler” profile. You can create one using the small green “+” button there.

There is usually linking information in the header files (.h files) or the Readme files of libraries you download on the Internet.

Basically, to install a library, you will have to copy some files (ending with .lib or .a) to the “lib” folder and some .h files to the “include” folder in Dev C++’s install folder.

Now, to actually use glut, you have to include the header file with:

#include <GL/glut.h>

To know the exact path where glut.h is found, look inside the “include” folder, again in Dev C++’s install folder.

That’s it. You should now be able to compile and run glut code on Windows using Dev C++. The guide should be clear enough. If there is demand for it, I’ll include pictures too, but I don’t think they are really needed.

By the way, I’m not a glut or OpenGL expert or anything. I’m just studying it, and thought I’d share how I managed to get glut running on Dev C++. I might not be able to answer all your questions, and for that, Google’s here!

How to Manage Projects?

by
Guru

With already a couples of failures in the past, we can just think to move forward with a dose of success. “Success”, this word seems glamourous. While some can easily achieve their objectives, others are able to do so in a much longer time period. But what is the difference between the two??? If you do not perceive things the same way as I do, then do so now. Everything that we do is a project. Agreed??? The only variation is its scale and priority. An assignment has a higher order priority and at times takes a larger scale as compared to nailing a piece of wood. Having the right tools and mindset to get things done is important.

 

To start with, dreaming is bad. Be completely down to earth. This will allow you to perform better, evaluate your progress and be able to take corrective measures. Now that I mentioned these key points, roll up your sleeves and get to some serious work.

The number of people working on a project can range from one to many; forming a team. Now that we have got our team, to start, we need a minimum level of commitment. Being committed to whatever we are doing will have a direct impact on the end-result. The more time, the more effort is put will give better results. Good results gives much better self satisfaction and improved skills.

Each team members must have a particular role. To name a few, president, vice-president, treasurer, public relationship officer and so on. Having said these particular posts you can guess that each team member’s action will pay-off with a better result. Right? We should not forget that each and every human are capable to do everything (taking asides handicapped – in fact they do better than us). Everyone ought to be a leader. Being able to take decision, announce new ways of proceeding and be able to think aloud.

Now that the basic structure and mindset of the team has been set, lets see what concerns the project. The whole backbone of a project lies in its objective. What is an objective? In simple terms, it is just what must be achieved. The objective should be crystal clear so that unnecessary jobs will not be done thus straying from the core tasks and losing precious resources. Alongside with our objectives we have something called “aims“. What is that? Let me explain using an example. I want to but a laptop. My objective is to but a laptop. To be able to do so, I need to work. That is an aim. Another aim could have been, I just need to steal 5 under wears of a certain celebrity to sell them. πŸ˜› I hope you can now make a difference and how important they are.

Communications is an important aspect. With easy access to internet, many projects are going towards the “online” trends. Like I am currently doing for “AgriMauritius”. To ease communications and interactivity, there are a certain tools that will help you. Here are a list that would help:

 

  • Scriblink is an online whiteboard. It can accommodate as much as 6 users online. It acts just like the traditional blackboard. Each participant can scribble, write and chat at the same time. InF and I have used it to helps us study. πŸ˜€ I believe this tools will also help you clarify some points in your projects. Other alternatives would be Netmeeting and Marratech.
  • Freemind is an open source software, It allows you to make a mind map. What is this? Simply, all your ideas will be presented in a “graphical” manner. This will make sharing ideas easier and neater.
  • Microsoft Live messenger or Skype can be used for the purpose of interacting with team members. An added benefit of skype would be it allows VOIP and addons as whiteboards can be added. Interesting?
  • Now is the most important part. Use Webcollab as usual another open source software. It is just a project management tool. Assign tasks and permissions to users. That is a bonus to project management. View?

Project management is a vast topic and this article has covered just the essential topics. I am not a pro, you see errors drop a word. Want to add something, comment it. I will be adding it.

 

As always comments appreciated. Find it helpful, stumble it. πŸ˜›

Thank You.