Archive

Archive for August, 2012

Basic

August 19, 2012 Leave a comment

Spending weekend with Regular expression.

Full regular expression conntain 2 types of characters. Special character that is Meta character (i.e *) ,  and the rest is literal (normal text characters).

This is the example of regular expression :

Pattern Name Example Description
^ caret ^cat match a line with cat at beginning
$ dollar dog$ match a line with dog at the end
[…] character class gr[ea]y match with grey or gray
[^…] Negated character class gr[ea]y [^1-6]match character that’s not in the range 1 through 6
dash H[1-6] same with H[123456]. it indicate range
(|) Parentheses with bar gr(a|e)y Output is same with gr[a|e]y
¥< backslash less-than ¥<cat¥> match the position at the start of the word
¥> backslash greater-than ¥<cat¥> match the position at the end of the word
? Question mark (means: optional) colou?r match color or colour. u part is always successful

Note :

  • Character class can only match a single character on the target
Advertisements

Design Pattern

August 13, 2012 1 comment

Software design patterns are abstractions that help structure system designs. A design pattern is neither a static solution, nor is it an algorithm. A pattern is a way to describe and address by name (mostly a simplistic description of its goal), a repeatable solution or approach to a common design problem, that is, a common way to solve a generic problem (how generic or complex, depends on how restricted the target goal is). Patterns can emerge on their own or by design. This is why design patterns are useful as an abstraction over the implementation and a help at design stage. With this concept, an easier way to facilitate communication over a design choice as normalization technique is given so that every person can share the design concept (wikibooks).

The most well-known book on this topic is probably the “Gang of Four” book (23 classic software design patterns). Here are a few examples of common general-purpose design patterns.

  • Singleton (from creational pattern). This pattern ensures that a particular class has only one instance (the singleton instance) and provides a global point of access to it.
  • Iterator (from behavioral pattern). An iterator provides an efficient means of accessing the individual elements of a collection, without exposing the collection’s underlying implementation. The iterator “knows” the implementation details of the collection, so that its users don’t have to.
  • Abstract factory (from creational pattern). An abstract factory provides an interface for creating families of related or dependent classes without specifying their concrete classes.
Categories: Programming

Multiplayer FPS Game

August 5, 2012 1 comment

Preparing for second test. now with little AI. Client-Server model with RakNet. hope it will finish soon. thanks to Sigit Kusumanugraha for the icon.

Server Spec:
● Linux (Debian) kernel 2.6.32-5-686
● RakNet 4

Client Spec:
● Windows 7
● Unity 3D
● RakNet 4