Skip to main content

Posts

error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory

compile and install : wget http://archive.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng_1.2.54.orig.tar.xz tar xvf libpng_1.2.54.orig.tar.xz cd libpng-1.2.54 ./autogen.sh ./configure make -j8 sudo make install then update the links with: sudo ldconfig                                    demo root@kali:~/Documents/games/dofus-amd64/Dofus/transition# wget http://archive.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng_1.2.54.orig.tar.xz --2019-05-20 23:31:05-- http://archive.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng_1.2.54.orig.tar.xz Resolving archive.ubuntu.com (archive.ubuntu.com)... 91.189.88.161, 91.189.88.149, 91.189.88.162, ... Connecting to archive.ubuntu.com (archive.ubuntu.com)|91.189.88.161|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 571448 (558K) [application/x-xz] Saving to: ‘libpng_1.2.54.orig.tar.xz’ libpng_1.2.54.o...

Input and Output hackerrank

Input and Output     #include < cmath > #include < cstdio > #include < vector > #include < iostream > #include < algorithm > using namespace std; int main() { int a, b, c, d; cin >> a>>b>> c; d = a+b+c; cout<< d; return 0 ; }  

C++ Program for Bubble Sort

C++ Programming Code for Bubble Sort #include<iostream> using namespace std; int main() {     int a[50], n,i,j,tmp;     cout<<"enter size of array";     cin >>n;     cout<<"enter array elements";     for (i=0; i<n;i++)     {         cin>>a[i];     }     for(i=1;i<n;i++)     {         for(j=0;j<(n-i);j++)             if(a[j]>a[j+1])             {                 tmp=a[j];                 a[j]=a[j+1];                 a[j+1] =tmp;            ...

C++ Program to Add 3X3 Two Matrix using for loop

A Simple C++ program to add two Matrices   #include<iostream> using namespace std; int main() {     int a[3][3], b[3][3], ab[3][3];     int z=3, x=3;     cout<<"\nEnter elements of 1st matrix:\n";     for(int i=0; i<z; i++)     {         for(int j=0; j<x; j++)         {             cin>>a[i][j];         }     }     cout<<"\nEnter elements of 2st matrix:\n";     for(int i=0; i<z; i++)     {         for(int j=0; j<x; j++)         {             cin>>b[i][j];         }     }     //Adding Two matrices   ...

Bypassing website blocking/censorship without VPN/PROXY

