In the code igniter 3, how is the unique code applied in online nominal payments? - reference

I'm a beginner in programming. please allow me to ask. So I'm making a top up form with Codeigniter 3. I want to give a unique code for each nominal top up. For example, a member will top up 100,000, then what must be transferred is 100,123 (example). how to generate 3 numbers behind it?
Thanks for reading and willing to help

please let me help to answer the question. I think, you just add another php function, for random numbers as needed.
My Example code like this:
<?php
// get top up value from form
$value_top_up = 100000;
// add random number
$value_top_up += rand(100,999);
// example result = 100729
echo $value_top_up;
?>

Related

How to retrieve text by xpath

Hey everyone
I am 15 years old and I'm currently making a python/selenium script that automatically loges in on my school page and goes in to see what homework i have tomorrow.
The way I want it to check if we have received homework is if the text box which is: "LB MAT 86" is something else (because that means we have received homework)
Let me now tell you about my problem:
Picture: https://i.stack.imgur.com/WLjuR.png
But first, let me tell u how my "homework page" is designed and works.
On the picture you see that I have inspected the text: "LB MAT 86".
LB is the abbreviation of my teachers name.
MAT stands for "matematik" with just means math in english.
86 is the class number our class have.
When we get homework our teacher deletes the text "LB MAT 86" and instead writes the homework we get.
My question for you is how can I find the text. The only way I can see how you can find the text is by its location.
The xpath of the text field: //*[#id="sk-diary-notes-container"]/div/div[1]/div/table/tbody/tr[3]/td[3]/text()[1]
The full xpath of the text field: /html/body/div[1]/div[2]/div[3]/div[2]/div/div/div[1]/div/table/tbody/tr[3]/td[3]/text()[1]
OuterHTML:   LB MAT 86
Thanks
driver.find_element_by_xpath("//table[contains(#align,'center')//td[contains(.,'LB MAT 86')]")
Would get the element with text LB MAT 86.
You can add some code to find the current index to check for your code. /tr[i]/td[i]
Try using this xpath
locator = driver.find_element_by_xpath("//table[contains(#align,'center')/tbody/tr[3]/td[3]")
You should get everything including nbsp (non-braking space).
Then split the result and get everything after nbsp;
You did not include html code, only screenshot. Next time include it (or include it now).
After you test the correct locator, try to use split(). It will get the last element from your text divided by space. I am not 100% sure it will work, experiment by yourself.
mystring = locator.text
desired_text = result = mystring.split(' ')[-1]

Is there an equivalent OR logic based from a Variable value in Origen?

I am working on Verigy 93K test program and I have a logic that I would like to know if there's an equivalent code in Origen.
I am working on Verigy 93K test program and I have this logic (IF condition) that I need to insert in my flow.
Basically, I have a variable called 'INSERTION' and this will have different values like 'GCORR', 'VCORR' and others.
I would like to know if there's an equivalent code like this in Origen.
I attached a snapshot, hope that it can help clarify my question more.
In this logic, I would like to check the INSERTION value and if the value is not equal to GCORR or VCORR, the logic should pass, else, fail.
Here is the screenshot:
This pull-request adds an official API for this.
This example would be implemented as:
whenever_any ne(:INSERTION, 'GCORR'), ne(:INSERTION, 'VCORR') do
# Your tests in here
end
That would produce something logically equivalent and which can be re-targeted to other platforms.
If you don't care about that and want to produce exactly as you have it in the above example, then this should work too (where the OR is hard-coded for V93K syntax):
whenever ne(:INSERTION, 'GCORR|VCORR') do
# Your tests in here
end
Here is the preliminary documentation of this feature from the above PR - https://github.com/Origen-SDK/origen_testers/blob/66345c9422d9fa6b2577af20110259e45c2bdd26/templates/origen_guides/program/flowapi.md.erb#L71
I couldn't find api support on flow control or variable values beyond "if/unless_enable" support which can help check for 1 or zero. One way is to use render.
render 'if #INSERTION != "GCORR|VCORR" then'
render '{'
# your code for non-GCORR_VCORR flow
render "} \n else \n { \n } "

How to create a random index in Jolie

I am starting to play around with Jolie I was looking for a way to randomise an index
What include do I need to use, can you create a random integer number?
Thanks for the question and interest in Jolie.
Can you create a random integer number?
Not directly
What include do I need to use?
math.iol
Here my simple code
include "math.iol"
include "console.iol"
main{
random#Math()(randomResult);
randomIndex= int (randomResult*10); // 10 is the maximum index size
println#Console(randomIndex)()
}
I hope this helps
B

Formatting user input with .title() method

Currently, I started to learn programming with Python. Currently, I am tackling my first 'real' project.
The most problems that I seem to find, are based around formatting. I am curious if my code is written understandable. For example:
new_customer = input('Name? \n')
customer = new_customer.title()
I want to make sure all the inputs received are saved with the same format.
Is this the correct way to transform a user's input with the .title() method?
Thank you in advance, I hope that these kind of questions are accepted here!
You can use the same variable:
newcustomer = input('Name? \n').title()
Is this what you mean?

Netlogo: Creating subsets of agentsets of a particular breed

I am still new to Netlogo, but I can not find an explanation for this in the documentation.
I am trying to create a subset of an agentset that only contains one type of breed. It would seem that I could use "with" to perform this, but for some reason that does not work.
This code works:
ask link-neighbors with [shape = "person"][
set pmt (pmt + dist)
]
But this code does not:
ask link-neighbors with [breed = "psngrs"][
set pmt (pmt + dist)
]
How can I create a subset of an agentset with only this particular breed?
Thanks!
This question is showing as unanswered, though Alan gave the correct answer in a comment. So, just so I stop clicking on this thinking it is unanswered, I'm going to reiterate what he said as an answer. Alan, if you add your comment as answer, I'll happily delete mine.
Anyway, just get rid of the quotes around the breed name, like so:
link-neighbors with [breed = psngrs]

Resources