Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!

Zulfi Khan

Ranch Hand
+ Follow
since Jun 05, 2016
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Zulfi Khan

I created the following program through stack exchange and through guidance.

I did not try it for text file but how can i set 500 x 500 dimension?

Somebody please guide me.
2 months ago
Hi my friend,

I tried using Pycharm 3.2 community version on my linux system:

I am getting following error:

File "<fstring>", line 1
   (pageFaults = )
SyntaxError: invalid syntax

Sorry I can't solve this syntax error.

Somebody please guide me.

2 months ago
Hi Travis Risner-Good Morning,

Thanks for your program.

I have two questions:

On which OS did you run your program: windows or Unix/Linux?

What is the value for i in Print_Numbers(...) ?

2 months ago

Please show me your whole code so that I can understand it.

2 months ago
Thanks for your reply.

Can python integer variables hold values greater than 66000?

2 months ago
I am trying to display cpu utilization. I am getting zero value for it.

I am trying to run my sorting program with 1 million integers but my system hangs up.

I am using following following command:

In the above code, I am trying to run my selection sort program with 1000000 integers
How to solve this problem in Python?
Is there any size limitation with integers in python?
2 months ago

I am getting zero with cpu utilization. I have changed the code to this:

But still I am getting zero.

Somebody please guide me.

2 months ago

Thanks a lot.

I executed the following program:

Following is the  output but cpu usage is zero:

memory usage= 12099584
sdiskusage(total=982900588544, used=141398872064, free=791501631488, percent=15.2)
virtual mem=  11815522304
rss= 12099584

Can you please tell me why cpu usage is zero? How can i get some value for cpu usage?

Also for page faults, the following link says that:

OS(X) and windows, for linix its shared? What does it mean?

Somebody please guide me.

2 months ago

I am trying to display system information using psutil.

I am now getting following error:

Traceback (most recent call last):
 File "/home/zulfi/PycharmProjects/Classes/", line 31, in <module>
 File "/home/zulfi/PycharmProjects/Classes/", line 27, in main
 File "/home/zulfi/PycharmProjects/Classes/", line 16, in system_info
   mem = process.get_memory_info()[0] / float(2 ** 30)  # memory in GB
AttributeError: 'Process' object has no attribute 'get_memory_info'

My code is listed below:

I have provided the comments from where I retrieved the information.

Somebody please me how to run this program.

2 months ago
Hi my friend,

What's the value of the netbeans_javahome property in the netbeans.conf file in your NetBeans etc folder?

Yes I tried everything. But sorry this did not work. Always I was getting the same screen which I posted earlier.  You know know this problem was also on StackExchange and there solution was also not direct. They were doing lots of things. My friend used a tool to remove Netbeans from registry and it was pretty simple.

Thanks for your concern.

2 months ago
Thanks for providing me this explanation.
By now I have corrected my code but your comments are good.

I have not tried to execute your code but I have one question for line#25 of your code:

I actually realized my mistake. Argument of "range" starts from 0 and goes up to "n-1", so there is no need of explicitly doing (self.n-1), so I changed it to (self.n).

You might have better reasons for doing this.

Your help is appreciable.

God bless you.

2 months ago
I installed JDK latest version on C drive but still I can't remove NetBeans. I declared all the variables. However, this problem is now solved by removing NetBeans entries from the registry. Of course I called somebody to help me.

2 months ago
I am trying to write a program for selection sort. I got an example program:

I have written the following code:

import random

class SSSort:
  arr = [] # class var access by className.arr
  def __init__(self, n):
     self.n = n

  def generate1000_5digit_RandomNum(self):
     for i in range(self.n):
        num = random.randint(10000, 99999)

     for j in range(self.n):
        print("random {0}".format(SSSort.arr[j]))

  def find_the_min_element(self, i):
     min = i
     for j in range(i+1, self.n-1):
        if (SSSort.arr[j] < SSSort.arr[min]):
           min = j
     return SSSort.arr[min]

  def selectionSort(self):
     for i in range(self.n-1):
        min = self.find_the_min_element(i)
        #swap min and ith element of array
        temp = min
        min = SSSort.arr[i]
        SSSort.arr[i] = temp
     for i in enumerate(SSSort.arr):

  def main(self):

if __name__ == "__main__":
  objSSSort = SSSort(20)

I am getting the following output:

random 98046
random 21192
random 50964
random 81034
random 87750
random 50619
random 32092
random 52373
random 70434
random 61962
random 67618
random 87543
random 91959
random 25470
random 13246
random 37841
random 87932
random 40889
random 64008
random 94949
(0, 13246)
(1, 13246)
(2, 13246)
(3, 13246)
(4, 13246)
(5, 13246)
(6, 13246)
(7, 13246)
(8, 13246)
(9, 13246)
(10, 13246)
(11, 13246)
(12, 13246)
(13, 13246)
(14, 13246)
(15, 37841)
(16, 40889)
(17, 40889)
(18, 64008)
(19, 94949)

I think there is problem with swapping.

Somebody please guide me how to correct the above program;

2 months ago
Thanks for your update.

I thought I created an unsized array, but actually its an empty array.

So I can't use indexes with it.
God bless you.

2 months ago

I have created the whole code on my own. I am trying but I can't understand the concept of paramter passing.

I am trying but how much time I can spend on it.

I don't have infinite time.

2 months ago