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
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
3
Received in last 30 days
0
Total given
52
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Zulfi Khan

Hi,
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.
Zulfi.
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.

Zulfi.
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(...) ?

Zulfi.
2 months ago
Hi,

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

Zulfi.
2 months ago
Hi,
Thanks for your reply.

Can python integer variables hold values greater than 66000?

Zulfi.
2 months ago
Hi,
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?
Zulfi.
2 months ago
Hi,

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




But still I am getting zero.

Somebody please guide me.

Zulfi.
2 months ago
Hi,

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)
0.0
virtual mem=  11815522304
rss= 12099584
0.0





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:

https://readthedocs.org/projects/giamptest/downloads/pdf/latest/


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



Somebody please guide me.

Zulfi.
2 months ago
Hi,

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/psutilPrintInfo.py", line 31, in <module>
   obj_Counting_SysInfo.main()
 File "/home/zulfi/PycharmProjects/Classes/psutilPrintInfo.py", line 27, in main
   self.system_info()
 File "/home/zulfi/PycharmProjects/Classes/psutilPrintInfo.py", 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.

Zulfi.
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.

Zulfi.
2 months ago
Hi,
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.

Zulfi.
2 months ago
Hi,
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.


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



https://www.geeksforgeeks.org/selection-sort/



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)
        SSSort.arr.append(num)

     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):
        print(i)


  def main(self):
     self.generate1000_5digit_RandomNum()
     self.selectionSort()

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


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;

Zulfi.
2 months ago
Hi,
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.

Zulfi.
2 months ago
Hi,

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.

Zulfi.
2 months ago