Paul.Esson 53 Junior Poster

No halm in trying mandrake, Just try to make it a very minimalistic install.. If you don't succseed you can always try another distro.

I think im with Aykon that slackware may be your best bet. But the real trick really is making certain you don't install to much, and not having more services running then needs be... I personly bleave SSH would be a great service to have running since you could use your current windows box for interfacing with the machine by putty(google it, easy to find) it might be more convenient then having to change machines all the time, Plus you can use your current web browser etc to search for stuff on running and configuring linux insted of installing one (dunno how well moden webbrowsers work on that processing power)..

So go minimal, and if you don't succseed, try another distro..

Definatly don't install Gnome or KDE, desktop enviroments.. Fluxbox, Blackbox, twm (exceedingly old :D), sawmill or window maker should all be great choices for window manages, ( I would suggest window maker... I have a soft spot, Its a clone on NextSTEP/OpenSTEP that mac os x is based on ).

Try installing firefox if you have enough room, It might run ok..

Paul.Esson 53 Junior Poster

I don't know if theres a way in java to get a count of the current treads, but you could implement a singleton patterns (only not restrict to a single instance and not returning a class but running a tread, I guess its not really a singleton pattern but its along the same lines) if theres too many treads wait

Singleton Pattern
Singleton Implementation

If you get it working faster please tell us what was making it slow, Be interesting to find out.. Good Luck

Dang 30 minute edit limit :P

Paul.Esson 53 Junior Poster

Just looked at the last post if its still the same
you can avoid making a string
URL newURL = new URL(text.substring(numFirst+9, numEnd));


also are you still running run() from the tread, Im just thinking running to many treads could be similar to running too many forks (forkbombing) it may make the JVM just die in the butt attempting to figure out who to give time, I have never seen what happens if you run alot of treads so im just making assumptions.

But i have a suspision that there is a strong possability that thats why its happing

Paul.Esson 53 Junior Poster

Don't use an emulator :) Install stage1 gentoo :) [Moderator's edit]

How will that help use NTFS ?

Paul.Esson 53 Junior Poster

All CPUs used in PCs (Intel, AMD, Cyrix, etc.; doesn't matter) are CISC-based, and although the newer generations of these CPUs incorporate RISC functions, they are not true RISC chips but CISC-RISC hybrids. True RISC-based CPUs architectures include the PowerPC, SPARC, and Alpha processors.

Don't forget that power saving butiful processor created by digital, the strongarm :)

The newer versions of Linux distros are, in general, too bloated to use on Pentium systems of that era, especially if you choose one of the default installation options. You definitely can run the new versions on such machines, but in order to get the most performance out of boxen that old you'll need to do a custom install in order to avoid installing resource-hungry components that you don't really need.

Avoiding installing Desktop Enviroments (KDE/GNOME) and if you wish to use X use a farly minimal window manager. Apache etc. should work well and a GUI isn't really needed. X does run fine on a 200mhz box ( Set a 133mhz up as an X-Terminal Last week :)) .

200Mhz is fine for a linux box really as long as you don't want all the bells and wistles.

Paul.Esson 53 Junior Poster

I have played around with, A little while ago, an app (a profiler) that checks how optermised your java code is (tells you a range of information on each object, Like memory, and cpu time etc..) something like this would be great for figuring out exactly what is taking alot of time to process..

I might even be worth making some code to calculate the time difference so you can find the time it takes to read the string and the time it takes to process that string etc..

Perhaps try the java interpreters profiler

java -prof ClassName

The best approch for strings is prolly using the same one over and over again, the garbage collection process and the object creation both take time

Too see howmuch your using garbage collection use

java  -verbose:gc ClassName

A nice list of free java profilers

Paul.Esson 53 Junior Poster

Apache is an exceedingly popular server, I would be exceedingly suprised if it wasn't already supplyed with your distrobution.

I would check out my distrabutions Package Management System, before attempting to compile from the source..

I think in suse you use Yast
gentoo you use emerge
ubuntu you use synaptic
debian apt-get

If you state what your distrabution is, someone will very likly know how to install apache on it.

Paul.Esson 53 Junior Poster

I have never done this, so I really don't know the deatils on it, but you can use XML for interopratability between java and C#. I Don't know how well this will work in javascript.

http://java.sun.com/developer/technicalArticles/xml/jaxrpcpatterns2/

If the javascript is running on the ASP page in question you could just use constants (as in javascript constants) that the ASP will change when the page is rendered.

So the ASP kinda programmes the javascript for you.

Paul.Esson 53 Junior Poster

Perhaps you could have a look at http://jetty.mortbay.com/jetty/index.html
or
java socks server http://jsocks.sourceforge.net/
perhaps
java network programing FAQ http://www.davidreilly.com/java/java_network_programming/

Paul.Esson 53 Junior Poster

Read the INSTALL that should be in the directory that you untared

You Prolly Install it as such

$./configure
$make
$sudo make install

Paul.Esson 53 Junior Poster

Damn I hate kde :)

