Did you tell your friend about PackageKit or Smart and the all the distros they both work on? I've used "Apt4RPM" on multiple distros, it works great. What about ZeroInstall and all its clones that let you build "install anywhere" linux packages by bundling libraries? Or gnome-app-install (Add/Remove Programs) or MintInstall or Appnr or even Click'n'Run that all provide user-friendly installation of software in less clicks than Windows?

Or that any package manager in any major distro allows searching of indexed metadata so you can look for "mp3 player" instead of "Amarok" or that every major distro already has packages for just about every stable, useful piece of software that will run on Linux and that the whole "we can't build universal packages" meme is an excuse from short-sighted programmers who don't want to provide distros with copies of their code to package.

Fine, whatever, their code, their choice, but don't lay it on the Linux community, if you give them a copy of useful, stable code they'll package it. Pore through the package repositories of any older distro -- Suse, Fedora, Debian, Mandriva, Slackware. You'll find programs packaged that probably 20 people in the whole world use. All at your fingertips just because the code was there and someone wanted to use it.

Your point about new terminology is just ridiculous. "Website?" "Blog?" "Download?" I guess I can't start using the internet because it has new terms for me to learn. The Internet is the largest, fastest-growing sector of ...

You have no idea how ridiculous your headline is. All the 8,000 Linux distros <b>combined</b> equal something like a 0.94% market share.

[code]
foreach ( char lDisallowed in System.IO.Path.GetInvalidFileNameChars( ) ) {
safe = safe.Replace( lDisallowed.ToString(), "" );
}
foreach ( char lDisallowed in System.IO.Path.GetInvalidPathChars( ) ) {
safe = safe.Replace( lDisallowed.ToString(), "" );
}
[/code]

To compile in Visual Studio, add
[code]#pragma comment(lib, "winmm.lib")[/code]

