الخميس، 16 أكتوبر 2014

Digital Inputs الادخال عبر منفذ الاردينوا

int ledPin = 5;
int buttonApin = 9;
int buttonBpin = 8;

byte leds = 0;

void setup() 
{
  pinMode(ledPin, OUTPUT);
  pinMode(buttonApin, INPUT_PULLUP);  
  pinMode(buttonBpin, INPUT_PULLUP);  
}

void loop() 
{
  if (digitalRead(buttonApin) == LOW)
  {
    digitalWrite(ledPin, HIGH);
  }
  if (digitalRead(buttonBpin) == LOW)
  {
    digitalWrite(ledPin, LOW);
  }
}

الثلاثاء، 7 أكتوبر 2014

انشاء معايدة بسيطة بمناسبة العيد ب html

يجب ان تكون تهنئة العيد مختلفة لدى مهتمين بمختلف مجالات الحاسوب من برمجة و غيرها و غير تقليدية :p  كما حدث في العام السابق ( رابط الموضوع )
فابسط لغة برمجية او الاصح لغة وصفية و هي HTML يمكنك تصميم صفحة تهنئة بسيطة بمناسبة العيد عبر هذا الاسطر :(


<html>

<meta charset="UTF-8" />
<head>
<title> eid mubark </title>
</head>
<body>

<marquee bgcolor="D96500" height=80 width=45% behavior="alternate" scrollamount="20"> <font size=40> كل عام وانتم بخير </font> </marquee>
<marquee bgcolor="FAE696" height=80 width=56% behavior="alternate" scrollamount="15"> <font size=35> عيد مبارك </font> </marquee>
<marquee bgcolor="6F768E" height=80 width=60% behavior="alternate" scrollamount="25"> <font size=25> عيد سعيد </font> </marquee>
<Marquee bgcolor="B848FF"height=80 width=70% direction="right" scrollamount="5" ><font size=20> happy eid </font> </marquee>
<Marquee bgcolor="skyblack"height=80 width=80% direction="right" scrollamount="10" ><font size=15> eid mubark</font> </marquee>
<marquee bgcolor="32cd32" height=80 width=90% behavior="alternate" scrollamount="30"> <font size=10> Each year, you are okay :p</font> </marquee>
<marquee bgcolor="red" height=80 behavior="alternate" scrollamount="25"> <font size=5> Design by Ahmed Abdulkarim :) </font> </marquee>

</body>

</html>
ثم تقوم برفع الكود على اي استضافة تدعم html و اللغة العربية 
و النتيجة :)    :

eid mubark كل عام وانتم بخير عيد مبارك عيد سعيد happy eid eid mubark Each year, you are okay :p Design by Ahmed Abdulkarim :)
الجمعة، 25 يوليو 2014

برنامج المحاسبة لأيجاد سعر البيع

برنامج من تصميمي يقوم بايجاد سعر القطعة الواحدة و كذلك سعر بيعها مع نسبة الربح ...
وفي حال كان السعر بالدولار يمكن تحويله حسب سعر الصرف بالوقت الحالي .
مما يوفر الكثير من الوقت و الجهد بدل استخدام الحاسبة اليدوية من خلال المعدلات الطويلة 


لتحميل : برنامج أيجاد السعر
انتظر 5 ثواني ثم skip لتحميل من كوكل دريف  

الأحد، 29 يونيو 2014

Control any device through computer

الحمد لله قد تحقق احد الافكار و هو السيطرة على الاجهزة كهربائية تعمل ب 220 فولت من خلال الحاسوب عبر برنامج من تصميمي ( اول برنامج لي بواجهة رسومية ^_^)   حيث يمثل بداية لتطبيقات smart home ...




لمشاهدة الفديوا :


الجمعة، 13 يونيو 2014

تخطي حجب المواقع المحظورة في بلدك

يتم تخطي بتغير الايبي الخاص بك لغير دولة عن طريق استخدام VPN او غيرها و هي الخدمة التسمح بتشفير الاتصال بينك وبين السيرفر مما يتيح إمكانية تصفح الويب بكل أمان و سرية و باضافة الى امكانية فتح مواقع المحجوبة في دولتك .
حيث تعني خٍدمة VPN اختصار "الشبكة الافتراضية الخاصة" و يشابه موضوع تفعيل الماركت الامريكي عندما تكون التطبيقات غير متاحة في بلدك .
اما البرامج المستخدمة لتقديم هذه الخدمة في نسختها المجانية :
على الويندوز حيث تظهر ايقونة بعد التشغيل لتعمل اتصال connect لاي دولة متاحة 
لتحميل البرنامج : VPNium 
, وقد تم اكتشاف ماهو افضل من اضافة hola للمتصفح تمكنك من استخدام النت بسرعة لانها تغير ايبي فقط لصفحة معينة دون التأثير على السرعة العامة 
رابط تحميل :- Hola
اما على الهواتف الذكية بنظام اندرويد :
تقوم بتحميل التطبيق و تشغله مباشرة ليعمل و تستطيع بذلك فتح الموقع المحجوب :)
Psiphon - screenshot
لتحميل التطبيق :- Psiphon
او من كوكل بلي :- Hotspot Shield
او من رفعي الخاص على كوكل دريفر:- Hotspot Shield
و وجدت Hola
الجمعة، 30 مايو 2014

