WolfPack 491 Posting Virtuoso Team Colleague

I just read about $0 in the Llama book. I think I can do something with it.

WolfPack 491 Posting Virtuoso Team Colleague

Does any of you know how to get the pathname of the perl script that is being executed?

Say it is located in /home/wolfpack/perl/ I run it from /home/wolfpack by giving the absolute path name like, /home/wolfpack/perl/scriptname [arguments] I want to get the path /home/wolfpack/perl so that I can use some files inside that directory so that perl does not search for them inside the current working directory which is /home/wolfpack/

WolfPack 491 Posting Virtuoso Team Colleague
  • something Japanese

Why Japanese?

WolfPack 491 Posting Virtuoso Team Colleague

Hi, does anybody know how check whether the socket (ie file descriptor) is valid in C? I know it is probably possible to do it using either a read or a write command, however, what other ways are there? Thanks.

Depends on the socket that you are using. If you are using the berkely sockets, they have (I think) -1 as the value for the invalid socket. Look up the documentation for this. The Winsock API uses the INVALID_SOCKET value to determine an invalid socket. (Look up the Winsock API Documentation)

WolfPack 491 Posting Virtuoso Team Colleague

It is a bit strange that you can open text files but not csv files. They are essentially both text files, and only the file extensions are different. So give us the code that you are using to open the files. Maybe we can find something more by looking at the code. If you are using file paths, you should use double backslashes like "C:\\temp\\temp.txt".

WolfPack 491 Posting Virtuoso Team Colleague

Sorry, I was looking for something a little simpler and little more free :P

Try the built in _CRTDebug Libraries of Visual C++.

SpS commented: Good ~~ SunnyPalSingh +3
Salem commented: Good answer - Salem +4
WolfPack 491 Posting Virtuoso Team Colleague

Please read the section "Keep it organized" on the Daniweb Policy page. All caps also will be considered rude by most of the members, although it is not stated in the rules page.

WolfPack 491 Posting Virtuoso Team Colleague

There is a difference between a good person and a good human.

huh? explain the difference between a person and a human. Any person is a human right? and any human is a person right? You don't call dogs or cats or cherry trees as persons, unless you are a poet. Or do you have a different view on person and human?

WolfPack 491 Posting Virtuoso Team Colleague

What hurts most is that he died without knowing that his family was safe. I don't think he would have minded his own death if he knew that his family was safe. :sad:

WolfPack 491 Posting Virtuoso Team Colleague

[Takes off moderator hat]
The fuss on this and your previous thread is really making me sick. And on retrospect,

2) You're trolling by subtly bringing up a topic that will divide people.

seems to be not that far from the truth. You decide yourself from the replies that you get on this thread. And just for the record, I tend to distrust self confessed nice people.
[puts moderator hat back on]

WolfPack 491 Posting Virtuoso Team Colleague

How can you find if other websites link a particular page? And is it impossible to have 10000 friends?

WolfPack 491 Posting Virtuoso Team Colleague

trackbacks,

What exactly are trackbacks? You are speaking to an absolute idiot who only knows how to open his browser when it come to the WWW.

WolfPack 491 Posting Virtuoso Team Colleague

>Off-topic: Narue, out of curiosity, where did you get your nick?
I just took a random Japanese name (Naru) and added a common suffix to it (e).

I thought it was from the Japanese Manga "Narue no Sekai". (成恵の世界-World of Narue). Since you had a blog item on [search]Japanese Manga[/search], and your interest in Japanese, I thought that explaination made sense. I was stumped when I read your explaination. :surprised

WolfPack 491 Posting Virtuoso Team Colleague

>After "Da Vinci Code" who wouldn't?
I have no idea, I've never read it. ;)

I thought it was a movie. :cheesy:

WolfPack 491 Posting Virtuoso Team Colleague

I'm writing a win32 app that re-paints the client area everytime the user clicks inside of it. Unfortunately after about 25 or 26 clicks the window gets painted white, but the black grid lines still appear.