anyway tutorials.

Good luck with it. Plus in all seriousness linux has no GOOD media players :)

Paul.Esson 53 Junior Poster

I doubt you will find much, since java really isn't the best for protocal work and most moden OS's have NAT anyway.. Your best bet would be do it yourself, since i really doubt you will find java NAT, though you might find a http proxy...

Paul.Esson 53 Junior Poster

Having said that Its a great distro for leaning about linux gentoo seems to be a tad bit complicated for some biginners (the install isn't really a nice introduction to linux) slackwares install is exceedingly simple yet allows you a little freedom, Distros like fedora core, suse etc. are very gui orientated, witch is ok if you just wish to use the operating system or are already familure with linux, but in all honesty arnt the best distros for learning about linux.

also they seem to be overly bloated, slackwhere fits on a cd suse fits on a dvd :).

I must say I wouldn't want to use slackware for a primary box since its a damn annoyance installing new packages, Unlike gentoo/debian witch is easy as pie :P

Gentoo and Ubuntu have a very good support network, I bleave its alot better then slackwares.

Paul.Esson 53 Junior Poster

Hmm My first comment would be to download putty, Im pritty certain the windows console dosn't use escape sequences properly, Witch could help you a great deal.

you can use tput or escape chars for moving and storing the coursers possie

Example of escape char in bash

echo -n -e "\033[34m" ( changes the color to blue )

I would suggest using tput, personly (although I havnet used it, it will prolly be easyer and more practical)

Colours and Cursor movement with tput

List of escape chars

putty

Paul.Esson 53 Junior Poster

Glade / Glade2
it's for QT development I believe

Glade is for GTK/Gnome development

KDevelop/ QT Designer are for KDE/QT development


I am having problems with designing in GTK.
If I click on text box object it fill up the entire window.

You need to add some kinda container such as a GtkTable , or GTKFixed, if your used to a VisualBasic style design, its prolly best to use GTKFixed since you can just plop your butttons/listboxes/whatever anywhere

In glade you can use libglade with your c/c++/ada95 projects

Using libglade

python libglade

Paul.Esson 53 Junior Poster

Granted, this program does cost a considerable amount of money depending on what you want...however, there are ways of getting it otherwise. (not that I would).

I used to use slackware for about a year I think.. The package management systems worse then RPM !!

Paul.Esson 53 Junior Poster

Granted, this program does cost a considerable amount of money depending on what you want...however, there are ways of getting it otherwise. (not that I would).

and a considrable amount of resources(ram/cpu etc)

Paul.Esson 53 Junior Poster

Just got Slackwhere box running as an Xwindows terminal.. worked good for that, Its great for minimalistic instlalls (in some respects, the aweful package managment system is the biggest downside).

If you have the time Gentoo is great, You will learn a hell of a lot just instlling it (make certain you follow the installation guide :P)

Gentoos package management is awesome, If your willing to wait for things to compile :).

Debain is also great very customizable (alot more then slack, Yet I think less then gentoo) apt-get is a great package management system.

But really, Gentoo is the best hand dirtying system in the world :)
Easyness to install slackware prolly wins over gentoo :P

Paul.Esson 53 Junior Poster

Nice to meet you too

Paul.Esson 53 Junior Poster

Oops Double Posted

Paul.Esson 53 Junior Poster

Sorry its called gnome blog :P I just have a habit of saying blogger :P
Its a nice little application for gnome that sits on the panel and allows very easy blogging.


Gnome Blog Screenie

Paul.Esson 53 Junior Poster

If your database is made in access then you will have to use ASP.NET, If your database is MySQL, PosgreseSQL etc, you have the choice of ASP.NET or PHP. You will find some good tutorials on the net for using both for connecting with databases

