Search found 806 matches

by Saman
Thu Feb 01, 2018 10:42 am
Forum: Web programming
Topic: Slug generator for Google Sheets (Excel) Google Docs
Replies: 0
Views: 7135

Slug generator for Google Sheets (Excel) Google Docs

Replace C2 with the text field of yours and place this under Slug field
=LOWER(SUBSTITUTE(REGEXREPLACE(REGEXREPLACE(TRIM(C2),"[^a-zA-Z0-9\s]",""),"\s{2,}"," ")," ","-"))

For MS Excel, you need to either implement REGEXREPLACE or use a more generic form =LOWER(SUBSTITUTE(TRIM(A2), ” “, “-“))
by Saman
Fri Jan 26, 2018 9:50 am
Forum: PHP & MySQL
Topic: How to reset autoincrement field in mySql
Replies: 0
Views: 3593

How to reset autoincrement field in mySql

1. Directly Reset Autoincrement Value Alter table syntax provides a way to reset autoincrement column. Take a look at following example. ALTER TABLE table_name AUTO_INCREMENT = 1; Note that you cannot reset the counter to a value less than or equal to any that have already been used. For MyISAM, if ...
by Saman
Mon Jan 15, 2018 9:04 pm
Forum: PHP & MySQL
Topic: How to convert currency using Google API
Replies: 0
Views: 3621

How to convert currency using Google API

Function: <?php function currencyConverter($from_Currency,$to_Currency,$amount) { $from_Currency = urlencode($from_Currency); $to_Currency = urlencode($to_Currency); $get = file_get_contents("https://finance.google.com/finance/converter?a=1&from=$from_Currency&to=$to_Currency"); $get = explode("<spa...
by Saman
Tue Jan 09, 2018 1:47 pm
Forum: PHP & MySQL
Topic: How to increase simultaneous connections to mySql
Replies: 0
Views: 3673

How to increase simultaneous connections to mySql

Edit mySql config file

Code: Select all

vi /etc/my.cnf
Right after [mysqld] add following line,

Code: Select all

max_connections = 5000
Note that 5000 is for example purpose. Default is 150 (or 100) which suits most of the servers. Edit with care.
by Saman
Tue Jan 09, 2018 1:44 pm
Forum: PHP & MySQL
Topic: How to see current mySql parameters and settings
Replies: 0
Views: 3561

How to see current mySql parameters and settings

Login to mySql server mysql -u username -p Enter your password Then enter following sql SELECT @@GLOBAL.innodb_data_file_path; Now enter following command by changing LIKE part as required mysql> SHOW VARIABLES LIKE 'auto%'; Te above command returns a table such as below. +--------------------------...
by Saman
Sun Jan 07, 2018 10:53 pm
Forum: Linux
Topic: Using netstat in Linux to get number of connections
Replies: 0
Views: 7856

Using netstat in Linux to get number of connections

Using "netstat -a" will give you something sort of like this, tcp 0 0 app.example.com:http 93.184.216.119:16494 SYN_RECV tcp 0 0 app.example.com:http 93.184.216.119:18733 SYN_RECV tcp 0 0 app.example.com:http 93.184.216.119.dsl.mwe:64775 SYN_RECV tcp 0 0 app.example.com:http 93.184.216.119.threembb....
by Saman
Sun Dec 31, 2017 4:11 pm
Forum: PHP & MySQL
Topic: How to generate slug url based on fields in SQL MySql
Replies: 0
Views: 3602

How to generate slug url based on fields in SQL MySql

1. Generate and set slug. In this example, couple of fields are concatenated with a character in middle '-'. UPDATE `table_name` SET `slug` = lower(concat(`field1`, '-', `field2`)), `slug` = replace(`slug`, '.', ' '), `slug` = replace(`slug`, ',', ' '), `slug` = replace(`slug`, ';', ' '), `slug` = r...
by Saman
Tue Dec 09, 2014 5:27 am
Forum: Visual Basic Programming
Topic: VB6 long multiplication overflow fix
Replies: 0
Views: 8755

VB6 long multiplication overflow fix

You know that the good old VB6 has only 32-bit signed integer type. When you multiply two singled integers, the output could overflow signed range. Here is a good solution. Public Function uAdd(ByVal A As Long, ByVal B As Long) As Long Dim lOr As Long, lAnd As Long, P As Long lOr = (A Or B) And &HC0...
by Saman
Tue Dec 09, 2014 1:11 am
Forum: C/C++ Programming
Topic: Nice rounding function for C/C++
Replies: 0
Views: 13332

Nice rounding function for C/C++

I found a nice C/C++ rounding function said to be from IEEE 754. Hope this will be helpful ! /* round_even * * Rounds a number to the nearest digit according to the precision provided. * The tie breaking rule known as round half to even is implemented. * * Prototype: * template <typename T> * T roun...
by Saman
Wed Oct 15, 2014 6:51 pm
Forum: PHP & MySQL
Topic: Creating downloadable CSV files using PHP
Replies: 0
Views: 5353

Creating downloadable CSV files using PHP

CSV (comma-separated values) is the most widely supported format for transferring tabular data between applications. The ability to export data in CSV format is a useful feature for many programs, and is becoming increasingly common in web applications. // output headers so that the file is download...

Go to advanced search