RSS

Monthly Archives: November 2011

اعتذار

نظرا لما تمر به مصر حاليا من احداث حاسمه،
قررت اداره المجله الاعتذار عن اصدار اي اعداد الى ان تنتهي تلك الاحداث تضامنا مع الثوار

عاشت الثوره..والمجد للشهداء

 
Leave a comment

Posted by on November 25, 2011 in Announcement

 

العدد الأسبوعي الجديد- New weekly version

 

السلام عليكم

العدد الأسبوعي الجديد

 

 
Leave a comment

Posted by on November 18, 2011 in Featured

 

2 العلاج بالألوان

السلام عليكم ورحمة الله وبركاتة

  العلاج بالألوان 


نوع من أنواع العلاج النفسي ،طريقة حديثة تساعد في الشفاء من الإكتئاب والإحباط وكثير من الحالات النفسية المستعصية ويقول الباحثون أن النظرإلى الحدائق يثير البهجة في النفوس وأن التأمل لساعة كل يوم في الشجر والورود وألوانها الزاهية هو طريقة فعالة في علاج الحالات النفسية الصعبة

قال تعالى:

( أَمَّنْ خَلَقَ السَّمَاوَاتِ وَالْأَرْضَ وَأَنْزَلَ لَكُمْ مِنَ السَّمَاءِ مَاءً فَأَنْبَتْنَا بِهِ حَدَائِقَ ذَاتَ بَهْجَةٍمَا كَانَ لَكُمْ أَنْ تُنْبِتُوا شَجَرَهَا أَءِلَهٌ مَعَ اللَّهِ بَلْ هُمْ قَوْمٌ يَعْدِلُونَ )

:ماهي نظرية العلاج بالألوان 

إن كل لون في الطيف له تردد تذبذبي أو اهتزازي مختلف ويعتقد العلماء أن جميع الخلايا في الجسم تملك أيضا ترددا ينبعث بقوة وإيجابية عندما يكون الإنسان موفور الصحة ولكن عندما يصاب بالمرض فإن هذا التردد يصبح غير متوازن بينما تقول النظرية الأخرى أن الأجزاء المختلفة من الجسم والحالات المرضية المتعددة والأوضاع العاطفية المختلفةتستجيب بصورة أفضل للألوان المختلفة وعندما يكون الجسم عديم التوازن فإنه يبحث بشكل طبيعي عن  الألوان التي يحتاجها.

وأشار الباحثون إلى أن الألوان الرئيسية التي تؤثر على الإنسان هي التدرجات اللونية لقوس قزح من ألوان الطيف التي تشمل الأحمر والأرجواني والبرتقالي والأصفر والأخضر والتركواز الأزرق والنيلي والبنفسجي ويُعتقد أن أول أربعة منها هي أكثر الألوان المنشطة بينما تكون الأربعة الأخيرة الأكثر هدوء وراحة

:متى اكتشفت هذه النظرية

منذ 150 عاما على بدء دراسة تأثير اللون على الإنسان ولاسيما تأثيره العلاجي بصورة علمية لايزال هذا الموضوع في طور الاستكشاف البطيء ويكاد يكون مجهولا تماما في العالم العربي اللهم إلا باستثناء بعض المختصين في العلاج المكمل رغم أن العلاج بالألوان كان معروفا من عصور سحيقة لدى الحضارات القديمة لاسيما في الشرق الأقصى (الهند والصين) والشرق الأوسط ( بلاد الرافدين ومصر الفراعنة ويونان الإغريق) وإن كان العرب المسلمون قد اهتموا بآثار الألوان العلاجية قبل الغرب بقرون فقد جاء في كتاب “القانون” للعلامة العربي “ابن سينا” إشارة إلى تأثير الألوان الرئيسية على الفرد فوجد أن الأحمر على سبيل المثال يثير الدم بينما الأزرق يهدئه أما أول كتاب غربي وضع حول استخدام الضوء لأغراض علاجية فكان بعنوان “الضوء الأحمر والأزرق”أو الضوء وأشعته كدواء” لمؤلفه الدكتور “س بانكوست” ونشر عام 1877وقد ركز بحث الكتاب على تأثير الأِشعة الحمراء المنبهة والزرقاء المسكنة على جسم الإنسان وفي عام 1887 نشر الدكتور “إيدوين بابيت” كتابه البحثي الهام بعنوان “مبادئ الضوء واللون” أوصى فيه باتباع عدة تقنيات وأساليب لاستخدام اللون بغرض العلاج غير أن العالم كان عليه الانتظار حتى عام 1933 ليتعرف على المبادئ العلميةالتي تفسر السبب والكيفية التي يستطيع بها لون ضوئي معين أن يؤثر بشكل علاجي على الكائن الحي وذلك مع نشر العالم الهندوسي “دينشاه .غاديالي” كتابه الهام في هذا الاختصاص: “موسوعة قياس ألوان الطيف”

