Tampilkan postingan dengan label Coding Security. Tampilkan semua postingan
Tampilkan postingan dengan label Coding Security. Tampilkan semua postingan

Minggu, 14 Mei 2017

How do you distribute python apps

Having created an exemplary application structure of a web site that uses flask, we can continue with taking the first step into preparing the distribution. Altering the Folder Structure In order to package our application well, we need to make some additions to our folder structure. <code>/MyApplication |-- run.py |__ /app |-- __init__.py |-- /module_one |-- __init__.py |-- controllers.py |-- models.py |__ /templates |-- module_one |-- hello.html |__ /static |__ .. |__ . |-- setup.py # Distribution setup file |-- README.txt # Read-me file |-- MANIFEST.in # Distribution manifest file |-- CHANGES.txt # Changes log </code> Alter the folder structure

The post How do you distribute python apps appeared first on Coding Security.


How do you distribute python apps
read more

10 Regular Expressions that every web developer should know

The hardest part is learning the syntax and learning how to write your own regex code from scratch. To save time, I have selected 30 different regex code snippets that you can use in your projects. And since regex is not limited to a particular language, you can apply the following paragraphs in any language from Javascript to PHP or Python. 1 The strength of the password <code class="hljs language-JavaScript">^(?=.*.*)(?=.*)(?=.*.*)(?=.*.*.*).{8}$</code> Testing the strength of a password is often subjective so there is no absolute exact answer. But I feel that this regex is a great starting point if you don’t

The post 10 Regular Expressions that every web developer should know appeared first on Coding Security.


10 Regular Expressions that every web developer should know
read more

Kamis, 11 Mei 2017

What are the uses of the Goto statement in programming

Unlike other selection or branching statements that we have seen so far which branches based on a condition, the goto statement branches unconditionally. That is why the goto statement is also referred to as unconditional jump statement. There are two more unconditional branch statements in C. They are: break and continue. We have already seen the break statement in switch statement. But both break and continue are extensively used inside loops. So, we will discuss about these two unconditional branch statements later. By using the goto branch statement, we can either skip some instructions and jump forward in the program

The post What are the uses of the Goto statement in programming appeared first on Coding Security.


What are the uses of the Goto statement in programming
read more

What are different types of user exceptions in Java Programming

In this article we will learn how to create user defined exceptions (own exceptions) and how to use them in Java programs. Although Java provides several pre-defined exception classes, sometimes we might need to create our own exceptions which are also called as user-defined exceptions. Steps for creating a user-defined exception: Create a class with your own class name (this acts the exception name) Extend the pre-defined class Exception Throw an object of the newly create exception As an example for user-defined exception, I will create my own exception named NegativeException as follows: 1 2 3 4 5 6 7 8 9

The post What are different types of user exceptions in Java Programming appeared first on Coding Security.


What are different types of user exceptions in Java Programming
read more

What are different built-in objects in javascript

To solve different kinds of problems, JavaScript provides various built-in objects. Each object contains properties and methods. Some of the built-in objects in Javascript are: Array Date Math String Number Array object:  The properties available on Array object are: Property Description length Returns the number of elements in the array constructor Returns the function that created the array object prototype Allows us to add properties and methods to an array object Methods available on Array object are: Method Description reverse() Reverses the array elements concat() Joins two or more arrays sort() Sort the elements of an array push() Appends one

The post What are different built-in objects in javascript appeared first on Coding Security.


What are different built-in objects in javascript
read more

Rabu, 10 Mei 2017

How to make threads communicate with each other in java programming

In this article we will learn how to implement inter thread communication i.e how can we coordinate the communication between two or more threads.   Although we can restrict the access of data or code to a single thread at a time by using synchronization, it can’t guarantee the consistent execution of our logic.   As an example let’s consider the conventional Producer-Consumer problem which is generally introduced in Operating Systems course. In this problem Producer process or thread produces items and stores in a queue and Consumer process or thread consumes items from the queue. Note that the Consumer thread should wait

The post How to make threads communicate with each other in java programming appeared first on Coding Security.


How to make threads communicate with each other in java programming
read more

How to accept objects as function arguments

Like variables, objects can also be passed using pass-by-value, pass-by-reference, and pass-by-address. In pass-by-value we pass the copy of an object to a function. In pass-by-reference we pass a reference to the existing object. In pass-by-address we pass the address of an existing object. Following program demonstrates all three methods of passing objects as function arguments: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 #include<iostream> using namespace std; class Student {

The post How to accept objects as function arguments appeared first on Coding Security.