FIREFOX STEPS -    1. Type  about:config on the url bar. 2. Search for network.trr, change network.trr.mode to 2 3. Search for network.security.esni.enabled and set it to true     (These steps MAY won't work if you are in a workplace and the employer has installed his own certificate on the machines and uses a ssl proxy in conjunction with the firewall)

Caesar cipher Decryption( C++)

 Caesar cipher Decryption #include <iostream> #include <string> #include <iterator> using namespace std; int main() {         string a;     string v;     int k = 0;     const int b =1;     cin >> a;     for(int j =0;j <25; j++)     {                 ++k;         for(int i =0; i<a.length(); i++)       {           v= ((a[i]+ k +65)%26 +65);           cout <<v;               }             cout << "\n";             }         }

Pointer -hackerrank (challenges writeup)

Pointer -hackerrank (challenges writeup)  Pointer https://www.hackerrank.com/challenges/c-tutorial-pointer/problem #include<iostream> using namespace std; void func(int *z,int *f) {    int aa = *z;    *z = *z + *f;    *f = aa- *f;       if(*f < 0)*f *= -1;    } int main() {     int a, b;     int *pa = &a, *pb = &b;     cin >> a>> b;     func(pa,pb);     cout <<a<<endl;     cout<< b; }

MODERN ABC+ ebook part-1 (DOWNLOAD)

for part-2 or for good quality contact at twitter- https://twitter.com/AdityaRoCk34 LINK PART 1 ----  https: //drive.google.com/file/d/1v02QrW1tyq8v_W_enu92sZdFVG-kNg0w/view?usp=sharing

pyobjc-core pip install error python setup.py egg_info" failed with error code 1 in /tmp/pip-build-io5g0t31/pyobjc-core/ [FIX]

ERROR---  sudo pip3 install pyobjc-core  Collecting pyobjc-core   Downloading https://files.pythonhosted.org/packages/7d/0f/2886aab903aa3971674b68d3fc27cdb292ea07fac2118da0463af113274a/pyobjc-core-5.0.tar.gz (790kB)     100% |████████████████████████████████| 798kB 86kB/s     Complete output from command python setup.py egg_info:     running egg_info     error: PyObjC requires macOS to build         ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-io5g0t31/pyobjc-core/ FIX----- On Linux, this is: pip3 install python3 - xlib sudo apt - get install scrot sudo apt - get install python3 - tk sudo apt - get install python3 - dev pip3 install pyautogui

tesserocr PIP ERROR ON LINUX [FIX]

FIX FOR THIS ERROR---  Collecting tesserocr   Using cached https://files.pythonhosted.org/packages/f8/6d/4e81e041f33a4419e59edcb1dbdf3c56e9393f60f5ef531381bd67a1339b/tesserocr-2.3.1.tar.gz Building wheels for collected packages: tesserocr   Running setup.py bdist_wheel for tesserocr ... error   Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-dkMND5/tesserocr/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpLxXWiTpip-wheel- --python-tag cp27:   pkg-config failed to find tesseract/lept libraries: Package tesseract was not found in the pkg-config search path.   Perhaps you should add the directory containing `tesseract.pc'   to the PKG_CONFIG_PATH environment variable   No package 'tesseract' found     Failed to extract tesseract version from executable: [...

Functions c++ - hackerrank

  https://www.hackerrank.com/challenges/c-tutorial-functions/problem #include <iostream> #include <cstdio> using namespace std; int max_of_four(int a, int b, int c, int d) {    if (a >= b &&  a>=c && a>=d)       return a;    else if(b>=a && b>=c && b>=d )       return b;    else if(c>=a&& c>=b && c>= d)       return c;    else       return d; }; int main() {    int a,b,c,d;    scanf("%d %d %d %d", &a, &b, &c, &d);     int vv = max_of_four(a,b,c,d);     printf ("%d", vv);     return 0; }

For Loop - c++ hackerrank

For Loop https://www.hackerrank.com/challenges/c-tutorial-for-loop/problem #include <iostream> using namespace std; int main() {    int a, s,i;    cin >>i;    cin>> a;    for(i; i<=a; i++)    {       if(i==1)       {          cout<< "one\n";       }       else if(i==2)       {          cout<< "two\n";       }       else if(i==3)       {          cout<< "three\n";       }       else if(i==4)       {          cout<< "four\n";    ...

Conditional Statements C++ - hackerrank

https://www.hackerrank.com/challenges/c-tutorial-conditional-if-else/problem #include <bits/stdc++.h> using namespace std; int main() {     int n;     cin >> n;         //cin.ignore(numeric_limits<streamsize>::max(), '\n');      if(n == 1)       cout << "one";    else if(n == 2){       cout << "two";    }    else if(n== 3){       cout << "three";    }    else if(n == 4){       cout << "four";    }    else if(n == 5){       cout << "five";    }    else if(n == 6){       cout << "six";    }    else if(n ==7){       cout << "seven";    }    else if(n ...

Basic Data Types C++ - hackerrank

Basic Data Types  https://www.hackerrank.com/challenges/c-tutorial-basic-data-types/problem #include <iostream> #include <cstdio> using namespace std; int main() { int i; long l; char c; float f; double d; scanf("%d %ld %c %f %lf", &i, &l, &c, &f, &d); printf("%d\n%ld\n%c\n%0.3f\n%0.9lf\n", i, l, c, f, d); return 0; }

Codewars — Sum of the first nth term of Series

Your task is to write a function which returns the sum of following series upto nth term(parameter). Series: 1 + 1/4 + 1/7 + 1/10 + 1/13 + 1/16 +... Rules: You need to round the answer to 2 decimal places and return it as String. If the given value is 0 then it should return 0.00 You will only be given Natural Numbers as arguments. Examples: SeriesSum(1) => 1 = "1.00" SeriesSum(2) => 1 + 1/4 = "1.25" SeriesSum(5) => 1 + 1/4 + 1/7 + 1/10 + 1/13 = "1.57"     My Solution     #include <iostream> #include <iomanip> using namespace std; class ta { float ar[50]; int j,f,k,q; float sum=0.00; public: void taa(int k) { f = k; } void paa() { for(j=0; j<f; j++) { ar[j] = 1.00/(1 + j * 3); } } void baa() { for(q=0; q<f; q++) { sum = sum+ar[q]; } cout <<setprecision(3)<< sum; ...
#include<iostream> using namespace std; int main() {    int a[3][3], b[3][2], ab[3][2], i,j,k;    int sum=0;    cout<<"enter 1st matrix"<<endl;    for (i=0; i<3; i++)    {       for (j=0; j<3; j++)       {          cin >>a[i][j];       }    }    cout<<"enter 2nd matrix"<<endl;    for(i=0; i<3; i++)    {       for(j=0; j<2; j++)       {          cin>>b[i][j];       }    }    for(i=0; i<3; i++)    {       for(j=0;j<2; j++)       {          sum=0;          for...

snap run spotify cannot change profile for the next exec call: No such file or directory snap-update-ns failed with code 1: No such file or directory [FIXED]

ERROR  snap run spotify cannot change profile for the next exec call: No such file or directory snap-update-ns failed with code 1: No such file or directory  Soutions-- snap run spotify cannot change profile for the next exec call: No such file or directory snap-update-ns failed with code 1: No such file or directory open terminal and paste these coammand  systemctl status apparmor      # "Yup, dead apparmor"      systemctl restart apparmor      snap restart lxd                             other snap error fix--   error:cannot list snaps: cannot communicate with server:Get http://localhost/v2/find?q=:dial unix /run/snapd.socket:connect:no such file or directory (fixed)  

C++ sizeof Operator

    #include <iostream> using namespace std ; int main () { cout << "Size of char : " << sizeof ( char ) << endl ; cout << "Size of int : " << sizeof ( int ) << endl ; cout << "Size of short int : " << sizeof ( short int ) << endl ; cout << "Size of long int : " << sizeof ( long int ) << endl ; cout << "Size of float : " << sizeof ( float ) << endl ; cout << "Size of double : " << sizeof ( double ) << endl ; cout << "Size of wchar_t : " << sizeof ( wchar_t ) << endl ; return 0 ; }     command sizeof ( ***** )       output

what is difference between signed integers and unsigned integers

  difference between signed integers and unsigned integers         A signed integer is one with either a plus or minus sign in front. That is it can be either positive or negative. An unsigned integer is assumed to be positive . This is important in computing because the numbers are stored (usually) as a fixed number of binary digits. For a signed integer one bit is used to indicate the sign - 1 for negative, zero for positive. Thus a 16 bit signed integer only has 15 bits for data whereas a 16 bit unsigned integer has all 16 bits available. This means unsigned integers can have a value twice as high as signed integers (but only positive values). On 16 bit computers this was significant, since it translates to the difference between a maximum value of ~32,000 or ~65,000. On 32 bit computers its far less signifocant since we get 2 billion or 4 billion. And on 64 bit computers it becomes of academic interest.    

File "./setup.py", line 4, in from setuptools import setup ModuleNotFoundError: No module named 'setuptools'

Traceback (most recent call last):   File "./setup.py", line 4, in <module>     from setuptools import setup ModuleNotFoundError: No module named 'setuptools' FIX- Distribute has been merged with setuptools 0.7, so just get setuptools for both Python 2.7 and 3.x To install this on Debian: sudo apt - get install python - setuptools For Python 3.x sudo apt - get install python3 - setuptools       If you have Python 2 >=2.7.9 or Python 3 >=3.4 installed from python.org, you will already have pip and setuptools, but will need to upgrade to the latest version: On Linux or OS X: pip install - U pip setuptools On Windows: python - m pip install - U pip setuptools

During startup program exited with code 127 - GDB TOOL [FIXED]

  Cannot exec During startup program exited with code 127 - GDB TOOL [FIXED] root@kali:~/Desktop# gdb main GNU gdb (Debian 7.12-6+b1) 7.12.0.20161007-git Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.  Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from main...done. (gdb) r Starti...