Good Luck and Welcome :)

Paul

Paul.Esson 53 Junior Poster

Talking about faster compilers and benchmarks, I bleave there is some good gcc benchmarks for selecting the right flags for you system...

I Think..

But when compilers commenly have optermizations that can be turned on and off for instance -O3 or -O2 in gcc -O3 makes the code larger in size for small preformance increases while -O2 keeps the code the same size using all optermizations that don't have a space speed tradeoff..

-Os optermizes for size (smaller then not opermized or O2), witch all compilers there are trade offs you have to make..

If you want everyone to get the best out of your program your not going to use processor persific compiler options -march=athlon-xp since then your code will only run on an athlon xp(damn well on an athlon, but not to well on anything else) -mcpu athlon-xp would be ok tho, since it would compile optermized for athlon-xp but also generic i386 code..

There is alot of things to consider in one compiler let alone, Witch is the best out of them all

Paul.Esson 53 Junior Poster

Anyone know if I can use GnomeBlogger with the Daniweb blogs ?

I can use "Self-Run MovableType", "Self-Run Pyblosxom", "Self-Run WordPress" or "Self-Run Other"

Most require base blog URL's or XML-RPC url

Paul.Esson 53 Junior Poster

Example:
10010100 - Signed Bit on neg number

01001001 - Signed bit off positive number.

Thats the leftmost number :P, or if your counting, the last bit... highest bit.. I guess would be a more approprate term

Paul.Esson 53 Junior Poster

the windows netowkringprotocal is a discusting protocal in genaral, The whole lets elect someone to be the browsemaster etc. etc...

You might like to try checking if your linux boxes know who the browsemaster is (my guess is they don't have a clue who they are, hence why they can't see anyone yet everyone can see them)

nmblookup -M WORKGROUP

(where workgroup is your workgroup)
this should tell you if they can see the browse master..

in all honesty i wouldn't bother browsing shares, I would just mount them.

mount -t smbfs //192.168.0.1/sharename /mnt/mountpoint

where 192.168.0.1 is the ip of the computer you wish to mount and sharname is the name of the share

smbclient -L 192.168.0.1

will list all the shares on a host..

it seems the simplist solution, unless you have time to run through your /etc/smb.conf and make certain everything is setup right...

Paul.Esson 53 Junior Poster

In linux you can use the following for writing to NTFS

Captive NTFS allows write to NTFS drives (free uses wine) - Apparently slow
also
Paragon NTFS Driver does (commertial) - Exceedingly good

Paul.Esson 53 Junior Poster

There are large differences between how you write in an Object Oriented Programming Language and a procedural language though. I think there will be a need for C programmers for a long time though, Its a good bet, But personly i think you should learn both a procedual and a object orientated language to cover all bases. C is a good language to learn since its quite powerful and lets you make mistakes (helps you learn :P) + you get to mess around with memory etc. alot of higher level languages such as java and C# hide this...

So in conclusion I think C is a great language to learn since its so powerful :)

Paul.Esson 53 Junior Poster

Reinstall Windows :D

Paul.Esson 53 Junior Poster

Do you have a wireless ADSL modem ? AKA does the modem plug into the phone line, because if thats the case you need a ADSL line filter that you plug onto the socket that the phone plugs into (there about $20 au dicksmith, harveynormal etc.. have em).

The reason for this is the phone w/o the filter will throw noise onto the bandwith that the modem is using 4khz up (I think) and therefor force the basted to D/C

Paul.Esson 53 Junior Poster

Im pritty dang certain you can't get RID of bad clusters(since there just that clusters that have gone bad, physicly bad)

You can mask bad clusters on your HDD, Your manafacturer may have tools for that.

or if you wish to fork out some dosh Spinrite from www.grc.com is spost to work well

I was also under the impresson that file systems avoided using them by masking them as bad (FAT apparently does (oviously not that well))

Paul.Esson 53 Junior Poster

no. if there not you can use

import whatever.you.called.it;

example

import java.math;

to import the java.math package (standard java package) if you wish to import say all packages in java.security you could use

import java.security.*;

Some people think its bad coding practice to do this though. I don't find it that messy and i think the jre could manage it ok (it does do optermizations).

Paul.Esson 53 Junior Poster