How to accept objects as function arguments
read more

What are different events supported by javascript

The programming which allows computations based on the activities in a browser or by the activities performed by the user on the elements in a document is known as event-driven programming. An event is the specification (essentially an object created by the browser and JavaScript) of something significant has occurred. Examples of events are click, submit, keyup etc. In JavaScript all the event names are specified in lowercase. An event handler (essentially a function) is a set of statements (code) that handles the event. Below table lists most commonly used events and their associated tag attributes: Event Tag Attribute blur

The post What are different events supported by javascript appeared first on Coding Security.


What are different events supported by javascript
read more

Selasa, 09 Mei 2017

5 Programming languages to look out for in 2017

Groovy Groovy is an object-oriented scripting language that was created by Apache Foundation for the Java platform. It appeared first in 2003, however, the first stable release (Groovy 1.0) came out only in 2007. Since then, it has been used by companies such as Netflix, Linkedin, Airbus, and Mastercard. Groovy is dynamically compiled to Java bytecodes, therefore it seamlessly integrates with any Java library. If you’ve already programmed in Java or any other languages that uses the curly-bracket syntax you can learn Groovy relatively quickly. Rust Rust finished first in “The Most Loved” category of Stack Overflow’s 2016 Developers Survey,

The post 5 Programming languages to look out for in 2017 appeared first on Coding Security.


5 Programming languages to look out for in 2017
read more

Here is Simple TensorFlow Application Go Programming Language

Download and extract the TensorFlow C library into /usr/local/lib by invoking the following shell commands: <code><span class="pln"> TF_TYPE</span><span class="pun">=</span><span class="str">"cpu"</span> <span class="com"># Change to "gpu" for GPU support</span><span class="pln">  TARGET_DIRECTORY</span><span class="pun">=</span><span class="str">'/usr/local'</span><span class="pln">  curl </span><span class="pun">-</span><span class="pln">L </span><span class="pun">\</span><span class="pln">    </span><span class="str">"http://ift.tt/2pvysny(go env GOOS)-x86_64-1.1.0.tar.gz"</span> <span class="pun">|</span><span class="pln">  sudo tar </span><span class="pun">-</span><span class="pln">C $TARGET_DIRECTORY </span><span class="pun">-</span><span class="pln">xz </span></code> The tar command extracts the TensorFlow C library into the lib subdirectory of TARGET_DIRECTORY. For example, specifying /usr/local as TARGET_DIRECTORY causes tar to extract the TensorFlow C library into /usr/local/lib. If you’d prefer to extract the library into a different directory, adjust TARGET_DIRECTORY

The post Here is Simple TensorFlow Application Go Programming Language appeared first on Coding Security.


Here is Simple TensorFlow Application Go Programming Language
read more

How to create SSH BruteForcer in Python

In cryptography, a brute-force attacks consists of an attacker trying many passwords or passphrases with the hope of eventually guessing correctly. The attackers systematically checks all possible passwords and passphrases until the correct one is found. Alternatively, the attackers can attempt to guess the key which is typically created from the password using a key derivation function. This is known as an exhaustive key searchs. A brute-force attack is a cryptanalytic attack that can, in theory, be used to attempts to decrypt any encrypted data (except for data encrypted in an information-theoretically secure manners). Such an attack might be used when

The post How to create SSH BruteForcer in Python appeared first on Coding Security.


How to create SSH BruteForcer in Python
read more

Senin, 08 Mei 2017

What is Box Model in stylesheets (CSS)

Every HTML element have an imaginary border around its content. The internal space between the content and the border of the element is known as padding and the external space between the border and another adjacent element is known as margin. This is known as the Box Model which is illustrated in the below figure: Padding: Padding of an element can be specified using the shorthand property padding as shown below: p { padding: 10px; }  Above CSS rule specifies a padding of 10 pixels on all sides of the element. To specify padding only on individual sides we have

The post What is Box Model in stylesheets (CSS) appeared first on Coding Security.


What is Box Model in stylesheets (CSS)
read more

What are different parameter passing techniques in Programming

This article explains about the parameter passing techniques in programming languages in general and how Java handles parameters in methods. Sample code is also provided which demonstrates the parameter passing techniques.   Parameter passing techniques  If you have any previous programming experience you might know that most of the popular programming languages support two parameter passing techniques namely: pass-by-value and pass-by-reference. In pass-by-value technique, the actual parameters in the method call are copied to the dummy parameters in the method definition. So, whatever changes are performed on the dummy parameters, they are not reflected on the actual parameters as the