The WM_PAINT case goes through a for loop and asks another class what should be at that square and displays it.

I've tried adding a timer that repaints the screen whenever a flag is put up, but the same thing happens.

Any ideas? Thanks

Looks like there is a resource leak in your code. You are probably not releasing the Device Context by using ReleaseDC. If you are using fonts, maybe it is a font that you are not releasing. Post the code for the WM_PAINT event and the clicking event.

WolfPack 491 Posting Virtuoso Team Colleague

For the First question : Google.
For the second, I think Numerical Recipies in C which is downloadable freely should be good. It also has a chapter on Sparce Matrices as well.

WolfPack 491 Posting Virtuoso Team Colleague

What are you trying to do with it? The C in LPCTSTR stands for Constant. So you are maybe better off without changing it's permissions.

WolfPack 491 Posting Virtuoso Team Colleague

Boy oh boy. We've got a rather humourless lot in here recently.

WolfPack 491 Posting Virtuoso Team Colleague

Or my favorite
4) How many females are in this male-dominated field, and is it time to make plans to crush the opposition?

Or...
5) You are a guy looking for single girls near your residence area:twisted:

WolfPack 491 Posting Virtuoso Team Colleague

And I like phi.

After "Da Vinci Code" who wouldn't?

WolfPack 491 Posting Virtuoso Team Colleague

One of these days Dani, you will find that the web page is not wide enough to accomodate your stars.

WolfPack 491 Posting Virtuoso Team Colleague

Sulley's Boo, you're a woman??

Okay. Girl then. You are correct. Woman sounds old.

WolfPack 491 Posting Virtuoso Team Colleague

You don't even know me :mad: how can you say that huh?

take this *TISH* and yea i am a "software engineer"

<_<

Moral: Don't mess around with arab women:mrgreen::cheesy::mrgreen::cheesy::mrgreen::cheesy::mrgreen::cheesy:

WolfPack 491 Posting Virtuoso Team Colleague

I don't think so?

Avatars decieve?

WolfPack 491 Posting Virtuoso Team Colleague

I WANT ONE!!!!!!!

Seriously- I've been trying to find a stuffed (toy, of course) Wombat, but U.S. stores just don't seem to stock them. Gee- go figure.

I even had one of our Australian members offer to send me a stuffed Wombat as a thank you gift for helping him fix his 'puter, but it just didn't happen. :sad:

Oh. I thought you were an Australian yourself.

WolfPack 491 Posting Virtuoso Team Colleague

Nor I.

WolfPack 491 Posting Virtuoso Team Colleague

My brother used to be called wombat by his friends at school. Nobody ever knew why.

They must have known somehow that he was your brother.

WolfPack 491 Posting Virtuoso Team Colleague

Yeah, Humourless ...... :cheesy: . Didnt even know that Wombats were such cool species until DMR came along. Now I wanna be one in the next life.

They don't get eaten by others do they? :eek: Cos upto now I have been doing the eating. Can't bear to have the tables turned in the next life.

~s.o.s~ commented: Aww man will seriously miss you, take care while you are gone *sniff* ~s.o.s~ +7
WolfPack 491 Posting Virtuoso Team Colleague

hey, you do exactly what i do....:p...give me five

he he. Yeah. I haven't read any of my reference books until the last chapter. That includes my C/C++ books too.:eek:

When exams are close at hand, I usually do an all nighter and go through my lecture notes and punt my way around the exam paper. It helps that I have read the introductory parts because then I have a birds eye view about what the subject is all about. That enables me to add meat to my barebones answer.:twisted:

WolfPack 491 Posting Virtuoso Team Colleague

1. pick up the book (of course)
2. Read the preface, introduction, Chapter 1
3. Fall asleep
4. Repeat 1 -3 infinitely, occationally wandering to Chapter 2 and maybe 3.

Sulley's Boo commented: hehe =D thankO +2
WolfPack 491 Posting Virtuoso Team Colleague

