if you are taking a warning such as;

Notice: Use of undefined constant _HC_PKG_THEME – assumed ‘_HC_PKG_THEME’ in ~\phpcoin\config.php on line 141
Notice: Use of undefined constant DIR – assumed ‘DIR’ in ~\phpcoin\config.php on line 146
Notice: Use of undefined constant _HC_PKG_LANG – assumed ‘_HC_PKG_LANG’ in ~\phpcoin\config.php on line 153

find this in php.ini

error_reporting = E_A

and change with

error_reporting = E_ALL & ~E_NOTICE

than restart apache.

Related posts

Tags: , ,

While i was trying to configure postfix, i learnt to sending e-mail in ssh. There are some script to do this and i choose sendEmail to install

sendemail type:

sudo apt-get intstall sendemail

then you can type

sendemail -f {from} -t (emailto}

sendEmail -f ADDRESS [options]

Required:
-f ADDRESS                from (sender) email address
* At least one recipient required via -t, -cc, or -bcc
* Message body required via -m, STDIN, or -o message-file=FILE

Common:
-t ADDRESS [ADDR ...]     to email address(es)
-u SUBJECT                message subject
-m MESSAGE                message body
-s SERVER[:PORT]          smtp mail relay, default is localhost:25

Optional:
-a   FILE [FILE ...]      file attachment(s)
-cc  ADDRESS [ADDR ...]   cc  email address(es)
-bcc ADDRESS [ADDR ...]   bcc email address(es)
-xu  USERNAME             username for SMTP authentication
-xp  PASSWORD             password for SMTP authentication

Paranormal:
-b BINDADDR[:PORT]        local host bind address
-l LOGFILE                log to the specified file
-v                        verbosity, use multiple times for greater effect
-q                        be quiet (i.e. no STDOUT output)
-o NAME=VALUE             advanced options, for details try: –help misc
-o message-file=FILE         -o message-format=raw
-o message-header=HEADER     -o message-charset=CHARSET
-o reply-to=ADDRESS          -o timeout=SECONDS
-o username=USERNAME         -o password=PASSWORD
-o tls=<auto|yes|no>         -o fqdn=FQDN

Help:
–help                    the helpful overview you’re reading now
–help addressing         explain addressing and related options
–help message            explain message body input and related options
–help networking         explain -s, -b, etc
–help output             explain logging and other output options
–help misc               explain -o options, TLS, SMTP auth, and more

After that type your email and press ctrl+d:

Mar 04 21:44:24 power sendEmail[24236]: Message input complete.
Mar 04 21:44:25 power sendEmail[24236]: Email was sent successfully!

Second Way

install mailx with:

sudo apt-get install mailx

to send email

mailx to@me.com

Subject: Write subject press enter

type here body press ctrl+d

CC: blank

Related posts

Tags: , , ,

I have to share this  !

Let’s dance & drink   : ))

But first drink to dance.

The Rocky Road To Dublin (Sherlock Holmes Movie)

Related posts

I needed a function to get  (learn) url with php.
Here are the codes.

