I want to insert the maijerG function in mathematica but i'm facing a problem..
this is the function that i want it in the meigerG function formula:
Exp[-s*x]
where x is the variable.
Related
In order to create my own aggregate function, I must :
define an object that have 4 methods.
STATIC FUNCTION ODCIAggregateInitialize( ... ) ...,
MEMBER FUNCTION ODCIAggregateIterate(...) ... ,
MEMBER FUNCTION ODCIAggregateMerge(...) ...,
MEMBER FUNCTION ODCIAggregateTerminate(...)
That means implementing an interface with these 4 functions.
I can now define my aggregate function:
function f (argument integer) return integer using myobject.
to create a polymorphic table function,
I must :
implement a package that implement the funciton describe.
FUNCTION describe (tab IN OUT DBMS_TF.table_t,col IN dbms_tf.columns_t) RETURN DBMS_TF.describe_t;
That means implementing an interface with this function
open,fetch_rows,close are not compulsory.
I can now define a polymorphic table functoin like that
FUNCTION my_ptf(tab IN TABLE,col IN COLUMNS) RETURN TABLE PIPELINED ROW POLYMORPHIC USING my package;
I would like to know if there is other interfaces that I can implement and to do what?
I'm searching a list of these interfaces.
In codeigniter when i am using function $this->db->escape() while insert data, It is adding single quote in database, Can anyone please help why i am getting this issue ?
Here is my code
$data = array('company_id'=>$this->db->escape($companyID),'payor_type'=>$this->db->escape($payor_type),
'payer_type'=>$this->db->escape($payer_type),'insurance'=>$this->db->escape($insurance),
'created_date'=>date("Y-m-d H:i:s"));
$this->db->insert('tb_Payer',$data);
When you use the query builder class to construct your queries the values are escaped automatically by the system so you don't have to use the function $this->db->escape. In your case, each value was escaped by the escape function and the system did it again for each value when executing the insert function.
Now if you want to run custom queries using the function $this-db->query it is a good practice to escape the data like bellow:
$sql = "INSERT INTO table (column) VALUES(".$this->db->escape($value).")";
$this->db->query($sql);
I have the following (private) PL/SQL function (inside PACKAGE) returning the previous month in 'YYYYMM' format:
FUNCTION GET_PREV_MONTH RETURN VARCHAR2 IS
BEGIN
RETURN TO_CHAR(ADD_MONTHS(SYSDATE,-1),'YYYYMM');
END GET_PREV_MONTH;
I need to compare if records are from previous month in several my queries so I wanted to make private function returning previous month. Why I cannot use this return value from GET_PREV_MONTH() function in WHERE clause of my other SQL queries like:
UPDATE mytable t SET t.col=1
WHERE TO_CHAR(t.created,'YYYYMM')=GET_PREV_MONTH();
Oracle says PLS_00231: function 'GET_PREV_MONTH' may not be used in SQL.
If I create this, this works!
UPDATE mytable t SET t.col=1
WHERE TO_CHAR(t.created,'YYYYMM')=TO_CHAR(ADD_MONTHS(SYSDATE,-1),'YYYYMM');
I wanted to make private function returning previous month. Why I cannot use this return value from GET_PREV_MONTH() function in WHERE clause of my other SQL queries
It is a private function - you cannot reference it outside the package.
If you want to use it in SQL then declare it in the package specification so that it is public.
This is private function of this package! This function is used in procedures from the same package. It is not referenced outside this package.
It CANNOT be used in the SQL context if it is not a public function; regardless of whether the SQL is being called from inside or outside the same package.
I tried to eager load a relation:
$tournaments = Tournament::with('numCompetitors')->latest()->paginate(config('constants.PAGINATION'));
My relation in Tournament returns an integer:
public function numCompetitors()
{
return $this->competitors()->count(); // it returns 24
}
With that I get:
Call to a member function addEagerConstraints() on integer
I don't understand why is it failing.
You're doing it wrong. If you want to count relationship, use withCount() with properly defined relationship:
Tournament::withCount('competitors')->latest()->paginate(config('constants.PAGINATION'));
If you want to count the number of results from a relationship without actually loading them you may use the withCount method, which will place a {relation}_count column on your resulting models.
https://laravel.com/docs/5.4/eloquent-relationships#counting-related-models
So I have a nested table
t = { a={},b={},c={},d={}}
..etc
Each item of t has a value in it named F(integer) (a.F, b.F etc)
Using lua table.sort() on t once with my sort function :
local function sort(a,b)
return a.F < b.F
end
Calling the sort once is fine, but if it is called again it throws invalid order function for sorting.
I'm not sure why this is so and what I must do to fix.
Info :
The values and items sorted are not nil (i assert() beforehand to make sure)
solved, it was due to some reference to other items in table t and modifications to values in table t in the sort function. It did not like changing the tables contents inside the function.