Tutorial by Examples

Requirement is to check if in a form, ‘Online_date’ field is blank or filled. If it is blank, then fill it with current date, on form load. Controller calls ‘$form->createForm()” with type “folder”. In “FolderType”, event subscriber “FolderSubscriber” is added. Controller: $form =...
Let's say you have already created the custom Test Work Orders screen to manage test work orders in your Acumatica ERP application: There is already NoteID field declared in the TestWorkOrder DAC, managed on the Test Work Orders screen: [Serializable] public class TestWorkOrder : IBqlTable { ...
# Enqueue a job to be performed as soon as the queuing system is free. GuestsCleanupJob.perform_later guest
case thing of Cat -> meow Bike -> ride Sandwich -> eat _ -> Debug.crash "Not yet implemented" You can use Debug.crash when you want the program to fail, typically used when you're in the middle of implementing a case ex...
The visible binding will hide an element by applying style="display: none;" to it when the binding evaluate as falsey. <input type="text" data-bind="textInput: name"> <span class="error" data-bind="visible: isInvalid">Required!</span&...
func loginHandler(w http.ResponseWriter, r *http.Request) { // Steps to login } func main() { http.HandleFunc("/login", loginHandler) http.ListenAndServe(":8080", nil) }
// logger middlerware that logs time taken to process each request func Logger(h http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { startTime := time.Now() h.ServeHttp(w,r) endTime := time.Since(startTime) log...
func CORS(h http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { origin := r.Header.Get("Origin") w.Header().Set("Access-Control-Allow-Origin", origin) if r.Method == "OPTIONS" { ...
func Authenticate(h http.Handler) http.Handler { return CustomHandlerFunc(func(w *http.ResponseWriter, r *http.Request) { // extract params from req // post params | headers etc if CheckAuth(params) { log.Println("Auth Pass") // pas...
func Recovery(h http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request){ defer func() { if err := recover(); err != nil { // respondInternalServerError } }() h.ServeHTTP(w , r) }...
16#A8# -- hex 2#100# -- binary 2#1000_1001_1111_0000 -- long number, adding (optional) _ (one or more) for readability 1234 -- decimal
Usually output of a command goes to the terminal. Using the concept of Output redirection, the output of a command can be redirected to a file. So insted of displaying the output to the terminal it can be send to a file. '>' character is used for output redirection. $ pwd > file1 $ cat file...
The commands normally take their input from the standard input device keyboard. Using Input redirection concept, we can have their input redirected from a file. To redirect standard input from a file instead of the keyboard, the '<' character is used. $ cat file1 monday tuesday wednsday th...
The example assumes you have successfully run and fully understand the tutorial of MNIST(Deep MNIST for expert). %matplotlib inline import matplotlib.pyplot as plt # con_val is a 4-d array, the first indicates the index of image, the last indicates the index of kernel def display(con_val, kern...
Install Apache Web Server First step is to install web server Apache. sudo yum -y install httpd Once it is installed, enable (to run on startup) and start Apache web server service. sudo systemctl enable --now httpd Point your browser to: http://localhost You will see the default Apache web s...
type state_t is (START, READING, WRITING); -- user-defined enumerated type
Step 1 : Install the node-inspector package using npm globally on you machine $ npm install -g node-inspector Step 2 : Start the node-inspector server $ node-inspector Step 3 : Start debugging your node application $ node --debug-brk your/short/node/script.js Step 4 : Open http://127.0....
Is raised when you tried to use a variable, method or function that is not initialized (at least not before). In other words, it is raised when a requested local or global name is not found. It's possible that you misspelt the name of the object or forgot to import something. Also maybe it's in anot...
AssertError The assert statement exists in almost every programming language. When you do: assert condition or: assert condition, message It's equivalent to this: if __debug__: if not condition: raise AssertionError(message) Assertions can include an optional message, and you can d...
json_util provides two helper methods, dumps and loads, that wrap the native json methods and provide explicit BSON conversion to and from json. Simple usage from bson.json_util import loads, dumps record = db.movies.find_one() json_str = dumps(record) record2 = loads(json_str) if record is:...

Page 1174 of 1336