ارجاع الورد (معالج النصوص) Word الى الاعدادات الافتراضية (default)

موضوع بسيط و سريع بعد ان واجهة مشكلة في الاعدادات دون تحديد سبب مشكلة وجدت طريق لارجاع حميع الاعدادات الى ما كانت عليه بعد تنصيب البرنامج من خلال المسار : C:\Users\AppData\Roaming\Microsoft\Templates
(علما ان ملف AppData مخفي يجب عرضه عن طريق show folder)
ثم مسح ملف normal 
الجمعة، 16 مايو 2014

quick_sort

#include "stdafx.h"
#include<iostream>
#include<conio.h>
using namespace std;
class quicksort
{
public:
int no_of_elements;
int elements[10];
public:
void getarray();
void sortit(int[], int, int);
void partition(int[], int, int,int &);
void display();
};
void quicksort::getarray(){
cout << "how many elements ?: ";
cin >> no_of_elements;
cout << "insert array of element to sort : ";
for (int i = 0; i < no_of_elements; i++)
cin >> elements[i];
}
void quicksort::sortit(int x[], int lb, int ub)
{
int j;
if (lb >= ub)
return;
display();
partition(x, lb, ub, j);
sortit(x, lb, j - 1);
sortit(x, j + 1, ub);
}
void quicksort::partition(int x[], int lb, int ub, int &pj)
{
int a, down, temp, up;
a = x[lb];
up = ub;
down = lb;
while (down < up)
{
while (x[down] <= a)
down++;
while (x[up]>a)
up--;
if (down < up)
{
temp = x[down];
x[down] = x[up];
x[up] = temp;
}
}
x[lb] = x[up];
x[up] = a;
pj = up;
}
void quicksort::display()
{
for (int i = 0; i < no_of_elements; i++)
cout << elements[i] << " ";
cout << endl;
}

void main()
{
quicksort qs;
qs.getarray();
cout << "sort is given in step by step showing each iteration" << endl;
qs.sortit(qs.elements, 0, qs.no_of_elements - 1);
qs.display();
_getch();
}

merge_sort


#include "stdafx.h"
#include<iostream>
#include<conio.h>
using namespace std;
void sort(int left, int right);
void merge(int left, int mid, int right);
int a[9] = { 75, 40, 10, 90, 50, 95, 55, 15, 65};
int tmp[9];
void sort(int left, int right)
{

if (left < right)
{
int mid = (left + right) / 2;
sort(left, mid);
sort(mid + 1, right);
merge(left, mid, right);
}
}

void merge(int left, int mid, int right)
{
int i = left;
int j = left;
int k = mid + 1;
while (j <= mid&&k <= right)
{
if (a[j] < a[k])
tmp[i++] = a[j++];
else
tmp[i++] = a[k++];
}
while (j <= mid)
tmp[i++] = a[j++];
for (i = left; i < k; i++)
a[i] = tmp[i];
}
void main()
{
sort(0, 8);
cout << "sort array:"<<"\n";
for (int i = 0; i < 9; i++)
cout << a[i] << " ";
_getch();

}
الاثنين، 5 مايو 2014

Q8: find even number from 1000 to 2000


org 100h

.data
dt1 dw 500 dup(0)

.code 

 mov ax,@data
 mov ds,ax

 mov si, offset dt1

 mov bx,1000
 mov cx,500
 label:
 mov [si],bx
 add bx,0002
 inc si
 inc si
 loop label

hlt

note: see in memory in two byte CE and 06 equal 1998 , so it down 1996 see cc,07


another way for find even number from 1000 to 1500:

org 100h

.data
dt1 db 250 dup(0)
.code
mov ax,@data
mov ds,ax
mov si,offset dt1
mov cx,1000
mov bx,02

new:
    mov [si],cx
    add cx,bx
    add si,bx
    cmp cx,1500
    jle new