:الألوان يمكن تقسيمها إلى مجموعتين

.الألوان الحارة مثل الأحمر والبرتقالي والأصفر وهي مقرّبة وعدوانية

.الألوان الباردة مثل الأزرق والأخضر و البنفسجي والتي تعتبر قابضة وسلبية

وأكثر الألوان التي يفضلها الإنسان حسب عدد من استطلاعات الرأي فهو الأزرقبسبب تأثيره المهدئ .والذي يخفض حتى معدل الشهيق والزفير
أما أكثر الألوان المكروهة على الأطلاق فهو الأصفر لأن الفائض منه يسبب الشعور بالقلق وثقل الحركة ونقص التركيز وفقدان الأحساس بالهدف وبزيادة كبيرة جدا عن الحد من هذا اللون يشعر الشخص بالتوتر العصبي وبالشك وأحيانا يتصرف بشكل غير عقلاني وغير مسؤول.


 
Leave a comment

Posted by on November 18, 2011 in Featured, Graphics

 

Get Starting With C "Variables and Arithmetic operations"

In the previous article , we talked about how to type a code in C , compile it and run it . In this one I’ll go through Variables and Arithmetic operations .

First , here’s a table of some variable types in C

 

Type Number of bytes Range
signed char 1 -128 to +127
short int 2 -32,768 to +32,767
int 4 -2,147,438,648 to +2,147,438,647
long int 4 2,147,438,648 to +2,147,438,647
long long int 8 9,223,372,036,854,775,808 to +9,223,372,036,854,775,807
float 4 ±3.4E38 (6 decimal digits precision)
double 8 ±1.7E308 (15 decimal digits precision)
long double 12 ±1.19E4932 (18 decimal digits precision)

also there’s an unsigned variable for every variable (eg. unsigned int) , the difference will be in the range (starting from 0) .

there’s also boolean variables which take a value of true or false .