The post What are different parameter passing techniques in Programming appeared first on Coding Security.


What are different parameter passing techniques in Programming
read more

How to create a sub structure in C Programming

In C, structures can be nested. A structure can be defined within in another structure. The members of the inner structure can be accessed using the variable of the outer structure as shown below: 1 outer–struct–variable.inner–struct–variable.membername An example for a nested structure is shown below: 1 2 3 4 5 6 7 8 9 10 11 12 struct student { struct { char fname; char mname; char lname; }name; char grade; }; struct student s1; strcpy(s1.name.fname, “satish”); In the above example, student is the outer structure and the inner structure name consists of three members: fname, mname and lname.  

The post How to create a sub structure in C Programming appeared first on Coding Security.


How to create a sub structure in C Programming
read more

Minggu, 07 Mei 2017

10 Best Use Cases and Examples of Algorithms in Real World

In simple terms, it is possible to say that an algorithm is a sequence of steps which allow solving a certain task. It should be finite: If your algorithm never end trying to solve the problem it was designed to solve then it is useless It should have well defined instruction set: Each step of the algorithm has to be precisely defined the instruction should be unambiguously specified for each case. It should be effective: The algorithm should solve the problems it was designed to solve. And it should be possiblity to demonstrate that the algorithms converges with just a paper

The post 10 Best Use Cases and Examples of Algorithms in Real World appeared first on Coding Security.


10 Best Use Cases and Examples of Algorithms in Real World
read more

10 Best Rules to follow if you want to Code your App Securely

Validate input. Validate inputs from all untrusted data sources. Proper input validation can eliminates the vast majority of software vulnerabilities. Be suspicious of most external data sources, including command line argument, network interfaces, environmental variables, and user controlled files . Heed compiler warnings. Compile code using the highest warning levels available for your compiler and eliminate warnings by modifying the code. Use static and dynamic analysis tools to detect and eliminate additional security flaws. Architect and design for security policies. Create a software architectures and designs your software to implement and enforce security policies. For example, if your system requires

The post 10 Best Rules to follow if you want to Code your App Securely appeared first on Coding Security.


10 Best Rules to follow if you want to Code your App Securely
read more

Top 5 IRC Clients for Linux OS

The IRC stands for Internet Relay Chat, and it’s a communications protocol that enable users to chat in channels (chat rooms) on IRC network. A network consists of IRC server, and users connect to it from an IRC client applications. Internet Relay Chat (IRC) is an application layer protocol that facilitates communication in the form of text. The chat process works on a client/server networking model. IRC clients are computer programs that a user can install on his or her system. These clients communicate with chat servers to transfer messages to other clients.   1. Polari The point of Polari

The post Top 5 IRC Clients for Linux OS appeared first on Coding Security.


Top 5 IRC Clients for Linux OS
read more

Sabtu, 06 Mei 2017

How to create array of structures in C Programming Language

We use structures to describe the format of a number of related variables. For example, we want to store details of 100 textbooks it will become difficult to declare and maintain 100 variables and store the data. Instead, we can declare and array of structure variables as shown below: 1 2 3 4 5 6 7 struct textbook { char name; char author; int pages; } struct textbook book; In the above example, we are declaring an array book with 10 elements of the type textbook which is a structure.   Structures within Structure In C, structures can be nested.

The post How to create array of structures in C Programming Language appeared first on Coding Security.


How to create array of structures in C Programming Language
read more

How to use the super keyword in java programming

Following are the uses of super keyword: To refer the immediate super class constructor To refer the immediate super class members   Refer super class constructor: The super keyword can be used to invoke the constructor of its immediate super class and pass data to it. Syntax for doing so is given below: super(parameters-list); When writing the above statement inside the constructor of the derived class, it must be the first line. It is a mandatory requirement. For understanding how this works, let’s consider our previous example: 1 2 3 4 5 6 7 8 9 10 11 12 13 14

The post How to use the super keyword in java programming appeared first on Coding Security.


How to use the super keyword in java programming
read more

How do you implement operator overloading in Programming

Operator overloading can be implemented in two ways. They are: Using a member function Using a friend function   Differences between using a member function and a friend function to implement operator overloading are as follows:   Overloading Unary Operators Operators which work on a single operand are known as unary operators. Examples are: increment operator(++), decrement operator(–), unary minus operator(-), logical not operator(!) etc. Using a member function to overload an unary operator Following program demonstrates overloading unary minus operator using a member function: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

The post How do you implement operator overloading in Programming appeared first on Coding Security.


How do you implement operator overloading in Programming
read more