Why are “pure” functions called “pure”? [closed]

To answer your first question, mathematical functions have often been described as “pure” in terms of some specified variables. e.g.: the first term is a pure function of x and the second term is a pure function of y Because of this, I don’t think you’ll find a true “first” occurrence. For programming languages, a … Read more

Kotlin function declaration: equals sign before curly braces

Despite visual similarity, the idea of these two declarations is completely different. 1. Function declaration without equals sign Function declaration without equals sign is a Unit-returning function (similar to Java’s void functions). What’s inside the curly braces is its body, which gets executed right on the function call. The function can be rewritten with Unit … Read more

How to avoid SQL injection in CodeIgniter?

CodeIgniter’s Active Record methods automatically escape queries for you, to prevent sql injection. $this->db->select(‘*’)->from(‘tablename’)->where(‘var’, $val1); $this->db->get(); or $this->db->insert(‘tablename’, array(‘var1’=>$val1, ‘var2’=>$val2)); If you don’t want to use Active Records, you can use query bindings to prevent against injection. $sql=”SELECT * FROM tablename WHERE var = ?”; $this->db->query($sql, array($val1)); Or for inserting you can use the insert_string() … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)