I can't give you much advice since I use eclipse. But check to see if the Classes are part of the same Package.

a package is eqivilent to a namespace in .NET.. Hope this helps

Paul

Paul.Esson 53 Junior Poster

This is how it ended up, My problem was basicly that bytes in java are signed bytes and the signed bit is the last bit...

Example:
10010100 - Signed Bit on neg number

01001001 - Signed bit off positive number.

This can be resolved by using the byte as an int when its needed
byte a = 0xFF
int b

b = a, should do the trick... I think casting will keep the sign (not what i want )..

// My new nibble swap

private static byte nibbleSwap(byte inByte){
		    int nibble0 = (inByte << 4) & 0xf0;
		    int nibble1 = (inByte >>> 4) & 0x0f;
		    return (byte)((nibble0 | nibble1));
	}
Paul.Esson 53 Junior Poster

You could use a select statment or the command design patten.

http://www.dofactory.com/Patterns/PatternCommand.aspx

Paul.Esson 53 Junior Poster

The following method should swap the high nibble in a byte with the low nibble in a byte.

The following code dosn't work if the lower nibble is above 0111
if it is it returns a negative number...

Does anyone know what im doing wrong ?

public static void main(String[] args){
		byte inByte = (byte)0x09;
		byte out;
	    int by1 = (inByte >> 0) & 0x0f;
	    int by2 = (inByte >> 4) & 0x0f;
	    System.out.println(by1);
	    System.out.println(by2);
	    out = (byte)((by1 << 4 | by2 << 0) & 0xff);
		System.out.println(out);
	}

Thanks for your help,

Paul

Paul.Esson 53 Junior Poster

No one wants to pay for books, Go over to The Linux Documentation Project http://tldp.org/ and pick yourself up a copy of Linux Kernel 2.4 Internals while 2.4 alot of it will cross over to 2.6 also get a copy of The Linux Kernel Module Programming Guide(kernel 2.6), The Linux Kernel(kernel 2.0) and The Linux Kernel Hacking Guide (Kernel 2.0)

I hope these help

KernelAnalysis-HOWTO could also help

perhaps subscribe to some mail lists http://vger.kernel.org/vger-lists.html

Paul.Esson 53 Junior Poster

If you want to use your box as a router I would strongly recommend IPCop (exceedingly easy to setup). But if you just wanna learn about linux and get your hands dirty, I would definatly suggest Gentoo, They just give you the dirt and instruct you how to make something out of it.

LiveCD's are good, but there easy to cop out on if you have a problem. (expesaly since you really have limited access to what you can change).

Mandrake etc are good for a first time, Yet i wouldn't wanna try them on a 200Mhz box.

Paul.Esson 53 Junior Poster

I havent really had much success with IDE's, I find them really unintutitive. I seem to find myself using a texteditor (usuly nano or gedit). They are exceedingly useful for building GUI's but when im not doing that I cant really see any point to using one, since they are spost to make life easy, and they don't seem to.

Paul.Esson 53 Junior Poster

What's nice about it is that you have application directories that you install the application to instead of just common packages. That way, you can have everything installed to its own directory and organization is key for it.

Thats the same way NextSTEP series does it (NextSTEP/OpenStep/Mac OS X) does things, Its really a nice way (one of the things i like about OS X).

Im going to go have an attempt at that desktop looks really nice

Paul.Esson 53 Junior Poster