If you have 5 numbers the main cause shold be a out of bounds error. Use the below.

for (a=0;a<4;a++)
{
for (b=a+1;b<4;b++)
{

Edit:
No. Sorry. My mistake. Your code is correct. I got carried away by the <= sign. As Salem says, the error should be elsewhere.

WolfPack 491 Posting Virtuoso Team Colleague

Another wombat here. Actually that is the only option. I hate them both.
One is gay. The other is better looking than I am. Well... both of them are.

WolfPack 491 Posting Virtuoso Team Colleague

I hate any type of carbonated water.

WolfPack 491 Posting Virtuoso Team Colleague

If you get 192.168.1.65 as the server local IP address, inputting that instead of 127.0.0.1 in the client code will get you connected to the server address.

e.g in the client code

char * serverAddress="192.168.1.65";
WolfPack 491 Posting Virtuoso Team Colleague

I read about this a few weeks ago, in the words of Microsoft (paraphrased): "All Windows users will be able to download security patches and service packs no matter the authenticity of their Windows software, while premium downloads such as IE7 will not be authorized to illegal versions."

Why this is exactly I don't know. Perhaps as punishment ? :rolleyes:

Yes. That is what I know too. Maybe MS doesnt think that IE6 is so much a security risk as people make us believe.:-|

WolfPack 491 Posting Virtuoso Team Colleague

So that the pirates can't get the better software :rolleyes:

Okay, so why the other updates then?

WolfPack 491 Posting Virtuoso Team Colleague

I think IE7 can only be installed on genuine Windows machines. Wonder why such a important upgrade isnt given free. There are a lot of pirated copies out there.

WolfPack 491 Posting Virtuoso Team Colleague

Okay. As you know, the two protocols are the TCP/IP and UDP protocols. TCP creates a connection that is valid throughout the time the server and client corresponds with each other. Like a telephone conversation. But UDP sends packets to an address, and there is no connection that is valid after the data packet is delivered. This is more like sending a letter through mail. The postman delivers it only if there is something to be delivered.

The difference between recv and recvfrom is that they use 2 different protocols. recv uses TCP/IP and recvfrom uses UDP. You can do what you want to do using both the protocols. At any rate you shold know the server IP address.

From what I gather from your previous posts, you are behind a router, but there are 2 computers that use the router to connect to the internet. So the outside world only knows the router, so they see only one IP address. However, both your computers should have 2 different local IP addresses. You can use them as the server and client IP addresses. Try typing "ipconfig" at the command prompt of the 2 computers. You should get the IP addresses of the server and client. If you substitute 127.0.0.1 with the server local IP address, you should be able to connect to the server using the client code.

WolfPack 491 Posting Virtuoso Team Colleague

Gosh this is one long birthday. This is the only thread I know that is active 365 days of the year:mrgreen: . Do you fellas know when her actual birthday is? Cos I just checked the forum index and it aint today...:confused:

WolfPack 491 Posting Virtuoso Team Colleague

Ah yeah. Worked fine. Thanks.

WolfPack 491 Posting Virtuoso Team Colleague

I like IE7. IE6 sucks. Only used Firefox whenever possible when it was IE6. Made sure that FF was my default browser too. But right now, I use IE7 as much as FF. Out of habit, sometimes I click the FF button in the quick launch panel, but now the default browser is IE7. If I could only transfer my bookmarks from FF to IE7. :-|

WolfPack 491 Posting Virtuoso Team Colleague

Sorry about the delay in the replies. I only look at unanswered threads, so when there were about 3 replies, I skipped the thread. If you hadn't bumped the thread, I probably would have taken a look and replied sooner. Anyway the error is in this line of the server code.

ret = recv(listeningSocket,buffer,256,0);

change it to

ret = recv(client,buffer,256,0);
WolfPack 491 Posting Virtuoso Team Colleague

I like WaltP's colour scheme.

WolfPack 491 Posting Virtuoso Team Colleague

That's already all figured out. It's just a matter of what colors to use where. What about php default syntax highlighting colors?

Nope. The comments are pink. As Iamthwee said, I want the comments in green too. Do not italic them or grey out them. It is a bit of a strain on the eye to read the present C/C++ comments.

WolfPack 491 Posting Virtuoso Team Colleague

But it doesnt come with a compiler right? Don't you have to set a compiler that you have installed seperately?

Edit. No I checked you have the MingW compiler. Me bad.

WolfPack 491 Posting Virtuoso Team Colleague

he he. Since you are trying to learn C or C++ I think it is better if you stick to a new compiler.
Get the Visual C++ Express Edition (A bit bulky download) or
DevCPP or
Visual Studio 2003 Command Line Toolkit (A command line compiler)

BUt still you havent answered Wolfies question -- what are you giong to develop usign that ?

Assuming that you want to learn C/C++.

WolfPack 491 Posting Virtuoso Team Colleague

Is Visual Studio 97/5.0 (its called both) any good?

Depends on what you are going to use it for. So nothing can be said exactly about it. But remember that it is not C99 standard compliant, so if you are going to use it you will find a lot of features unsupported. If you are going to pay for it, I would advice against it. If you are getting it free, and if you think it will suit you, I wouldn't say no.

But the Visual Studio 2005 Express Edition is much better and free. So I usually recommend it.

WolfPack 491 Posting Virtuoso Team Colleague

:cheesy:

WolfPack 491 Posting Virtuoso Team Colleague

Oh dear. Looks like I missed a lot of fun while I was sleeping.

I have a temper and a rebel soul that sometimes gets wrongly interpreted. I tend to engage in debate quite passionately, but never in a negative prefix. If I had such negative thoughts and opinions, believe me, I wouldn't have bothered to post them at all.

I apologize for my tone was misunderstood for angry or flamboyant.
I apologize if my opinions were taken as piracy-endorsing.

Not needed. We appologize for the misunderstanding.

I also apologize for abusing daniweb by creating the alternate account, and thus bypassing the ban. You have to understand that it is very unpleasant feeling not being able to speak, especially after (wrongful) accusation.

I think it was the misunderstanding in our part that prompted you in the first place. So I don't think any apology is necessary.

Personally I enjoy your point of view. You have created some wonderful topics and the ideas you give are sometimes absolutely awesome. It is always nice to know what people think of about Open Source, Microsoft, Apple. Any reply I gave was not meant as a flame, but to clear my own doubts regarding this concept. Anyway I am extremely sorry and a bit surprised that a good natured discussion led to this. I have seen worse. I sincerely hope you will not decide to leave, and thereby taking with you a unique character that can contribute to the vast pool …

WolfPack 491 Posting Virtuoso Team Colleague

Quick replies:
- All drivers are free of charge. It is in the hardware manufacturer's interest that they remain free of charge. If you download driver for the hardware that you don't have, you won't be regarded as a pirate.

If you haven't bought the hardware, why would you be downloading the driver?

- MS DOS 1.0 did evolve into Windows ME. Only every stage of evolution was rigorously charged for. Windows NT 3.51 (followed by NT4, XP, Vista) are not related to the MS-DOS 1.0 - Windows ME. They are completely different architecture. And NOT genuine Microsoft design.

- DirectX drivers are originally based on Windows NT. Same concept of drivers are then transferred to the MS DOS based Windows branch (95, 98, ME). I repeat, NOT genuine Microsoft concept.

- More fitting metaphor for Microsoft Windows would be "the road for General Motors cars".

It maybe my poor english, but I dont understand what you are trying to say here. How come that something not being a genuine microsoft concept keeps them from making money from it? And if it is a completely different architecture, then isn't it, as Dragon said, a different OS?

- Then why is Vista being introduced? What is the message with Vista? ("Buy our brand-new OS!" that reads:"Our old OS isn't good for you!")
I know that XP is somewhat good OS, but why do I HAVE to buy Vista? Because I plan to use my PC, or whatever PC …