ret
الأحد، 27 أبريل 2014

example (nand,or and xor) in vhdl

NAND:-
library IEEE;
use IEEE.std_logic_1164.all ;
entity NANDGATE is
 port (a : in std_logic;
b : in std_logic;
x : out std_logic ) ;
end entity NANDGATE ;
architecture RTL of NANDGATE is
begin
 x<=a nand b;
end architecture RTL ;

OR:-
library IEEE;
use IEEE.std_logic_1164.all;
entity or is
port ( a : in std_logic;
b: in std_logic;
z: out std_logic ) ;
end or ;
architecture dataflow of or is
begin
z<= a or b;
end dataflow;

XOR:-
library IEEE;
use IEEE.std_logic_1164.all;
entity xor is
 port( a: in std_logic;
b:in std_logic;
z:out std_logic );
architecture dataflow of xor is
beginz<= [a and (not b) or (not a) and b ] ;
end dataflow ;

تعريف VHDL

VHDL is a hardware description language . it describes the behavior of an electronic circuit or system , from which the physical circuit or system can then be attained (implemented) .

once the vhdl code has been written , it can be used either to implement  the circuit in a programmable device (from Altra,Xilinx ,Atmel , etc)  or can be submitted to foundry for fabrication of an ASIC chip . Currently , many complex commercial chips (microcontrollers , for example) are designed using such an approach .

Basic VHDL Code:-

library declarations is To declare a Library (that is to make visible to the design) two lines of code are needed , one containing the name of the library , and the other a use clause , as shown in the syntax below .
LIBRARY library_name ;USE library_name.package_name.package_parts;


ENTITYentity is a list with specifications of all input and output pins (ports)of the circuit . its syntax is show below.
ENTITY entity_name is port (port_name: signal_mode signal_type;port_name: signal_mode signal_type;...... ) ;end entity_name;

architecture the architecture is a description of how the circuit should behave (function) . its syntax is the following:
ARCHITECTURE architecture_name of entity_name is [declaration] BEGIN (Code)end architecture_name;



الخميس، 24 أبريل 2014

َQ6:datasheet to find y=x2-10+x in assembly

org 100h

.data
dt1 db 1,2,3,4,5,6,7,8,9,10
dt2 db 10 dup(0)
.code
mov ax,@data
mov ds,ax
mov si,offset dt1
mov di,offset dt2
mov cx,0ah
lable:
mov ax,[si] 
mov bx,2
mul bx
sub ax,10
add ax,[si]   
mov [di],ax
inc si
inc di
loop lable

ret

الأربعاء، 23 أبريل 2014

logical error

package logical.error;

public class LogicalError {

    public static void main(String[] args) {
String word="debugging";
String single_letter="";
    int letter_count=0;
    for(int i=0;i<word.length();i++)
    {
        single_letter=word.substring(1,1);    // errror
    if(single_letter.equals("g"))
    {
        letter_count++;
    }
    }
        System.out.println("g was fount = "+letter_count+"times");

        }
    
}



after correct:- 

package logical.error;

public class LogicalError {

    public static void main(String[] args) {
String word="debugging";
String single_letter="";
    int letter_count=0;
    for(int i=0;i<word.length();i++)
    {
        single_letter=word.substring(i,i+1);   // correct
    if(single_letter.equals("g"))
    {
        letter_count++;
    }
    }
        System.out.println("g was fount = "+letter_count+"times");

        }
    
}

stack in java

package stack;

public class Stack {


    public static void main(String[] args) {
System.out.println("stack");   
    m1();
            System.out.println("end");
    }
    static void m1()
    {
        System.out.println("function1");
        m2();
    }
    static void m2()
    {
        System.out.println("function2");
    }
}

try and catch

package pkgtry.and.pkgcatch;


public class TryAndCatch {


    public static void main(String[] args) {
    try
    {
        int x=10;
        int y=0;
        int z=x/y;
        System.out.println("z"+z);
    }
    catch(Exception err){
        System.out.println(err.getMessage());
    }
        }
    
}

الدرس العاشر : call sub class (through object)

main class:-

package examdetail;

/**
 *

 */
public class Examdetail {


    public static void main(String[] args) {
       studentresult s=new studentresult();
       String ss=s.full_name = "ahmed abdulkarim";
       System.out.println(ss);
        System.out.println(s.examname("vb"));
        System.out.println(s.getgrade(13));

        
    }
    
}

sub class:-

package examdetail;

/**
 *
 */
public class studentresult {
    