Well, From the top of my head (meaning prolly wildly inaccurate) a database is simply a store of data, that data is stored in tables each table has many rows each with different names witch take different values INT, TEXT perhaps.
On the internet these are used alot, say you have a online shop, the details on your stock could be stored in a table in a database with the row names being StockName, ItemNo (this would be a primary key (don't worry about that)), Price, etc...

Then using a serverside language like PHP or ASP.NET you could format a page that listed the contents of the database in an intuative (sp) way.

So, a database is a useful way to store data, its faster and often easyer then using plain text files.

SQL is the Structured Query Language, alot of databases use this as a way of well interfacing with them, SQL is quite similar across different databases (there are some slight differences) so learning SQL really allows you to interface with alot of different databases. The tutorial shows you some of the things you can do with SQL.

I hope this helps you out

Paul.Esson 53 Junior Poster

Does anyone know a of a php script for cataloging ebooks ??

Paul.Esson 53 Junior Poster

If your using grub

type

$ grub

grub> root (hd0,0)
grub> setup (hd0)
grub> quit

Note: hd0,0 is hda1, hd0,1 will be hda2 etc.
hd1,0 is hdb1

root(hd0,0) should be the partition where your grub booting information is (kernel images and grub config)

if you dont know where this is use

grub> find /boot/grub/stage1

setup(hd0) installs grub on your mbr :)

good luck, btw.

Paul.Esson 53 Junior Poster

xchat is really nice, but if your insistant on using mirc, you can run mirc in wine fine.

www.winehq.org

Paul.Esson 53 Junior Poster

I have a commertial NTFS driver I use to write files under linux, I rarly use windows. But since the hard disk is in a USB Hard disk enclosure I feel i need a journaling filesystem. Plus its a 160 Gig hard disk, so there would be alot of wasted space with small files unless I made 4 partitions, or something of the like.

But how this all came about really, Is im considering installing MacOS X on my mac and i need NTFS read support, to make it a decient idea.

The other problem I have is that I own a 800mhz iBook G4 with the stock standard 256 meg of ram, I don't feel this will cope with OSX. Is there any tricks i should use to install osx so it runs fast ?

Im really dreading installing os x here, it could turn into 3 days of solid work putting another operating system on it :P

Paul.Esson 53 Junior Poster

Tool, Floyd, A Perfect Cicle, The Beatles, The Whitlems, Mike Oldfield ... etc.

Paul.Esson 53 Junior Poster

1. Faster than php because it runs on the .NET framework is based on compiled languages and the Web applications is compiled and not interpreted.

Im pritty certain you can compile PHP too.

But also J#.net, would be the best to use interopratability (spelling) wise, since you could send java objects too your sever, if you where that way incliend.

Paul.Esson 53 Junior Poster

Theres a nice place that provides freesql servers www.freesql.org, I don't think they are accepting new accounts currently tho :|

Thanks mike

Paul.Esson 53 Junior Poster

Well hmm, Yes I did, LETS say i have a database called test !! and a mysql script that looks like such

[root@Kat root]# cat pont.sql
#DROP TABLE `test`
#CREATE TABLE test(nick VARCHAR(30), about VARCHAR(30));

INSERT INTO test () VALUES ("Paul.Esson" , "Trying to be nice" );
INSERT INTO test () VALUES ("kubota" , "Idiot");
SELECT * FROM test

because I do, Now I wish to run this script

[root@Kat root]# mysql test < pont.sql
nick    about
Paul.Esson      Trying to be nice
kubota  Idiot
Paul.Esson      Trying to be nice
kubota  Idiot
Paul.Esson      Trying to be nice
kubota  Idiot
[root@Kat root]#

It works for me

You might try reading the man pages ?

[root@Kat root]# man mysql | tail -n 20 | head -n 5
EXAMPLE
       You can also read a backup dump file back into MySQL with:

       mysql  database < backup-file.sql

So basicly what you need to do is open up some kinda console
start > run > cmd

in windows

then you need to make certain that mysql is in your path, prolly easyest to change to the mySQL dir, then you type

mysql theDatabaseName < C:\path\to\the\file\photowhatever.sql

and pray it should hopfully work without a hitch.

Paul.Esson 53 Junior Poster

Intro

I'm not the best at this, but I thought we were lacking a SQL tutorial...


Test table

My Little Test Table called "test" for this great exercise contains the following

FirstName LastName EyeColor
Paul Esson Brown
John Smith Blue
John Howard Green
Kim Beazley Gray


SELECT

This selects data from a table in SQL. The basic syntax of select is as follows:

SELECT field FROM table

So

SELECT * FROM test

will produce the table an output of everything in the test table

SELECT FirstName FROM test

Will Produce

Paul
John
John
Kim

As you can clearly see, this part is quite easy.


WHERE

If we don't want to know about two johns we can try

SELECT DISTINCT FirstName FROM test

This Will Produce

Paul
John
Kim

John Smith is the John Selected, since John Howard is after him in the database.

SELECT LastName FROM test WHERE FirstName = "John"

Will Produce

Smith
Howard

WHERE can be used with lots of different logical operators, such as
= is equal to
<> or != is not equal to
> greater than
< less than
>= less than or equal to
<= ....

IN A list follows this, if its in the list then its used
such as

SELECT …