Computer Science

Removing Old Kernel

Each version of the kernel can occupy up to 150 MB. If you have downloaded the headers you get 250 MB of space.

To view the installed kernels

dpkg --list | grep linux-image

Lists the headers installed

ls /usr/src | grep 'linux-headers'

First remove the headers using somethings like this

sudo apt-get purge linux-headers-3.8.0-19

then remove any specific kernel that is no longer needed

sudo apt-get purge linux-image-3.8.0-19-generic

 

Command list for cleaning and repairing

#houseclean

sudo apt-get autoclean # only removes files that cannot be downloaded anymore (obsolete)
sudo apt-get clean

 

#refresh

sudo apt-get update #resync package index
sudo apt-get upgrade #newest versions of all packages, update must be run first

#would upgrade you to the latest kernel in the repositories
#dist-upgrade is also able to remove existing packages if required

sudo apt-get dist-upgrade

# fix Broken packages -f

sudo apt-get -f install
sudo dpkg --configure -a

# Remove lock
# If you are absolutely sure you do not have another upgrade process running.
# Locked dpkg - only if sure you are not running another update.

sudo rm /var/lib/dpkg/lock
sudo dpkg --configure -a

# added zika's tip for problems with hash sum mismatch

sudo rm /var/lib/apt/lists/*
sudo apt-get update

Web Services

A Web Service is a software application identified by a URI (Uniform Resource Identifier) whose interfaces and binding are capable of being defined, described and discovered by XML artifacts and [that] supports direct interactions with other software applications using XML based messages via Internet-based protocols (HTTP, HTTPS, SMTP).

Web Service relies on Simple Object Application Protocol (SOAP) as its transport.

Read more: Web Services

Aspect-Oriented Programming

AOP aims at reducing the amount of "tangled" code by which we mean code that might be implemented in different classes if a OOP language is used but still share important secondary requirements. Such requirements are said to cross-cut the system's basic functionality and are difficult to develop and maintain using non-AOP programming paradigms. Cross-cutting functionality can be thought of as functionalty spanning many objects.

Logging is the prototypical example of a cross-cutting concern. E.g. an application might use logging in multiple classes when methods are entered or exited. So even though the classes themselves have different responsibilities and are implemented differently they still perform the same secondary functionality, in this case, logging.

To sum up: The goal of AOP is to support the programmer in cleanly separating compontents and the cross-cutting concerns of these, in AOP-lingo called aspects, from each other. This is achieved by promoting the cross-cutting concerns to first-class program modules.

The goal of AOP is in contrast with OOP and POP in that those paradigms only separate components from each other. 

Read more: Aspect-Oriented Programming

Dependency Inversion and Inversion of Control

Dependency Inversion

The Dependency Inversion Principle states that:

  1. High level modules should not depend upon low level modules. Both should depend upon abstractions.
  2. Abstractions should not depend upon details. Details should depend upon abstractions.

The Dependency Inversion principle (DIP) helps us to develop loosely couple code by ensuring that high-level modules depend on abstractions rather than concrete implementations of lower-level modules. The Inversion of Control pattern is an implementation of this principle. 

Read more: Dependency Inversion and Inversion of Control

Design Patterns (Java)

The design patterns are strategies for solving common object-oriented design problems. Using the design patterns you can make your code more flexible, reusable and maintainable. We must use the design patterns during the analysis and requirement phase of SDLC (Software Development Life Cycle).

A design pattern is a general reusable solution to a commonly occurring problem in software design. It is a description or template for how to solve a problem that can be used in many different situations. Object-oriented design patterns typically show relationships and interactions between classes or objects, without specifying the final application classes or objects that are involved.

Basically, design patterns are categorized into two parts:

  1. Core java (or JSE) Design Patterns.
  2. JEE Design Patterns.

At a higher level there are architectural patterns that are larger in scope, usually describing an overall pattern followed by an entire system.

Read more: Design Patterns (Java)

Java Regular Expressions

Regular expressions are used for defining String patterns that can be used for searching, manipulating and editing a text. These expressions are also known as Regex (short form of Regular expressions).

Twelve characters have special meanings in regular expressions: the backslash \, the caret ^, the dollar sign $, the period or dot ., the vertical bar or pipe symbol |, the question mark ?, the asterisk or star *, the plus sign +, the opening parenthesis (, the closing parenthesis ), the opening square bracket [, and the opening curly brace {. These special characters are often called "metacharacters". If you want to use any of these characters as a literal in a regex, you need to escape them with a backslash.

Read more: Java Regular Expressions

Thread Synchronization

When we start two or more threads within a program, there may be a situation when multiple threads try to access the same resource and finally they can produce unforeseen result due to concurrency issue. For example if multiple threads try to write within a same file then they may corrupt the data because one of the threads can overrite data or while one thread is opening the same file at the same time another thread might be closing the same file. The problems arise when multiple threads access the same resources - the same memory (variables, arrays, or objects), systems (databases, web services etc.) or files. To prevent race conditions from occurring you must make sure that the critical section is executed as an atomic instruction. That means that once a single thread is executing it, no other threads can execute it until the first thread has left the critical section. Synchronization in Java will only be needed if shared object is mutable.

Read more: Thread Synchronization

  1. Java API for operations on set of objects
  2. JavaScript Object Notation
  3. SQL Injection
  4. dplyr - package for common data manipulation operations in R

Page 1 of 3

  • 1
  • 2
  • 3
  • You are here:  
  • Home
  • Programming

Your IP Address:
54.198.122.70

Back to Top

© 2018 Computer Science