    String full_name;
       String exam_name;
       String exam_grade; 
    studentresult(){
        full_name="no name";
        exam_name="un known";
    }
    String fullname(String name)
    {
        full_name=name;
        return full_name;
    }
    String examname(String ename)
    {
        if(ename.equals("vb"))
        exam_name="visualbasic";
       else if(ename.equals("j"))
        exam_name="java";
      else  if(ename.equals("p"))
        exam_name="php";
        return exam_name;
    }
 private String examgrade(int score)
    {
        if(score>=0&&score<=20)
            exam_grade="f";
        if(score>=21&&score<=40)
            exam_grade="E";
        return "the grad is :"+exam_grade;
    }
  String getgrade(int score) // to accses private function 
 {
     exam_grade=this.examgrade(score);
     return exam_grade;
 }

 }
       
الثلاثاء، 22 أبريل 2014

Application on smart phone

بما انه اصبح بالاونة الاخير استعمال الهواتف الذكية اكثر من غيرها لسهولتها و عمليتها اذا اصبح من الضروي مواكبة ذلك التطور الحاصل بهذا المجال .
فاليوم قمت بتصميم تطبيق يعرض الصفحة الخاصة بالجامعتي (الجامعة التكنولوجية) و صفحة القسم ( هندسة الحاسوب) و اخيرا المدونة (احمد تكنو) . بالاضافة الى المواضيع و فيسبوك و فديوات 
فاصبح من سهل جدا زيارة الموقع المضلة لديك بنقرات زر من هواتف الذكية التي اصبحت اكثر انتشار 
صورة التطبيق :- 

رابط التحميل على كوكل بلي :- AhmedTechno.apk
.
.
.
انتظر 5 ثواني ثم skip
او مباشرة منا هنا في حال حدوث مشكلة AhmedTechno.apk
الأربعاء، 16 أبريل 2014

الدرس التاسع : مصفوفة ثنائية الابعاد


package arrays_2d;

/**
 *
 */
public class Arrays_2D {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        int [][]arynums=new int[2][2];
        arynums[0][0]=11;
        arynums[0][1]=22;
        arynums[1][0]=33;
        arynums[1][1]=44;
        int colume=2;
        int row=2;
        for(int i=0;i<row;i++)
        {
            for(int j=0;j<colume;j++)
                System.out.print(arynums[i][j]+" ");
        System.out.println("");
        }

    }
    
}

الدرس الثامن :- ترتيب مصفوفة

  ascending تصاعدي :-

package arrray;
import java.util.Arrays;
/**
 *
 */
public class Arrray {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
int [] arynums=new int[6];
arynums[0]=11;
arynums[1]=55;
arynums[2]=33;
arynums[3]=66;
arynums[4]=22;
arynums[5]=44;
Arrays.sort(arynums);
int i;
for(i=0;i<arynums.length;i++)
System.out.print(arynums[i]+" ");
    }
}


descending تنازلي :-

package arrray;
import java.util.Arrays;
import java.util.Collections;
/**
 *
 */
public class Arrray {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
int [] arynums=new int[6];
arynums[0]=11;
arynums[1]=55;
arynums[2]=33;
arynums[3]=66;
arynums[4]=22;
arynums[5]=44;
Integer[]intarray=new Integer[arynums.length];
for(int i=0;i<arynums.length;i++)
  intarray[i]=new Integer(arynums[i]);
Arrays.sort(intarray,Collections.reverseOrder());

for(int i=0;i<intarray.length;i++)
System.out.print(intarray[i]+" ");
    }
}

الدرس السابع :- Arrays


package arrray;

/**
 *
 */
public class Arrray {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
    int []arynums;
    arynums=new int[4];
    arynums[0]=11;
   arynums[1]=22;
   arynums[2]=33;
   arynums[3]=44;
   /*or 
   int [ ]arynums={11,22,33,44};
   except:-
   boolean[ ] arybools=new boolean[ ] {true,false,true,false};
   */
   
   System.out.println(arynums[3]);
    }
    
}



use for loop:-

package arrray;

/**
 *
 */
public class Arrray {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
int [] lotterynums=new int[49];
int i;
for( i=0;i<lotterynums.length;i++)
{
   lotterynums[i]=i+1;
System.out.print(lotterynums[i]+" ");
    }
    }
}

 new method :-

package array_list;
import java.util.ArrayList;


/**
 *
 */
public class Array_list {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        ArrayList listtext=new ArrayList();
        listtext.add("first item");
        listtext.add("second item");
    listtext.add("third item");
    listtext.add(8);

    listtext.remove("second item");
    System.out.println("whole lists"+listtext);
    System.out.println("position1= "+listtext.get(1));

    }
    
}