Note : when you try to declare a variable of type boolean it’ll be like this :

  • _Bool isTrue = true;
  • or you put a header (#include<stdbool.h>) then you declare the variable  (bool isTrue= true;)

 

if we want to know the ranges of the variable types , simply we write this code :

#include<stdio.h>
#include<limits.h>

int main(void){
printf(“the char variable type ranges between %d and %d “,CHAR_MIN , CHAR_MAX);
return 0;
}

 

let’s examine this code ,

  •  it included stdio.h , limits.h headers (limits.h has the limits of the variable types)
  • it shows the range of char variable type (CHAR_MIN , CHAR_MAX)

the output of running this code will be : the char variable type ranges between -128 and 127

there’s also INT_MIN , INT_MAX , LONG_MIN , LONG_MAX ,  …

now , I want to make a simple code that print the sum of two numbers , here’s the code :

 

#include<stdio.h>

int main(void) {
int num1;
int num2;

printf(“enter the first number”);
scanf(“%d”,&num1);

printf(“enter the second number”);
scanf(“%d”,&num2);

printf(“the result is %d n” , num1+num2);
}

I guess you noticed that there’s a new term  “scanf” , this function takes the input from the user and stores it in the variable pointed to “we’ll cover that later” .

there’s also some arithmetic operations , like :

  • power “pow(number , power)”
  • square roots “sqrt(number)”
  • exponential”exp(x)”
  • and so on ( just put this header “#include<math.h>”  )

Now , with the end of this article I’d like to put a task

make a program to take the input of two numbers and print their sum , difference , multiplication , division , number one power number two and the square root of every one (you can put your code in the comments) .

 
Leave a comment

Posted by on November 18, 2011 in Featured, Programming

 

HMVC -Examples-2-

HMVC part two with examples

For Experienced developers in codeigniter

Hello ,

Now that we have our HMVC enabled instance of CodeIgniter , if you don’t know how to do that please check the following link
First let’s examine some examples
We will made in this tutorial hmvc  example login module

1-  First create the “login” folder module in our “hmvc_ci/application” directory. It should end up looking like this in your web directory

  1. hmvc_ci/application/modules/login/models/
  2. hmvc_ci/application/modules/login/views/
  3. hmvc_ci/application/modules/login/controllers

2-  Second   Create the “site” folder module in our “hmvc_ci/application” directory. It should end up looking like this

  1. hmvc_ci/application/modules/site/models/
  2. hmvc_ci/application/modules/site/views/
  3. hmvc_ci/application/modules/site/controllers

3-    Copy this files to your login module you

Note  : can download source code for this code from here

  1. hmvc_ci/application/modules/login/models/membership_model.php
  2. hmvc_ci/application/modules/login/views/login_form.php
  3. hmvc_ci//application/modules/login/views/signup_form.php
  4. hmvc_ci//application/modules/login/views/signup_successful.php
  5. hmvc_ci//application/modules/login/controllers/login.php

4-   Next  copy this files into site module

hmvc_ci/application/modules/site/controllers/site.php
hmvc_ci/application/modules/site/views/logged_in_area.php

5-  Open “hmvc_ci/application/config/autoload.php” and edit it to look like the this:

 

If you have not already done so from step one, open “hmvc_ci/application/config/config.php” and edit it so that the base url is set to your appropriate location.

$config[‘base_url’]     = ‘http://localhost/hmvc_ci‘;

6-  Open “hmvc_ci/application/config/database.php” and add the appropriate links to your database.

[php]

$db[‘default’][‘hostname’] = “localhost”;                                       //  location of DB serverdb[‘default’]
[‘username’] = “YOUR USERNAME HERE”;                              // username you use to connect
$db[‘default’][‘password’] = “YOUR PASSWORD HERE”;       // associated password
$db[‘default’][‘database’] = “hmvc_ci”;                                         // The database you want to use

[/php]

7-   Create this table from sql in phpmyadmin

[php]

CREATE TABLE  `hmvc_ci`.`membership` (

`id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`first_name` VARCHAR( 32 ) NOT NULL ,
`last_name` VARCHAR( 32 ) NOT NULL ,
`email_address` VARCHAR( 64 ) NOT NULL ,
`username` VARCHAR( 32 ) NOT NULL ,
`password` VARCHAR( 32 ) NOT NULL

) ENGINE = MYISAM ;

[/php]

8 – So we have our triads grouped, but we are still not quite in HMVC mode yet. In the site controller we find a function called is_logged_in() which check if user logged in or not .

[php]

function is_logged_in(){

$is_logged_in = $this->session->userdata(‘is_logged_in’);
if(!isset($is_logged_in) || $is_logged_in != true){

echo ‘You don’t have permission to access this page. <a href=”../login”>Login</a>’;
die();

}

}

[/php]

This is a login related function. In MVC mode, this is required because site cannot access login. With HMVC we can fix this.
In other way we collect related functions to other class and run what we need from it it’s good for big projects based on many views we handle that by hmvc and here we go i’ll demonstrate that in login function

  • Cut the is_logged_in() function out of “applications/modules/site/controllers/site.php
  • Save site.php without the is_logged_in() function.
  • Open “applications/modules/login/controllers/login.php“.
  • Paste the is_logged_in() function into the class.
  • Save login.php and code will be like that

9 – Open “applications/modules/site/controllers/site.php“.

 

Note : for CI 2.x like my examples login function should be like this

[php]

function is_logged_in($session){

$is_logged_in = $session->userdata(‘is_logged_in’);
if(!isset($is_logged_in) || $is_logged_in != true)
{

echo ‘You don’t have permission to access this page. <a href=”../login”>Login</a>’;
die();
//$this->load->view(‘login_form’);

}

}

[/php]

 

10-       Site controller  __construct should be like this

 

In chapter three we will demonstrate more example on HMVC for user profile member
after user login we will give every user control panel
Wait our demo !
Best regards 🙂

 

 
Leave a comment

Posted by on November 18, 2011 in Back-end, Design Patterns, Featured, Programming