Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- OUTPUT



  Secure Your Go Code With Vulnerability Check Tool

Security vulnerabilities exist in any language and any code, some are written by ourselves, but more are from the upstream dependencies, even the underlying Linux. We have discussed the security protection methods for Go and Kubernetes Image in Path to a Perfect Go Dockerfile and Image Vulnerability Scanning for Optimal Kubernetes Security, in which the security scanning was performed based on generic. As the Go community grows, more and more open-source packages have caused ...

   GOVULNCHECK,GOSEC,GOLANG     2022-10-29 23:43:20

  How to choose JavaScript template engine?

With the increase of density of web front end development, AJAX and JSON are used more and more frequently, it's necessary to use many tags in front end development. You may have a JSON object as below: var data={  email: 'terry.li@gbin1.com,  gender: 'male'  } Then you need to organize the JSON data into page elements. var email, gender;email= ' ' + data.email+ '; gender= ' ' + data.gender + '; $('#contentwrapper‘).append(content).append(gender); The output is very simple: ...

   JavaScript template engine,Template     2012-10-07 07:03:58

  The internals of slice in GoLang

There are 3 components of slice:a) Pointer: Points to the start position of slice in the underlying array;b) length (type is int): the number of the valid elements of the slice;b) capacity (type is int): the total number of slots of the slice. Check the following code: package main import ( "fmt" "unsafe" ) func main() { var s1 []int fmt.Println(unsafe.Sizeof(s1)) } The result is 24 on my 64-bit system (The pointer and int both occupy 8 bytes). In the next example, I will use gdb to poke t...

   GOLANG,SLICE     2019-06-30 02:55:22

  A Peek Inside the Erlang Compiler

Erlang is a complex system, and I can’t do its inner workings justice in a short article, but I wanted to give some insight into what goes on when a module is compiled and loaded. As with most compilers, the first step is to convert the textual source to an abstract syntax tree, but that’s unremarkable. What is interesting is that the code goes through three major representations, and you can look at each of them. Erlang is unique among functional languages in its casual scop...

   Erlang,Peek,Erlang compiler     2012-02-08 10:12:04

  Short SASS tutorial

If you learned CSS before, you should know that CSS is not a programming language. You can use it to design webpage style, but you cannot use it for programming, i.e, CSS is what designer uses, not what programmer uses. Programmer may think that CSS is very troublesome, it has no variables, no conditional statements, it just allows line-by-line description of HTML elementsLuckily, CSS preprocessor appear which makes CSS programmable. The general idea of CSS preprocessor is using a programming la...

   CSS,SASS,programmable,variable,condition,comment     2012-06-22 08:38:18

  Mock Solutions for GoLang Unit Test

In Go development, Unit Test is inevitable. And it is essential to use Mock when writing Unit Tests. Mock can help test isolate the business logic it depends on, enabling it to compile, link, and run independently. Mock needs Stub. Stub function replaces the real business logic function, returns the required result, and assists the test. I involved the related test code for Controllers while writing Kubernetes Operator recently, and there would be mocks for GRPC and HT...

   UNIT TEST,TESTIFY,GOSTUB,GOMOCK     2020-10-31 21:59:15

  JavaScript showModalDialog method

In JavaScript, showModalDialog()  method creates a simple modal dialog box which is a simple html page but when a modal dialog opens, user can't switch to another page until it closes the modal dialog box. Syntax:  window.showModalDialog( url, arguments, feature options); Where url is the URL of page which is to be opened in modal window and arguments are those arguments which we are passing to the modal window and feature options are the attributes set for the modal windo...

   JavaScript,JS,showModalDialog,Example     2011-07-27 10:51:47

  What does super.clone() do?

Object class has a protected clone() method declared to make it possible for all classes make a clone of itself when needed. The clone() is often used when a new instance of the class is needed while at the same time to maintain the same state as the original object. Any class which wants to have clone enabled has to implement the marker interface Cloneable. If a class which implements Cloneable doesn't override the Object.clone() method, the Object.clone() method will be called to just make a b...

   Cloneable,super.clone(),clone,Java     2015-01-07 05:25:52

  Ways to undo wrong Git operations

While using Git to version code, programmers would inevitably perform some invalid operations which are not expected. Sometimes it's difficult to deal with this kind of awkward situations. If the programmer chooses to undo the operation, the programmer needs to bear the risk of deleting something which is not supposed to be deleted if the undo is done improperly. If the programmer leaves it as is, the file needs to be updated again manually with a new commit. In this post, we will try to pr...

   GIT,GIT COMMIT,GIT RESET     2018-07-07 03:28:21

  Python for the Web

Python is the best language in the world for interacting with the web, and I'm going to show you why.This article will give an extremely high level overview of how to use python for the web. There are many ways you can interact with the web using python, and this post will cover all of them. This includes python web scraping, interacting with APIs (Application Programming Interfaces) and running your own python web site using python server software. There are many ways to do all these thing...

   Python,Web,Interaction,Communication,Network     2011-10-19 14:19:11