Skip to main content

Posts

Mysql function to extract integer from alfa-numeric character

#3 SET GLOBAL log_bin_trust_function_creators=1; DROP FUNCTION IF EXISTS digits; DELIMITER | CREATE FUNCTION digits( str CHAR(32) ) RETURNS CHAR(32) BEGIN   DECLARE i, len SMALLINT DEFAULT 1;   DECLARE ret CHAR(32) DEFAULT '';   DECLARE c CHAR(1);   IF str IS NULL   THEN     RETURN "";   END IF;   SET len = CHAR_LENGTH( str );   REPEAT     BEGIN       SET c = MID( str, i, 1 );       IF c BETWEEN '0' AND '9' THEN         SET ret=CONCAT(ret,c);       END IF;       SET i = i + 1;     END;   UNTIL i > len END REPEAT;   RETURN ret; END | DELIMITER ; SELECT digits('$10.00Fr'); select digits(hod),hod as org from darwindata limit 1; #returns 1000

Code Igniter configuration without index.php, how to configure code igniter without index.php in url

Tag- How to configure code igniter without index.php in url Add Following in your custom domain.  suppose your domain name is xyz.com and your apache configuration file for the same id xyz.conf then add below given-> 1) <VirtualHost *:80>     ServerAdmin webmaster@dummy-host.example.com     DocumentRoot "/Users/devendra.kumarsingh/CodeIgniter"      ServerName xyz.com     ServerAlias www.xyz.com     RewriteEngine On     <Directory /Users/devendra.kumarsingh/CodeIgniter/>         AllowOverride All         Require all granted     </Directory>     #ErrorLog "/private/var/log/apache2/xyz.com-error_log"     #CustomLog "/private/var/log/apache2/xyz.com-access_log" common </VirtualHost> 1A) Change  DocumentRoot according to your path  1B) Change your ServerName and Serv...

Implementing a RESTful Web API with Python & Flask for beginner

Before start working restful api with python with flask run following commands(i am using mac) A) python -m pip install mysql-connecto 1 )   pip install requests  2)  pip install flask-restful 3)  git clone https://github.com/flask-restful/flask-restful.git 4)  python 5)  pip install requests 6)  cd flask-restful/   source bin/activate 8)  python setup.py develop    curl http://127.0.0.1:5000/      curl http://127.0.0.1:5000/aticle      DONE Commands history- lsb_release -a mkdir ~/.virtualenvs pip freeze pip install virtualenvwrapper vim ~/.bashrc mkvirtualenv ashish deactivate ls .virtualenvs/ mkvirtualenv devendra deactivate rmvirtualenv ashish rmvirtualenv devendra mkvirtualenv test deactivate workon test deactivate source ~/.virtualenvs/test/bin/activate deactivate