<?php
function curPageURL() {
$pageURL = ‘http’;
if ($_SERVER["HTTPS"] == “on”) {$pageURL .= “s”;}
$pageURL .= “://”;
if ($_SERVER["SERVER_PORT"] != “80″) {
$pageURL .= $_SERVER["SERVER_NAME"].”:”.$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
?>

To use this function write

<? echo curPageURL(); ?>

Related posts

Tags: , , ,

Vim is the best text editor, i have ever used.  I’m using vim while coding with pyton,html and css.

How to install vim

sudo apt-get install vim vim-common vim-gnome

Usage and some features

You can open a file with using: vi open_me.txt

  1. Command mode: letters or sequence of letters interactively command vi. Commands are case sensitive. The ESC key can end a command.
  2. Insert mode: Text is inserted. The ESC key ends insert mode and returns you to command mode. One can enter insert mode with the “i” (insert), “a” (insert after), “A” (insert at end of line), “o” (open new line after current line) or “O” (Open line above current line) commands.
  3. Command line mode: One enters this mode by typing “:” which puts the command line entry at the foot of the screen.

there are some usefull commands, i took the image from “Learning the vi and Vim Editors” books. You can look over if  you want.

Related posts

Tags: , , , ,

Google Go !

Google Go !

Yeni ürün ve hizmet duyuruları ile adını sık sık duyduğumuz, büyük firmaları kendi bünyesine katarak hızla büyüyen Google; Android, Chrome derken şimdi de yeni bir programlama dili ile karşımızda. Robert Griesemer, Ken Thompson ve Rob Pike’ın 2007′nin sonlarına doğru geliştirmeye başladıkları Go dili 2008′in ortalarına doğru bir şekil almaya başlamış. Bu yazıda Go dilinin özelliklerinden, yeniliklerden çalışma prensibinden bahsedip bir kaç küçük kod örneğide vereceğim.

Neden çıktı bu Go ?

Go’nun kendi sitesindeki bilgilere göre:  makinelerin hızlarındaki gelişim yavaşlarken, yazılımların hızla gelişmesi.  Google bu işin geleceğini düşünüp, eğer yeni bir şeyler yapılmazsa, yazılımların git gite daha yavaş çalışacağını söylüyor. Buna ek olarak bir yazılım geliştirme sürecinin gerçekten uzun bir süreç olduğundan bahsediyor. Bütün bunların önüne geçmek için daha hızlı ve eğlenceli Go’yu karşımıza çıkarmış.

Go’nun özellikleri

Go’nun en büyük hedeflerinden biri static-type bir dilin verimliliği ile dynamic-type olan bir dilin kolaylılığı birleştirmek.  Bu yüzden Go için Python ve C++’ın bir karışımı diyebiliriz. Bir de derleme derleme hızını arttırdıklarını söylüyor. Dökümanlarına derleme hızının yavaşlığı anlatan hoş bir karikatürü eklemişler hemen paylaşayım.

Go, C++ gibi derlenen bir dil ve şuan için iki adet derleyicisi var 6g ve gccgo. Hemen şunuda belirtelim ki şu an için Windows altında çalışmıyor. (Geliştirici sayısı az olduğu için Windows desteğini çıkartamamışlar.  Çokta önemli bir özellik değil zaten değil mi ?) Sıkça sorulan sorular sayfasında  “Go nesne yönelimli bir proglama dili midir ?” sorusuna hem evet hemde hayır olarak cevap vermişler.  Birçok nesne yönelimli programlama dilinin özelliklerine sahip iken, tip hiyerarşisine sahip değil. Yine Go’nun kendi sayfasından bir örnek kod.

package main

import fmt “fmt”

func main () {

fmt.Printf(“Hello, world; or Καλημέρα κόσμε; or こんにちは 世界\n”); // utf-8 desteğine dikkat : )

}

6g ile derleyelim

6g helloworld.go # compile; object goes into helloworld.6

6l helloworld.6 # link; output goes into 6.out

6.out

Hello, world; or Καλημέρα κόσμε; or こんにちは 世界

gccgo ile derleyelim

gccgo helloworld.go

a.out

Hello, world; or Καλημέρα κόσμε; or こんにちは 世界

Son olarak Go’nun deneme aşamasında olduğunu hatırlatırım. Kim bilir belki ileride okullarımızda Google’ın Go’su öğretilir :) .

Kaynaklar:

golang.org

Ek: Go’nun maskotu http://imgur.com/U8HcM.gif

Onur AKTAS

http://www.alonon.net

Related posts

Tags: , ,

command:

sudo apt-get install php5-gd

Don’t forget to restart apache

service apache2 restart

Related posts

Tags: , ,

# change a hexadecimal string to decimal number and reverse
# check two different representations of the hexadecimal string
# negative values and zero are accepted
# tested with Python24        vegaseat     11oct2005

def dec2hex(n):
“”"return the hexadecimal string representation of integer n”"”
return “%X” % n

def hex2dec(s):
“”"return the integer value of a hexadecimal string s”"”
return int(s, 16)

print “dec2hex(255)  =”, dec2hex(255)    # FF
print “hex2dec(‘FF’) =”, hex2dec(‘FF’)   # 255

print

print “hex(255) =”, hex(255)                # 0xff
print “hex2dec(‘0xff’) =”, hex2dec(‘0xff’)  # 255

Related posts

Tags: , , ,

Ubuntu 9.10 has released, it has some new faetures, i shared a few of them. For more

Store, sync and share


Integrated “Ubuntu One” technology gives you 2 GB of online storage for free. Easily share files between your own and your friends’ computers. Upgrade at low cost for more storage if you need it.

Software Center

Instant access to thousands of free and open-source applications

Categories include: Education, Games, Sound and Video, Graphics, Programming and Office.

Simply select the applications you want to use and the Software Center will add them to your computer

No CDs, no licenses, no hassle.

Download Ubuntu 9.10

Related posts

Tags: , ,

Design Patterns

Design patterns is used in software to solve common problem. They can be grouped into 3 category (Creational patterns, Structural patterns, and Behavioral patterns)

You can find some information about design patterns here

Creational Patterns

Abstract Factory (87)
Provide an interface for creating families of related or dependent objects without specifying their concrete classes.
Builder (97)
Separate the construction of a complex object from its representation so that the same construction process can create different representations.
Factory Method (107)
Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.
Prototype (117)
Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype.
Singleton (127)
Ensure a class only has one instance, and provide a global point of access to it.

Discussion of Creational Patterns

Structural Patterns

Adapter (139)
Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn’t otherwise because of incompatible interfaces.
Bridge (151)
Decouple an abstraction from its implementation so that the two can vary independently.
Composite (163)
Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.
Decorator (175)
Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.
Facade (185)
Provide a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the subsystem easier to use.
Flyweight (195)
Use sharing to support large numbers of fine-grained objects efficiently.
Proxy (207)
Provide a surrogate or placeholder for another object to control access to it.

Discussion of Structural Patterns

Behavioral Patterns

Chain of Responsibility (223)
Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it.
Command (233)
Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations.
Interpreter (243)
Given a language, define a represention for its grammar along with an interpreter that uses the representation to interpret sentences in the language.
Iterator (257)
Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation.
Mediator (273)
Define an object that encapsulates how a set of objects interact. Mediator promotes loose coupling by keeping objects from referring to each other explicitly, and it lets you vary their interaction independently.
Memento (283)
Without violating encapsulation, capture and externalize an object’s internal state so that the object can be restored to this state later.
Observer (293)
Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
State (305)
Allow an object to alter its behavior when its internal state changes. The object will appear to change its class.
Strategy (315)
Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it.
Template Method (325)
Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm’s structure.
Visitor (331)

Creational Patterns

Abstract Factory (87)
Provide an interface for creating families of related or dependent objects without specifying their concrete classes.
Builder (97)
Separate the construction of a complex object from its representation so that the same construction process can create different representations.
Factory Method (107)
Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.
Prototype (117)
Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype.
Singleton (127)
Ensure a class only has one instance, and provide a global point of access to it.

Discussion of Creational Patterns

next:  Behavioral Patterns Structural Patterns

Adapter (139)
Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn’t otherwise because of incompatible interfaces.
Bridge (151)
Decouple an abstraction from its implementation so that the two can vary independently.
Composite (163)
Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.
Decorator (175)
Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.
Facade (185)
Provide a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the subsystem easier to use.
Flyweight (195)
Use sharing to support large numbers of fine-grained objects efficiently.
Proxy (207)
Provide a surrogate or placeholder for another object to control access to it.

Discussion of Structural Patterns

next:  navigation Behavioral Patterns

Chain of Responsibility (223)
Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it.
Command (233)
Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations.
Interpreter (243)
Given a language, define a represention for its grammar along with an interpreter that uses the representation to interpret sentences in the language.
Iterator (257)
Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation.
Mediator (273)
Define an object that encapsulates how a set of objects interact. Mediator promotes loose coupling by keeping objects from referring to each other explicitly, and it lets you vary their interaction independently.
Memento (283)
Without violating encapsulation, capture and externalize an object’s internal state so that the object can be restored to this state later.
Observer (293)
Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
State (305)
Allow an object to alter its behavior when its internal state changes. The object will appear to change its class.
Strategy (315)
Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it.
Template Method (325)
Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm’s structure.
Visitor (331)
Represent an operation to be performed on the elements of an object structure. Visitor lets you define a new operation without changing the classes of the elements on which it operates.
Represent an operation to be performed on the elements of an object structure. Visitor lets you define a new operation without changing the classes of the elements on which it operates.

Related posts

Tags: , , ,