Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Showing results 1 to 40 of 61
Search took 0.01 seconds; generated 7 minute(s) ago.
Search: Posts Made By: Moldz
Forum: Coder's Corner Lounge Jun 13th, 2006, 5:16 PM
Replies: 127
Views: 2,745
Posted By Moldz
Brazil or Argentina

Brazil or Argentina
Forum: Python Aug 28th, 2005, 9:26 AM
Replies: 19
Views: 440
Posted By Moldz
BTW - you could use the float() function to...

BTW - you could use the float() function to change the integer into a real number for division:
>>> x = 12
>>> y = 5
>>> x/y
2
>>> x/float(y)
2.3999999999999999
Forum: C Aug 26th, 2005, 9:47 AM
Replies: 8
Views: 284
Posted By Moldz
What happens when you are actually expecting a...

What happens when you are actually expecting a zero? How would you know if there was an error?
Forum: Python Aug 23rd, 2005, 9:32 AM
Replies: 6
Views: 412
Posted By Moldz
I think the mid function returns a part of a...

I think the mid function returns a part of a string. In python, you can consider a string as a list of characters and use the [] notation to get slices. See this tutorial on Python string handling...
Forum: Python Aug 19th, 2005, 11:07 AM
Replies: 17
Views: 830
Posted By Moldz
The spaces versus {} trips up a lot of...

The spaces versus {} trips up a lot of programmers when they first start using python. But it is amazing how quickly you adjust and then actually start to like it.
Forum: C Aug 11th, 2005, 5:46 PM
Replies: 3
Views: 1,291
Posted By Moldz
Quid pro quo, here's code to convert between...

Quid pro quo, here's code to convert between timestamps in UNIX time_t and Windows FILETIME formats. Worked well in a UNIX box:
/*
* Time conversions.
*/
#include <stdint.h>
#include...
Forum: C Aug 10th, 2005, 6:37 PM
Replies: 3
Views: 1,291
Posted By Moldz
Thanks alot The Dark! For some reason, some of...

Thanks alot The Dark! For some reason, some of my results are just not working. Very strange...
Forum: C Aug 9th, 2005, 10:44 PM
Replies: 3
Views: 1,291
Posted By Moldz
Windows FILETIME examples

I created a function that converts between a Windows FILETIME timestamp and a UNIX time_t timestamp.

My problem is that I don't have a Windows machine that I could use to come up with some test...
Forum: Python Aug 4th, 2005, 4:58 PM
Replies: 32
Views: 1,068
Posted By Moldz
Here's a perfect example. Microsoft is trying to...

Here's a perfect example. Microsoft is trying to make sure that no one uses a pirated version of Windows. Their new program has only been out for a week and has already been cracked twice...
Forum: Python Aug 4th, 2005, 4:55 PM
Replies: 32
Views: 1,068
Posted By Moldz
I don't pirate games either, but that doesn't...

I don't pirate games either, but that doesn't mean I don't understand the security issues surrounding them.

You need to realize that a program is just a file on a computer. If you think of it as...
Forum: Python Aug 3rd, 2005, 12:21 PM
Replies: 32
Views: 1,068
Posted By Moldz
Actually, anything in a program can be changed,...

