This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cpu info mem info by ashok.s.das@gmail.com | |
#reads and parses /proc/cpuinfo and /proc/meminfo to obtain information | |
def parse_cpu_info(): | |
info=dict() | |
try: | |
f=open('/proc/cpuinfo','r') | |
except IOError: | |
return{} | |
while True: | |
line = f.readline() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* reader.c | |
* | |
* Copyright 2022 Ashok Shankar Das <ashok@localhost.localdomain> | |
* | |
* This program is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation; either version 2 of the License, or | |
* (at your option) any later version. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Gambas module file | |
Public Sub Main() | |
Dim l_bound, u_bound As Integer | |
Print "Primes between a range [Note: 1 is special and 2 is even Prime]" | |
Print "Input lower bound (should be greater than 2)" | |
Input l_bound |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//finding n nth root of any number. | |
#include <stdio.h> | |
#include <math.h> | |
#include <complex.h> | |
// find nth root of c and store it in root array | |
void cnroot(complex c, int n, complex *root) | |
{ | |
double m = cabs(c); | |
double th = carg(c); | |
for(int i=0; i< n; i++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* simplex.c | |
* | |
* Copyright(C) 2020 Ashok Shankar Das <ashok.s.das@gmail.com> | |
* | |
* This program is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation; either version 2 of the License, or | |
* (at your option) any later version. | |
* |