Welcome To TheGodOf.net Keep posted, we'll have something on here soon

 

 

-----------------------------------------------------------------------------

cin in C++ doesn't seem to work?...: Mon 16 Mar 09

-----------------------------------------------------------------------------

had a code that seems to be running in a loop or sometimes skip 1 cycle, all the logics seems fine, got pissed off at that... finally thanks to the dudes @ freenode #c++, i got an answer. The code in question was:

 

buf=65; /*is an int*/
input='A'; /*is a char*/


while(buf!=-1 && buf>=65)
{
     printf("\nValue input in int=%i in char=%c @ %c ", input, input, nodes[j].value);
     cin>>input; //<--- WTF, sometimes it takes in input sometimes it doesn't and set the value to 49 !!!
     printf("\nValue inputin int =%i in char=%c @ %c ", input, input, nodes[j].value);
     if(input>-1)
         input=toupper(input);
     buf=int(input);

     printf("\nValue buf=%i @ %c ", buf, nodes[j].value);
     if(buf!=-1 && buf>=65)
    {
        input=char(buf);
        input=toupper(input);
        currentNode=&nodes[j];

        while(currentNode->next!=NULL)
        {
              currentNode=currentNode->next;
        }
       currentNode->next=new node;
       currentNode=currentNode->next;
       currentNode->value=input;
       currentNode->next=NULL;

    }

}

 

 

 

 As you can see from the code, everything should work fine :p, but here in lies the problem..., notice the -1, I have said in the while loop to stop when buf =-1 or less than 65. The thing is, I am taking input as char [notice cin>>input. But when i do my input, I am sometimes typing '-1' to stop a loop, which is wrong, because, actually -1 is two characters and not 1 characters. Secondly, 49 is the ascii representation of 1! So you guess now what was wrong :p, i just changed the stopping condition to stop when i enter zero instead, since when you enter -1, the loop will stop twice [once for - and once for 1). Till then bye bye and good luck . Hope this helps .

-----------------------------------------------------------------------------

libXss.so.1, Klibrary...: Sun 07 Jan 07

-----------------------------------------------------------------------------

I have been playing a bit too much with my ports lately on my freebsd6.0 box, after a port upgrade.. i broke a few things when i did some fresh installations.. (i forced some installs and pkg_deleted a few stuffs), broke the system, anyway for those who might be encountering errors such a their windows manager not loading (kde and gnome) or errors such as 

Warning: Klibrary: undefined symbol init_kdnssd

or errors which mention a missing libXss.so.1

or programs being compiled and complains about a missing scrnsaver.h (from libXext)

Anywayz.. i tried a lot of things.. googled etc.. no real solutions came out until I adventured a bit into my ports directory and by instinct found xorg-libraries(reinstall almost every other libraries.. didn't notice thing one), anywayz here's the fix:

root@localhost# cd /usr/ports/x11/xorg-libraries/

#edit the Makefile there to add the  line at the top of  the file

FORCE_PKG_REGISTER=yes

this will force this package to be er registerred in case it was already there before.

then

root@localhost#make && make install && make clean

during the installation it might say that some packages conflicts with it and you should use pkg_delete to remove em., I've facilitated your life by providing a small script to automate the pkg_delete for you, let's call the file "pakdel"

#!/bin/sh

pkg_delete -f libGL-1.0_1
pkg_delete -f libGLU-1.0_1
pkg_delete -f libICE-6.3.3
pkd_delete -f libSM-6.0.3
pkg_delete -f libX11-6.2.1_3
pkg_delete -f libXau-0.1.1_1
pkg_delete -f libXaw-7.0.2
pkg_delete -f libXcursor-1.1.2_3
pkg_delete -f libXdmcp-0.1.3
pkg_delete -f libXext-6.4.3
pkg_delete -f libXfont-1.4.2
pkg_delete -f libXi-6.0.1_2
pkg_delete -f libXinerama-1.0.2
pkg_delete -f libXmu-6.2.3
pkg_delete -f libXp-6.0
pkg_delete -f libXpm-3.5.1_1
pkg_delete -f libXrandr-1.0.2_1
pkg_delete -f libXrender-0.8.4_3
pkg_delete -f libXres-1.0.1_4
pkg_delete -f libXt-0.1.5
pkg_delete -f libXv-2.2.2
pkg_delete -f libXxf86-1.0
pkg_delete -f libxkbfile-1.0
pkg_delete -f panoramixext-1.1
pkg_delete -f printext-1.0
pkg_delete -f randrext-1.0
pkg_delete -f renderext-0.8_3
pkg_delete -f resourceext-1.0_1
pkg_delete -f xextensions-1.0.1_2
pkg_delete -f xf86ext-1.0
pkg_delete -f xproto-6.6.2
pkg_delete -f libSM-6.0.3

anyways then we do

root@localhost#sh /where/i/have/kept/pakdelfile/pakdel

root@localhost#make && make install && make clean

 That should do the trick.. good luck

 


-----------------------------------------------------------------------------

Nice value: Fri 05 Jan 07

-----------------------------------------------------------------------------

Happy new year 2007, anywayz, I woke up curious today, wanted to know what is a nice value, a nice value is used in the calculation of priority of a process, yes DO NOT confuse with priority, try doing a ps -el on your linux/BSD machine you'll get something as:

  UID   PID  PPID   CPU  PRI  NI   VSZ    RSS   MWCHAN STAT  TT       TIME       COMMAND
 1001   650   649     0    8     0     1324  1184  wait         SLs     p0        0:00.01   zsh
 1001   664   650     0    76   0     3764  3056  select       SL+    p0        0:02.53   ssh -v -C
 1001  1113  1112   0    8      0    1332  1192  wait         SLs     p1        0:00.03   zsh

tsf

NI that you see represents the nice values, anywayz, for System V nice values have the range of 0 up to 39, BUT in BSD it ranges from -20 to 19, Linux uses the BSD style, hence it also has a range of -20 to 19 for its nice value. The middle value is the default on a linux/BSD system, i.e 0 is the default.

Note that the higher nice value you have the lower priorty you have, similarly the lowest nice value you have the higher priority you have.

Who can change the nice value? Ofcourse root :p

How to launch a program specifying its nice value?

nice -8 top

The above command will start the top command with the start nice value minus 8 (if the start nice value was supposed to be 10 by default, then the new nice value will be 2)

How to modify the nice value of an existing process? Use renice,

renice -n 10 -p 1056

in the above command, we are increasing the nice value of process with id 1056, we are decreasing its priority.. since we are increasing its nice value :p

 

-----------------------------------------------------------------------------

IIS install: Fri 05 Jan 07

-----------------------------------------------------------------------------

Some friends we having some trouble installing IIS, I decided to write a small tutorial to help them installing it.. (its pretty basic)
click here to have a look

-----------------------------------------------------------------------------

My first LUGM Presentation: Fri 05 Jan 07

-----------------------------------------------------------------------------

I once did a presentation at the linux user group of mauritius on Sat 2 sept 2005

here's a quoted message on the linux.mu website

Saturday 2 September 2005 Meeting Announcement

There will be a LUGM meeting on this Saturday 2nd of September 2006 at the LinkByNet office in the A1 building at Vacoas. The time is set from 10 00 AM to noon. The technical presentation will be done by PC THE GREAT (aka Selven) and aimed at visual tweaks in general.

Please confirm your presence via the mailling list, or otherwise. Note that no committee meeting will be held but it would be convenient for all the members to attend.

Moreover, the library will be in session; members wishing to borrow books can do so by informing the librarian Ajay Ramjatan (via the mailing list) of their book choices for Saturday. A list of books is available here.
As usual, the public is invited.

 

A copy of this presentation can be found here 

ps. a presentation is.. stressful, you never know what type of question you might get!

-----------------------------------------------------------------------------

Using double buffering with OpenGL: Sat 23 Sept 06

-----------------------------------------------------------------------------

Was playing with openGL (glut) and visual C++ today, I first used glutBitmapCharacter(void *font, char x), at first single buffering, everything worked on fine without any problem, I then decide i would make some animations with it, I started using double buffering, GLUT_DOUBLE, surprised i was the GL window was blank, not even the dark background! Well anywayz.. i played a bit with it.. finally i found out that i hadn't swapbuffers in my function to renderscene.. i.e for the function to be used as parameter in glDisplayFunc(void renderscene) and glIdleFunc(void renderscene), anywayz, the bug was that i didn't swapbuffers in my renderscene.. that was a really foolish mistake.. lmao what's the use of having 2 buffers if I don't interchange em..lol  , fixed by adding glutSwapBuffers(); at the end of the renderscene

-----------------------------------------------------------------------------

sm-mta[420].... date: Thu 31 Aug 06

-----------------------------------------------------------------------------

Got this error this morning on my FreeBSD 6 box

sm-mta[420]: NOQUEUE: SYSERR(root): host "localhost" unknown: Invalid argument

It happenned after i changed my /etc/hosts

 

# $FreeBSD$
#
# Host Database
# This file should contain the addresses and aliases
# for local hosts that share this file.
# In the presence of the domain name service or NIS, this file may
# not be consulted at all; see /etc/nsswitch.conf for the resolution order.
#
#
::1 localhost localhost.my.domain myname.my.domain
127.0.0.1 localhost localhost.my.domain myname.my.domain

#
# Imaginary network.
#10.0.0.2 myname.my.domain myname
#10.0.0.3 myfriend.my.domain myfriend
#
# According to RFC 1918, you can use the following IP networks for
# private nets which will never be connected to the Internet:
#
# 10.0.0.0 - 10.255.255.255
# 172.16.0.0 - 172.31.255.255
# 192.168.0.0 - 192.168.255.255
#

 


I had changed the "127.0.0.1 localhost localhost.my.domain myname.my.domain " part, I played a bit with the domain name and localhost part..
Well anywayz.. i know its just a simple thing, but i just have started to post every thing i get on this website now so as newer users who will come can get the info they need in case they got this or that in their everyday life.

Anywayz fix the above by replacing it back to their original values.. here my original one is:
127.0.0.1 localhost localhost.my.domain myname.my.domain

-----------------------------------------------------------------------------

FreeBSD single user mode read only.. date: Sat 12 Aug 06

-----------------------------------------------------------------------------

Well this command comes in handy in such cases (try it out and you'll see what I mean):
mount -u / ; mount

-----------------------------------------------------------------------------

DATE comparison in vb - MS ACCESS date: Mon 1st May 06

-----------------------------------------------------------------------------

Well, am not particularly a fan of vb or microsoft products, anyways due to univ etc, i had to do a dbms in vb, i had to find a list of all dormant customers in a table, usually those accounts that have not been updated since last year, anyway, I had been using the following query:

strSQL = "SELECT * FROM Customers WHERE LastUpdate <= " & lastyear 

It was returning nothing, after lots of searching and searching I finally found that the correect way of doing it was:

strSQL = "SELECT * FROM Customers WHERE LastUpdate <= #" & lastyear & "#"

That is including # before and after, anybody mind explaining to me the why's?
because # is date delimiter in vb just like " and ' for string delimiter.-csyke
ps. just in case you are wondering what 'lastyear' is:
dim lastyear as date
lastyear = Format(Now, "short date")
lastyear = lastyear - 365


anywayz, thanks for visiting, and if you find anything interesting in those
ads, click em, it does help me.

Anywayz that was an update I thought that might be useful to many who may be having such problems.

-----------------------------------------------------------------------------

MoreTV problem [version 3.x] date: sun 12/06

-----------------------------------------------------------------------------

Affected OS: WinNT, Win2k, WinXP

The other day, I started having a problem with MoreTV, the screen was blue, though I still receive images, A complete blue screen, no images were being being displayed.

I thought the problem might be linked with me having changed my Video Overlay Colors, but it wasn't that. I tried to change back it didn't help.

Later I made some test and logging, and I found out that this may be linked to my virtual memory & registry size of virtual memory. You can change it by:

right clicking on "My Computer">Advanced>performance options> Click on Change>Change registry size to around 100mb, that should be more than enough.

After that you'll have to re register you channels, that is re-probe for the channel frequencies and re-add them. That should do the trick ;)

ps. don't forget to click on my ads

[μ]

Contact: Mail me if you want my email address
Site powered by FreeBSD