Actually, anything in a program can be changed, not just the strings. Someone could use a debugger to figure out where your program is getting the password or simply add some instructions (in...
Forum: Coder's Corner Lounge Jul 22nd, 2005, 8:53 AM
Replies: 23
Views: 762
Posted By Moldz
You can make it as expensive or as cheap as you...

You can make it as expensive or as cheap as you need. I find that you usually spend about the same as buying retail except you end up with a better machine made out of quality parts.

The hardest...
Forum: Coder's Corner Lounge Jul 12th, 2005, 1:07 PM
Replies: 2
Views: 147
Posted By Moldz
Vocab! It really helps in all the non-math...

Vocab! It really helps in all the non-math areas. You simply can't do some of the sections if you don't know what a word means. All those books should have word lists for you to memorize. Start...
Forum: Python Jul 11th, 2005, 10:14 AM
Replies: 15
Views: 664
Posted By Moldz
I'm not sure, what does the man page say? You...

I'm not sure, what does the man page say? You could run a little test. When you know there are some NIS clients logged in, run the "who" program. It does exactly what I suggested, it reads the...
Forum: Python Jul 6th, 2005, 9:51 AM
Replies: 15
Views: 664
Posted By Moldz
Ok then, check out /etc/init.d, it is full of...

Ok then, check out /etc/init.d, it is full of scripts that start programs on boot. They are somewhat simple bash scripts, I would make a copy of one of them and change what you need. Then use the...
Forum: Python Jul 5th, 2005, 4:55 PM
Replies: 9
Views: 407
Posted By Moldz
Excuse me for missing the EXACT EXAMPLE from the...

Excuse me for missing the EXACT EXAMPLE from the hundreds of lines of code in this thread.

You could use a list to store all the layers then use the tuple() function to convert it to a tuple...
Forum: Python Jul 5th, 2005, 3:03 PM
Replies: 9
Views: 407
Posted By Moldz
Why not just use a list? Tuples don't have...

Why not just use a list? Tuples don't have append() functions because you are not supposed to change a tuple once it is created. In other words, tuples are "immutable" and for that reason they are...
Forum: Python Jul 5th, 2005, 2:52 PM
Replies: 15
Views: 664
Posted By Moldz
What *nix are you using? FreeBSD is very...

What *nix are you using? FreeBSD is very different from RedHat which is different than Gentoo. They all involve creating some type of script.

I'm not sure how you would do that. You could make it...
Forum: Python Jun 28th, 2005, 9:16 AM
Replies: 6
Views: 348
Posted By Moldz
I recommend Dive into Python...

I recommend Dive into Python (http://diveintopython.org/), especially since you have a lot of programming experience. There is a free online version as well as paper one.
Forum: Python Jun 23rd, 2005, 9:53 AM
Replies: 3
Views: 268
Posted By Moldz
Could you explain why round() isn't working? ...

Could you explain why round() isn't working? Works fine for me:
E = [1.1111111111, 2.222222222, 3.33333333, 100.5555555, -341.99]
E = [round(i, 1) for i in E]
for num in E:
print num
It gives...
Forum: Other Programming Languages Jun 15th, 2005, 5:02 PM
Replies: 9
Views: 564
Posted By Moldz
They all share similar concepts, but the details...

They all share similar concepts, but the details are probably very different from lib to lib. Since this is a project for you to learn, here are some options.

If you did want to do a CLI in C, you...
Forum: Python Jun 14th, 2005, 4:22 PM
Replies: 11
Views: 452
Posted By Moldz
I don't know any exact details, but I would think...

I don't know any exact details, but I would think that since Python is an interpreted language, you would need the python interpreter (aka python.exe) bundled with an executable in order to interpret...
Forum: C May 23rd, 2005, 5:59 PM
Replies: 10
Views: 390
Posted By Moldz
Most programming books, especially those that...

Most programming books, especially those that introduce a language, never touch on these subjects. For example, never ever use gets() and always use printf("%s", var) instead of printf(var). Google...
Forum: C May 23rd, 2005, 4:06 PM
Replies: 10
Views: 390
Posted By Moldz
Also, your program has a buffer overflow...

Also, your program has a buffer overflow vulnerability. Whenever you use scanf() to read a string, you should always specify the length of the buffer. In this case it should be:
scanf("%19s",...
Forum: C May 23rd, 2005, 3:44 PM
Replies: 10
Views: 390
Posted By Moldz
And make sure the answer is 42 ;-) What's the...

And make sure the answer is 42 ;-)

What's the point of the outer for loop (the one with for(trigger=0;trigger<1;trigger++) )?
Forum: Python May 19th, 2005, 9:35 AM
Replies: 19
Views: 628
Posted By Moldz
Python can be surprisingly easy to pick up. If...

Python can be surprisingly easy to pick up. If you want to get a good taste of the language before diving into it, try the Instant Python (http://www.hetland.org/python/instant-python.php) tutorial....
Forum: Python May 5th, 2005, 10:04 AM
Replies: 10
Views: 417
Posted By Moldz
Well al1986 already gave you an answer a few...

Well al1986 already gave you an answer a few posts back:

IOW, vars() returns a dictionary of the local symbol table. You could check if it contains the symbols character1, character2, ... by...
Forum: Python May 4th, 2005, 9:45 PM
Replies: 10
Views: 417
Posted By Moldz
Ok, I ran your code and got the NameError...

Ok, I ran your code and got the NameError exception. The quick solution is to just add the following right after the import statement:
character1 = None
character2 = None
character3 =...
Forum: Python May 4th, 2005, 9:29 AM
Replies: 10
Views: 417
Posted By Moldz
How about a more concrete example? For instance,...

How about a more concrete example? For instance, do you have a list of characters that you can iterate through?
if len(charlist) < 4:
# show a warning
Or if you have four variables:
if char1 ==...
Forum: Python May 3rd, 2005, 10:02 AM
Replies: 8
Views: 413
Posted By Moldz
Here's what I did in the python console: >>>...

Here's what I did in the python console:
>>> digit = "5"
>>> type(digit)
<type 'str'>
>>> number = int(digit)
>>> type(number)
<type 'int'>
That should help.
Forum: Python May 2nd, 2005, 4:31 PM
Replies: 8
Views: 413
Posted By Moldz
You are not going to get better if you don't try....

You are not going to get better if you don't try. I wrote the program, it's not too hard. Try it and post any problems you are having. I will start you off:
pernum = '8812210759'
for digit in...
Forum: Python Apr 28th, 2005, 12:42 PM
Replies: 4
Views: 288
Posted By Moldz
Ok, let's say I create a simple python script and...

Ok, let's say I create a simple python script and save it on my desktop. You need to figure out the full path to the file. If your windows login name is nissan and the script is named hello.py, the...
Forum: Python Apr 27th, 2005, 9:12 PM
Replies: 12
Views: 453
Posted By Moldz
I think he's implying that your code is probably...

I think he's implying that your code is probably more "involved" than it would be if you used classes.
Forum: Python Apr 26th, 2005, 7:44 PM
Replies: 3
Views: 334
Posted By Moldz
Nope, pure DOM using a "mini" or light...

Nope, pure DOM using a "mini" or light implementation.
Forum: Python Apr 26th, 2005, 1:45 PM
Replies: 3
Views: 334
Posted By Moldz
It's easier to just showing you some working...

It's easier to just showing you some working code. If you still have questions, repost it.
import xml.dom.minidom

# the xml contents
sheet = """\
<row version="1.0">
<cell>Name</cell>
...
Forum: Coder's Corner Lounge Apr 26th, 2005, 10:34 AM
Replies: 6
Views: 275
Posted By Moldz
I would not recommend an online college. A lot...

I would not recommend an online college. A lot of people do not respect any degree offered by these schools and your education is probably going to be second-rate. Go to a traditional college and...
Forum: Python Apr 25th, 2005, 9:22 AM
Replies: 28
Views: 796
Posted By Moldz
Why not profile the programs? Check out the...

Why not profile the programs? Check out the profile module (http://www.python.org/doc/2.2.3/lib/module-profile.html), it should give you plenty of info on how to measure the programs.
Forum: Python Apr 20th, 2005, 9:48 PM
Replies: 4
Views: 382
Posted By Moldz
Ok, I was intrigued enough to dig a little...

Ok, I was intrigued enough to dig a little deeper. You need to check out the popen2 module.

It allows you to start a program and get a reference to its input and output. It's really easy to read...
Forum: Assembly Apr 19th, 2005, 2:56 PM
Replies: 6
Views: 332
Posted By Moldz
It will definately help you better understand...

It will definately help you better understand some concepts in high level languages. For example, the difference between call-by-reference and call-by-value is a lot clearer after you learn...
Forum: Python Apr 18th, 2005, 6:49 PM
Replies: 12
Views: 453
Posted By Moldz
This code worked for me. What input is giving...

This code worked for me. What input is giving you the exception?
Showing results 1 to 40 of 61

 
Forum Jump



DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:56 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC