Monthly Archives: December 2015

Some Data Structure Basics To Know

Depth Firtst Search(DFS) Algorithm Explanation and Implementation in C++

Discovery Time and Finishing Time Code:

input/output:

pseudo:

Pseudocode from shafayet vai’s blog:

 

Reference:
http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/GraphAlgor/depthSearch.htm
http://www.dotnetlovers.com/Article/182/implementation-of-depth-first-searchdfs

Another code to find the order of the node:
References:
One of my classmates blog link: http://programminghelpbd.blogspot.com/2014/06/breadth-first-search-dfs-in-java.html
and this ppt : https://drive.google.com/file/d/0B0sCkwd_qKgJZEJzS1pWeXNmNUE/edit
CLRS website: http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/GraphAlgor/depthSearch.htm

Shafayet Ashraf: http://www.shafaetsplanet.com/planetcoding/?p=973

saurabhschool youtube link : https://www.youtube.com/watch?v=gCNsAKkUHPM

Youtube video of Mifta Sintaha:

and here is also a good implementation:
http://electrofriends.com/source-codes/software-programs/cpp-programs/cpp-data-structure/c-programs-for-the-implementation-of-depth-first-searchdfs-for-a-given-graph/comment-page-1/#comments

Java array basics: http://www.tutorialspoint.com/java/java_arrays.htm

Another code to find the order of vertices:

 

C program to transpose a matrix

Output:

 

Pattern Printing:Full pyramid in C

 

Output:

 

C problem solution:Anagrams

Anagram:

Output:

 

Pattern Printing:Star and Half pyramid in C

Output

 

Code:

 

Output:

References:

http://www.codeforwin.in/2015/07/star-patterns-program-in-c.html

http://www.tutorial4us.com/cpp-program/cpp-program-print-triangle-of-stars

http://www.programmingsimplified.com/c-program-print-stars-pyramid

Pattern Printing: 5*5 STARS in C

Code:

 

Output:

 

 

To push in github

First we have to make the system to push:
From windows you can use git bash or from unix based system terminal window you can use

Step 1: First we have to check for ssh key

if those files are not present

  • id_dsa.pub
  • id_ecdsa.pub
  • id_ed25519.pub
  • id_rsa.pub

then we have to genrate new ssh key
Step 2: Generate new ssh key

then follow these steps

simply enter.

then

here enter the passphrase

Now
Step 3: Add ssh key to the ssh-agent
Follow the code to enter in terminal or git bash

Step 4: Add ssh key to your github  account

if it give some errors then you can type this

Now got to your github account>settings>ssh keys>add ssh key

and open the id_res.pub file with a text editor and copy the text and paste on the github key>give it a name

Step 5:Test the conenction

then this message will come

press yes
and then this will come

voila! you are done 😀

Now system is done now we have the time to push:
Now you can clone the repository you created in your github i will show it in future after cloning go to your named directory and type the commands below

References:
https://help.github.com/articles/generating-ssh-keys/

c library function strcmp()

http://www.cplusplus.com/reference/cstring/strcmp/

http://www.tutorialspoint.com/c_standard_library/c_function_strcmp.htm

for the pseudocode: http://stackoverflow.com/questions/12136329/how-does-strcmp-work

http://en.cppreference.com/w/c/string/byte/strncmp

example:

here we are actually comparing the contents of lhs and contents of rhs that is passing from the main function.

declaration can be done by this in nay function

int strcmp(const char* str1,const char* str2)

algorithm should be like this:

Two things to remember we are defining here the address value not the length of the string and so it is the comparison between contents of the strings not the length . 🙂

Git commands in easy way

http://rogerdudler.github.io/git-guide/

https://developers.openshift.com/en/getting-started-windows.html#client-tools

Some steps are shown here
to clone:

Submitting changes

Final submission

 

php-gcm project for sending sms to any number through google cloud messaging

phpgcm

This is an opensource project by me and final release is version 1.0.1 till now.
Description:
First we have to create index.php for the options that will give the senders number and text box what to send to the sender and then at last the resgistration id from your mobile phone(It will be needed to use your mobile phone as messaging server.It will come from GCM app).

index.php

Now we have to create gcmtest.php it is the core part of our project.Here all the settings available that you can customize easily according to your needs.

gcmtest.php

Now when we run the script from our php backend server then it will show you the page where you will input sender number and message and click submit it will pass through your phone to google cloud messaging server and receiver will recieve a sms from your number.

You can download this whole project from my mirror server: php-gcm.zip

For testing this app you can go to:
http://pest-zakilive.rhcloud.com/phpgcm/
github address for source code: https://github.com/zakilive/phpgcm

References:
I took help from the opensource project to learn how they did the gcm passing:
https://gist.github.com/prime31/5675017#file-gistfile1-php-L16 (In PHP)
https://github.com/anjlab/android-sms-gateway (Android SMS gateway call in Ruby)

If you liked the tutorial or face any problem don’t forget to comment in the comment section.Thanx for reading 🙂

 

PHP-GCM to specified destination number

 

Reference: https://gist.github.com/prime31/5675017#file-gistfile1-php-L16

 

code:

To call this from browser you have to call like this

https://zakilive.com/gcm/gcmtest.php?id=registered_key_from_the_app

another example: http://stackoverflow.com/questions/11242743/gcm-with-php-google-cloud-messaging

Some shoulder workout

996759_961285140610902_4639861472901713172_n

3rd Year Finished….Alhamdulillah

আলহামদুলিল্লাহ… আজকে ৩য় বর্ষের শেষ পরীক্ষা দিয়ে আসলাম…এই সেমিস্টারে অ্যাকাডেমিক প্রেশার এর পাশাপাশি বাসা চেঞ্জ করে মিরপুরের দিকে চলে আসা…প্রতিদিন সাইকেল দিয়ে ভার্সিটি আসা যাওয়া করার মাঝে এক্সিডেন্ট করা সহ মাঝখানে আমার প্রিয় ল্যাপটপটার হার্ড ডিস্ক পুরোপুরি ড্যামেজ হওয়ায় বেশ কিছু মূল্যবান কোড হারানোয় এবং আব্বুর হাত রিকশা থেকে পরে গিয়ে ফ্র্যাকচারড হওয়ায় বেশ মন খারাপ ছিল কিছুদিন…. তারপরও এক্সাম শেষ হওয়ায় বেশ ভাল লাগছে……হয়ত মনটা ভাল করতে জিম করব কিছুদিন…অথবা সাইকেল টা নিয়ে ঘুরে বেড়াব এদিক ওদিক…..আল্লাহ্‌ সহায় হোক… 🙂

5*5 matrix in Javascript,Unityscript(Multidimensional Array)

http://stackoverflow.com/questions/10021847/for-loop-in-multidimensional-javascript-array

http://jsfiddle.net/TRR4n/

My code:

//To show the array value
https://jsfiddle.net/zakilive/6yrx1opj/1/

//To print the array

http://www.trans4mind.com/personal_development/JavaScript/Array2D.htm
http://www.javascripter.net/faq/twodimensional.htm
http://www.plus2net.com/javascript_tutorial/array-two-dimension.php