10
CLS
nomainwin
Nice try but there were some mistakes,anyway it is very good.If you want to get deeper into C++ it is better to start learningsome Liberty basic (www.libertybasic.com) it `will help oyu improve your skills in all not visual languages.

   PRINT "Nice calculator  !!!"

INPUT "equal " ; sere
dim = sere
End

I have an discrete maths exhibition, and i wanted to illustrate the influence of discrete maths in computer science.

so i need some softwares to illustrate. A few examples like set theory for computer networking. graph theory and big O for analysis of algoritms.

please can some of you suggest some software. thanks.
remember it must show influence of discrete maths

How to focus a combobox in windows forms when the program is running in a thread?

ya even i hav a same problem with my friends pc his configration is also very similar i.e.
2GB RAM,Nvidia mobo,Nvidia 512 MB graphic card, win XP pro service pack 2, Intel Core2Duo Processor(2.56GHz) n a 19"W LG LCD screen

n every one gives dose solutions u mentioned,which r of no help tried long bak

he wants it to work desparately @ ne cost
is d 19" lcd really d problem ????

Thank you very much. That really worked.

At last my program to transfer content of one file to another. Again thanks. Here is the full program for further reference to other users.
[code]

include<fstream.h>

include<iostream.h>

include<conio.h>

class student
{
int rollno;
char name[20];
int tm;
public:
void input();
void transfer();
void output();
};
void student::input()
{
char ch='y';
ofstream outf;
outf.open("mark.dat");
while(ch=='y')
{
cout<<"Enter rollno, name and mark\n";
cin>>rollno>>name>>tm;
outf.write((char)this,sizeof(student));
cout<<"Wish to enter more(Y/N)?\n";
cin>>ch;
}
outf.close();
}
void student::transfer()
{
ofstream outf;
ifstream inf;
inf.open("mark.dat");
outf.open("trans.dat");
while( inf.read(( char
)this,sizeof(student)))
{
outf.write(( char )this,sizeof( student ) );
}
outf.close();
inf.close();
}
void student::output()
{
ifstream inf;
inf.open("trans.dat");
while (inf.read((char
)this, sizeof(student)))
{
cout<<"\nRollno "<<rollno;
cout<<"\tName "<<name;
cout<<"\tTotal "<<tm<<'\n';
}
inf.close();
}
void main()
{
clrscr();
student obj;
obj.input();
obj.transfer();
obj.output();
getch();
}
[/code]

[QUOTE=Ancient Dragon;812620]If you are not allowed to use vector then you will have to read the entire file, counting the line numbers as the loop progresses. There is no other way to do it.

Why do you need the line count? Maybe there are alternative ways to achieve what you want to do.[/QUOTE]

I have to use a dynamic array structure to store the contents of a an input text file. Firstly I do not know how long the input text file will be and thus need to work this out first. The use of a dynamic array is also necessary as we are required to be able to insert and delete elements from the array. Also I am having problems with storing strings into my array as I only know how to store integers. Could you help with this at all? Thanks!

I have a very similar assignment in which we have been specified that we are NOT allowed to use vectors. Is there any other way in this case to count the number of lines of data within a text file??

Thank you very much for taking time to correct my program. I am from India and here we learn about only basics of c++ and our syllabus is based on turbo c++ 3. So i use turbo c++ and i don't know much about c++ programing. So i cannot implement all the instructions you given about modern c++.

I tried your new changes. But i still have some little problems. The program is to transfer content of one file to another. When i input only one entry, the program works. But when more than one entry is used it out puts only 1 or 2. Kindly please correct the problem.

Here is the new code by correcting the previous errors.

[CODE]#include<fstream.h>

include<iostream.h>

include<conio.h>

class student
{
int rollno;
char name[20];
int tm;
public:
void input();
void transfer();
void output();
};
void student::input()
{
char ch='y';
ofstream outf;
outf.open("mark.dat");
while(ch=='y')
{
cout<<"Enter rollno, name and mark\n";
cin>>rollno>>name>>tm;
outf.write((char)this,sizeof(student));
cout<<"Wish to enter more(Y/N)?\n";
cin>>ch;
}
outf.close();
}
void student::transfer()
{
ofstream outf;
ifstream inf;
inf.open("mark.dat");
outf.open("trans.dat");
while( inf.read(( char
)this,sizeof(student)))
{
outf.write(( char )this,sizeof( student ) );
}
outf.close();
inf.close();
}
void student::output()
{
ifstream inf;
inf.open("trans.dat");
while (inf.read((char
)this, sizeof(student)))
{
inf.read(( char* )this,sizeof( student ) );
cout<<"\nRollno "<<rollno;
cout<<"\tName "<<name;
cout<<"\tTotal "<<tm<<'\n';
}
inf.close();
}
void main()
{
clrscr();
student obj;
obj.input();
obj.transfer();
obj.output();
getch();
}
[/CODE]

Please correct the error in my program. When i run the program on turbo c++ 3, it output 3 times. Also When i enter more than 1 entry only the last entry is outputted. Also it is outputted 3 times.

[CODE]#include<fstream.h>

include<iostream.h>

include<conio.h>

class student
{
int rollno;
char name[20];
int tm;
public:
void input();
void transfer();
void output();
}
obj;
void student::input()
{
char ch='y';
ofstream outf;
outf.open("mark.dat");
while(ch=='y')
{
cout<<"Enter rollno, name and mark";
cin>>rollno>>name>>tm;
outf.write((char)&obj,sizeof(obj));
cout<<"Wish to enter more(Y/N)?\n";
cin>>ch;
}
outf.close();
}
void student::transfer()
{
ofstream outf;
ifstream inf;
inf.open("mark.dat");
outf.open("trans.dat");
while(inf)
{
inf.read((char
)&obj,sizeof(obj));
outf.write((char)&obj,sizeof(obj));
}
outf.close();
inf.close();
}
void student:utput()
{
ifstream inf;
inf.open("trans.dat");
while(inf)
{
inf.read((char
)&obj,sizeof(obj));
cout<<"\nRollno "<<rollno;
cout<<"\nName "<<name;
cout<<"\nTotal "<<tm;
}
inf.close();
}
void main()
{
clrscr();
student obj;
obj.input();
obj.transfer();
obj.output();
getch();
} [/CODE]

I still have another problem. That is when the while loop asks continue(y/n)
When i enter n it just stuck there.

I need to make the program error free urgently. Please reply with solution. I use borland turbo c++ 3

I found the error and corrected it.

#include<fstream.h>
#include<iostream.h>
#include<conio.h>
class student
{
int rollno;
char name[20];
int tm;
public:
void input();
void transfer();
void output();
}
obj;
void student::input()
{
char ch='y';
ofstream outf;
outf.open("mark.dat");
while(ch=='y')
{
cout<<"Enter rollno, name and mark";
cin>>rollno>>name>>tm;
outf.write((char*)&obj,sizeof(obj));
cout<<"wish to enter more(Y/N)";
cin>>ch;
}
outf.close();
}
void student::transfer()
{
ofstream outf;
ifstream inf;
inf.open("mark.dat");
inf.open("trans.dat");
while(inf)
{
inf.read((char*)&obj,sizeof(obj));
outf.write((char*)&obj,sizeof(obj));
}
outf.close();
inf.close();
}
void student:utput()
{
ifstream inf;
inf.open("trans.dat");
while(inf)
{
inf.read((char*)&obj,sizeof(obj));
cout<<"Rollno"<<rollno;
cout<<"Name"<<name;
cout<<"Total"<<tm;
}
inf.close();
}
void main()
{
student obj;
obj.input();
obj.transfer();
obj.output();
getch();
}

think i got this from my friend

void main()
{
    student obj;
    obj.input();
    obj.transfer();
    obj.output();
    getch();
}

He told to put it at last but hwo do i do that?

Please find and correct the error in my c++ program. "Linker Error: Undefined symbol _main in module c0.ASM"
The program is for transfering content of one file to another.

#include<fstream.h>
#include<iostream.h>
#include<conio.h>
class student
{
int rollno;
char name[20];
int tm;
public:
void input();
void transfer();
void output();
}
obj;
void student::input()
{
char ch='y';
ofstream outf;
outf.open("mark.dat");
while(ch=='y')
{
cout<<"Enter rollno, name and mark";
cin>>rollno>>name>>tm;
outf.write((char*)&obj,sizeof(obj));
cout<<"wish to enter more(Y/N)";
cin>>ch;
}
outf.close();
}
void student::transfer()
{
ofstream outf;
ifstream inf;
inf.open("mark.dat");
inf.open("trans.dat");
while(inf)
{
inf.read((char*)&obj,sizeof(obj));
outf.write((char*)&obj,sizeof(obj));
}
outf.close();
inf.close();
}
void student::output()
{
ifstream inf;
inf.open("trans.dat");
while(inf)
{
inf.read((char*)&obj,sizeof(obj));
cout<<"Rollno"<<rollno;
cout<<"Name"<<name;
cout<<"Total"<<tm;
}
getch();
inf.close();
}

The error i get is
compiling 10.cpp
linking ...\OUTPUT\10.EXE
.Linker Error: Undefined symbol _main in module c0.ASM

I think the error is due to the missing of void main. But i don't know where i should put it.

Mac OS X Program

Sometimes, you find an application that you really, really like, but when you run it, the icon takes up valuable space in your Dock. With Dock Dodger, you can rid almost any application of its Dock icon, giving you your Dock back.

With Dock Dodger, removing the Dock icon is as easy as Drag and Drop. Simply drag in the application you want to Un-Dock and Dock Dodger takes care of the rest. When you re-launch that application, it will be sans Dock icon. Want the Dock icon back? Just re-drag the application into Dock Dodger and everything's back to normal.

[URL="

SA Tennis Open, PBZ Zagreb Indoors, Movistar Open at [url]http://www.channelsurfing.net/[/url]

Symptoms & circumstance suggust RAM failure. Remove all modules and retest each module individually in each bank slot one by one.

[QUOTE=streggiari;719441]I ran the vista Memory Diagnostic Tool on my PC and while it was running the computer shut off. Now it will not start again. The fans and lights start and run for a second or two, then it shuts down for a few seconds and then it attempts to start again, the fans and lights come on for a few seconds and then it shuts down. This cycle just keeps on going.

I tried to create a windows recovery Cd, but the power doesn;t stay on long enough for the Cd drive to run.

I suppose the power wiped out my Bios or filled up the RAM and now it can't start at all. Any ideas. What do I do?[/QUOTE]

can i have this application to but just vb6

hi, I do not have any special PHP knowledge, so I would like someone to give me a code for this; I have a "text.txt" file on my server, which has underscores in it. I want a PHP code which replaces all the underscores with spaces and then save the txt. thanks

Wow. I was working all day, I missed that... I'm sorry :)
Thanks for the REALLY fast answer.

Solved.

Hy, I am trying to encode an X509 certificate into base64, and since the encoder I'm using takes only char*, and typecasting doesn't work, i find a different way to do this. I'm sure there is a simpler way, but i just can't find it. Here is the code:

[CODE]BUF_MEM bptr;
BIO
mem = BIO_new(BIO_s_mem());
PEM_write_bio_X509(mem, x509p);
int i = BIO_get_mem_data(mem, &bptr);
_TCHAR* tmp = new _TCHAR( i+1 );
memcpy(tmp, bptr, i);
tmp[ i ] = _T('\0');

BIO_free_all(mem);
X509_free(x509p);[/CODE]

The whole thing works "fine", but after this part every "new" object i create fails, and throws an [B]std::bad_alloc[/B] exception. (I delete the [I]tmp[/I] later on.

Here is the more exact part where it crashes:

[CODE]void __CRTDECL operator new(size_t size) _THROW1(_STD bad_alloc)
{ // try to allocate size bytes
void
p;
while ((p = malloc(size)) == 0)
if (_callnewh(size) == 0)
{ // report no memory
static const std::bad_alloc nomem;
_RAISE(nomem);
}

    return (p);
    }[/CODE]

I know it has something to do with memory leaks, but i can't find anything wrong with it, or I'm just missing it. The problem was caused only by this part of the code, if I remove it, everything is fine again.

Thank you for the help. (and Merry Christmas)

I had this problem in Joomla! with my php code that I was including in an article through the plugin sourcerer. Well, needless to say, my web hosting changed to php 4 without me knowing why, I changed it to php 5 as the compiling engine and it worked like a charm.

ls *.done | while read line ; do mv $line $(basename $line .done) ; done

Hi I"m fairly new to python and need some help with a slightly complicated programming solution. I'm trying to write a simply TCP sniffer (not a proxy!) that will sniff tcp packets coming from a specific IP and a specific port that is arriving to my local computer where the script will be running.
I'm on windows Vista and its a built in NIC card. (if that has anything to do with programming a sniffer for this)

For ie purposes:

  1. the specific ip where it is coming from is 1.2.3.4
  2. the port its coming in on my pc is 90210

All I want to do is create a python script that will sniff these particular packets and convert the data in it to ASCII text.. so I can then parse through it and do something with it..

I'd appreciate some help in writing this.. I've looked at twisted framework and other things.. but its a big learning curve for me. A simple example to do what I described would get me on my way much easily.

-Thanks for reading! :)

public static boolean INSERT(Payment argPayment, Connection con) {
        boolean result = false;
        Connection mastercon = MyConnection.getMasterConnection();

        try {
//            String selectStatement = "SELECT SUM(AMOUNT) AS TOTALAMOUNT, SUM(PAID) AS TOTALPAID,OUTSTANDING FROM PAYMENT WHERE SUBID=? AND OFFICEID=? GROUP BY SUBID";
            String selectStatement = "SELECT PAID AS TOTALPAID,OUTSTANDING FROM PAYMENT WHERE SUBID=? AND OFFICEID=? AND ID = (SELECT MAX(ID) FROM PAYMENT WHERE SUBID=? AND OFFICEID=?) GROUP BY SUBID";
            PreparedStatement stmt = con.prepareStatement(selectStatement);
            stmt.setInt(1, argPayment.getSubid());
            stmt.setInt(2, argPayment.getOfficeID());
            stmt.setInt(3, argPayment.getSubid());
            stmt.setInt(4, argPayment.getOfficeID());
            ResultSet rs = stmt.executeQuery();
            if (rs.next()) {
                argPayment.setSumPaid(rs.getFloat("TOTALPAID"));
                argPayment.setOutstanding(rs.getFloat("OUTSTANDING"));
//                argPayment.setSumAmount(rs.getFloat("TOTALAMOUNT"));
            }

            String insertStatement = "INSERT INTO PAYMENT(SUBID,AMOUNT,PAID,OUTSTANDING,ENTRYDATE,REMARK,COURIERCHARGE,LESSPAYMENT,OFFICEID) VALUES (?,?,?,?,?,?,?,?,?)";
            PreparedStatement stat = con.prepareStatement(insertStatement);
            stat.setInt(1, argPayment.getSubid());
            stat.setFloat(2, argPayment.getAmount());
            stat.setFloat(3, argPayment.getAmount() + argPayment.getSumPaid());
            stat.setFloat(4, argPayment.getOutstanding() - argPayment.getAmount());

            stat.setDate(5, argPayment.getEntryDate());
            stat.setString(6, argPayment.getRemark());
            stat.setFloat(7, argPayment.getCourierCharge());
            stat.setFloat(8, argPayment.getLessPayment());
            stat.setInt(9, argPayment.getOfficeID());

            con.setAutoCommit(false);
            if (stat.executeUpdate() > 0) {
                int subid = argPayment.getSubid();
                Purchase purchase = DBPurchase.retrive(subid, argPayment.getOfficeID(), con);
                int partyid = purchase.getParty().getPartyID();
                Account partyAccount = DBAccount.retrieveAccountByIDandType(partyid, "PARTY", mastercon);
                Account officeAccount = DBAccount.retrieveAccountByIDandType(argPayment.getOfficeID(), "OFFICE", mastercon);
                AccountTrack partyAccountTrack = new AccountTrack();
                partyAccountTrack.setId(partyAccount.getId());
                partyAccountTrack.setCredit(true);
                partyAccountTrack.setDate(argPayment.getEntryDate());
                partyAccountTrack.setAmount(argPayment.getAmount());
                partyAccountTrack.setDescription("Payment for payment id-" + argPayment.getId());
                if (DBAccountTrack.insert(partyAccountTrack)) {
                    AccountTrack officeAccountTrack = new AccountTrack();
                    officeAccountTrack.setId(officeAccount.getId());
                    officeAccountTrack.setCredit(false);
                    officeAccountTrack.setDate(argPayment.getEntryDate());
                    officeAccountTrack.setAmount(argPayment.getAmount());
                    officeAccountTrack.setDescription("Payment for payment id-" + argPayment.getId());

                    if (DBAccountTrack.insert(officeAccountTrack)) {
                        AccountTrack pAccountTrack = new AccountTrack();
                        pAccountTrack.setId(partyAccount.getId());
                        pAccountTrack.setCredit(false);
                        pAccountTrack.setDate(argPayment.getEntryDate());
                        float amount = argPayment.getLessPayment() + argPayment.getCourierCharge();
                        pAccountTrack.setAmount(amount);
                        pAccountTrack.setDescription("Less Payment and Courier Charge-" + argPayment.getId());

                        if (DBAccountTrack.insert(pAccountTrack)) {
                            AccountTrack oAccountTrack = new AccountTrack();
                            oAccountTrack.setId(officeAccount.getId());
                            oAccountTrack.setCredit(true);
                            oAccountTrack.setDate(argPayment.getEntryDate());
                            float officeAmount = argPayment.getLessPayment() + argPayment.getCourierCharge();
                            oAccountTrack.setAmount(amount);
                            oAccountTrack.setDescription("Less Payment and Courier Charge-" + argPayment.getId());

                            result = DBAccountTrack.insert(oAccountTrack);
                            con.commit();                            
                        }

                    }
                }
            }

        } catch (Exception e) ...
Ezzaral commented: This code is absolutely useless as a response to the question. -3
stephen84s commented: 194 Posts and still no code tags -1

[QUOTE=chris5126;735039]lol sorry just have seen very similar if not exactly the same problem before!! Look through this forum and you should find the answer somewhere.[/QUOTE]
(while read line; do if [ $(echo $line | wc -c) -eq 1 ] ; then echo; else echo -n $line,; fi ; done<address.txt ) |sort >address.csv