Recent Updates RSS Toggle Comment Threads | Keyboard Shortcuts

  • iamsrijon 8:29 pm on December 23, 2009 Permalink | Reply
    Tags: calc, calculator, flex, infix, yacc   

    Infix Calculator in yacc & flex 

    Calc.yacc
    %{
    #include “stdio.h”
    #include “math.h”
    #define YYSTYPE double
    YYSTYPE last_value = 0;
    extern int yylex(void);
    %}
    %token NUMBER
    %token LAST
    %left ‘+’ ‘-’
    %left ‘*’ ‘/’
    %left ‘^’
    %left NEGATIVE
    %left COS EXP SIN SQRT TAN
    %%list:
    | list ‘\n’
    | list expr ‘\n’ { printf(“%.8g\n”,last_value=$2);
    }
    ;
    expr: term { $$ = $1; }
    | expr ‘+’ expr { $$ = $1 + $3; }
    | expr ‘-’ expr { $$ = $1 – $3; }
    | expr ‘*’ expr { $$ = $1 * $3; }
    | expr ‘/’ expr { $$ = $1 / $3; }
    | expr ‘^’ expr { $$ = pow($1,$3); }
    | ‘-’ expr %prec NEGATIVE { $$ = – $2; }
    | COS term { $$ = cos($2*3.141592654/180); }
    | SIN term { $$ = sin($2*3.141592654/180); }
    | SQRT term { $$ = sqrt($2); }
    | TAN term { $$ = tan($2*3.141592654/180); }
    ;term: NUMBER { $$ = $1; }
    | LAST { $$ = last_value; }
    | ‘(‘ expr ‘)’ { $$ = $2; }

    ;
    %%
    #include “stdlib.h”
    #include “string.h”
    #include “unistd.h”
    int lineno;
    char *fname = “-stdin-”;
    int yyerror(const char *s)
    {
    fprintf(stderr,”%s(%d):%s\n”,fname,lineno,s);
    return 0;
    }
    main()
    {
    yyparse();
    return 0;
    }

    Calc.flex
    %{
    #include “stdio.h”
    #include “unistd.h”
    #include “stdlib.h”
    #include “math.h”
    #define YYSTYPE double
    #include “y.tab.h”

    extern int lineno; /* current line number */
    extern YYSTYPE yylval; /* value of numeric token */
    %}

    digit [0-9]
    space [ \t]

    %%

    {space} { ; } /* spaces are ignored */
    {digit}+\.?|{digit}*\.{digit}+ {
    yylval = strtod(yytext,0);
    return NUMBER; }
    \*\* { return ‘^’; }
    last { return LAST; }
    cos { return COS; }
    exp { return EXP; }
    sin { return SIN; }
    sqrt { return SQRT; }
    tan { return TAN; }
    pi { yylval = atan(1.0)*4;
    return NUMBER; }
    e { yylval = exp(1.0);
    return NUMBER; }
    \n { lineno++; return ‘\n’; }
    . { return yytext[0]; }
    %%

    How to Compile & Run:
    Open Terminal, then
    [root@Srijon Desktop]# yacc -d Calc.yacc
    [root@Srijon Desktop]# flex Calc.flex
    [root@Srijon Desktop]# g++ lex.yy.c y.tab.c -ll
    [root@Srijon Desktop]# ./a.out

    That’s it. ENJOY!!!!!!!!

     
    • refat 9:03 pm on December 23, 2009 Permalink | Reply

      thanks for this……….
      Kalke bhujaiya dio
      bye.

    • rizel 4:11 am on December 24, 2009 Permalink | Reply

      joss. partner. go ahead.

      Thanx 4 this contribution of compiler lab…..

  • iamsrijon 7:55 pm on December 16, 2009 Permalink | Reply
    Tags: সংবিধিবদ্ধ, bangla, bangladesh, freedom, iamsrijon, rajakar   

    সংবিধিবদ্ধ 

    বাংলাদেশ, সহস্রবিন্দু রক্তকণিকার মিলিত মানচিত্র। দেশটির অফুরন্ত সম্পদ সেই আদিকাল থেকেই বিশ্বকে লালায়িত করে আসছে। নবাব আলিবর্দী খাঁ এর শাসনামলে ও ইংরেজ বণিকগন এদেশের নবাবকে তাঁর স্বীয় মর্যাদা দিতেন, বানিজ্যে তাঁদের নিয়ম-নিষেধ মেনে চলতেন। পরবর্তীতে নবাব সিরাজউদ্দৌলার সময় ইংরেজরা তাদের স্বীয় আধীপত্য বিস্তারের জন্য উপমহাদেশে নবাবী প্রথার বিলুপ্তি ঘটিয়ে নিজেরাই উপর মহলের নির্দেশে ক্ষমতা দখল করে। পূর্ববর্তী ইংরেজ শোষনের পাশাপাশি তখন ইংরেজ শাষনকালের সূচনা ঘটল, পরাভূত হল বাংলার স্বাধীনতা।

    স্বাধীন বাংলার পরাধীনতার জন্য আমরা ইংরেজদের দায়ী করি। কিন্তু সেই ইংরেজরা কখনোই বাংলার স্বাধীনতায় হস্তক্ষেপ করতে পারত না যদি বাংলার কতিপয় বাঙ্গালী দোসর তাদের সাথে হাত মিলিয়ে তাদের সাহায্য না করত। সুতরাং তৎকালীন বাংলার পরাধীনতার পেছনে বাঙ্গালীরাই দায়ী।

    বহুকাল পরের কথা। পাক-ভারত উপমহাদেশ ততদিনে বিভক্ত হয়ে গেছে, সৃষ্টি হয়েছে ভারত ও পাকিস্তানের। এই পাকিস্তানেরই একটি অংশ পূর্ব-পাকিস্তান যেখানে সেই বাঙ্গালীদের বসবাস এবং যা আবার ও পশ্চিম-পাকিস্তানের শোষনের সম্মুখিন। শোষন-বঞ্চনা মাত্রা অতিক্রম করতেই শুরু হয় মুক্তিযুদ্ধ, ১৯৭১। স্বাধীন রাষ্ট্র হিসাবে পূর্ব-পাকিস্তানের নাম হয় ‘বাংলাদেশ’। বাঙ্গালী জাতি যখন তাদের দেশ-মাতৃকার সার্বভৌমত্ব রক্ষায় সোচ্চার, যুদ্ধরত; ঠিক তখনই একদল স্বাধীনতাবিরোধী, রাজাকার, এই বাঙ্গালী জাতির কলঙ্ক, পাকিস্তানীদের সাথে হাত মিলিয়ে বাংলার স্বাধীনতাকামী জনতার বিরুদ্ধে লেগে পরে। তাদের নৃশংস তৎপরতায় বাংলার বহু দামাল ছেলেরা বিনা দোষে অকালে প্রাণ হারায়। বাঙ্গালী জাতির গর্ব, বুদ্ধিজীবী-শিক্ষিত সমাজ কুচক্রী দেশদ্রোহী রাজাকার এবং স্বগোত্রীয় আল্‌বদর, আল্‌শামস ওরফে শান্তি বাহিনীর তৎপরতায় পাক্‌-পশুদের হাতে ধরা পরে এবং বন্দুকের গুলিতে নয়, বেয়নেটের আঘাতে প্রাণ হারায়। দেশটি হয়ে পরে মেধাশূন্য।

    পাকিস্তানী জান্তা এদেশের যতটা ক্ষতি করেছে, তার চেয়ে অনেক বেশি অপূরনীয় ক্ষতি করেছে দালাল্‌রা, বিক্রি করতে চেয়েছিল দেশের স্বত্তা। যারা দেশের এত বড় ক্ষতি করেছে তাদের তো এই স্বাধীন বাংলাদেশের নাগরিকত্ব পাবার যোগ্যতা নেই। পাকিস্তান কেন তাদের পুনর্বাসনের ব্যবস্থা করছে না; সুশীল সমাজ তাদের এই বাংলাদেশে আর দেখতে চায় না।

    হঠাৎ করেই বুকের মধ্যে একটা পুরোনো ব্যাথা চিনচিনিয়ে ওঠে যখন মনে পড়ে সেই স্বাধীনতাবিরোধীরাই আজ স্বাধীনতা অর্জন, রক্ষার কথা বলে ( আমরা স্বাধীনতা এনেছি, আমরাই তা রক্ষা করব: আলী আহসান মো. মুজাহিদ, http://bdnews24.com/bangla/details.php?cid=3&id=116335&hb=4 )

    কয়দিন আগেই তো তারাই ছিল জনগনের প্রতিনিধি। তারা এদেশের জনগনের কল্যানে কাজ করেন! স্বাধীন বাংলাদেশে রাজাকারদের এই উন্নত অবস্থা এটাই প্রমাণ করে যে বাংলাদেশ আজও স্বাধীনতা থেকে অনেক দূরে। আজ কথাগুলো শুধু লেখা যায় আর পড়া যায়, কিন্তু মুখ ফুটে বলা যায় না।

     
  • iamsrijon 3:19 am on November 3, 2009 Permalink | Reply
    Tags: compiling trix, compiling Vypress Chat in fc10, installing trix, installing Vypress Chat, trix, vyPress, Vypress Chat, Vypress Chat in fc10, Vypress Chat in fedora 10, Vypress Chat in LINUX [fc10]   

    Vypress Chat in LINUX [fc10] 

    Vypress Chat is a user-friendly application for real-time chatting in small office or home office (SOHO) local networks. TriX chat is based on the VyQChat [unix clone of Vypress Chat]. You can install Trix in LINUX by following these steps.

    • Download Trix from here.
    • Download Qt from here.
    • Extract Qt & move the folder “qt-x11-free-3.3.8″ into /usr/local/ & rename it as “qt”.
    • Open /root/.profile as root & type the following & save
      • #!/bin/bash
      • QTDIR=/usr/local/qt
      • PATH=$QTDIR/bin:$PATH
      • MANPATH=$QTDIR/doc/man:$MANPATH
      • LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
    • Open terminal & type the following to build Qt
      • cd /usr/local/qt
      • ./configure && make
    • Extract trix-0.94.tat.bz2 & change the directory into the folder trix-0.94.
    • Install Trix
      • ./configure –disable-mt –with-qt-dir=/usr/local/qt && make
    • Goto “/etc/rc.d/rc5.d” & delete K##iptables, K##ip6tables, S##iptables, S##ip6tables. “##” denotes any combination of two digits.
    • If u want to run Trix at boot time then make a link & rename it “S##trix” into “/etc/rc.d/rc5.d”
    • Reboot the pc.

    That’s all, ENJOY!

     
  • iamsrijon 3:13 am on October 23, 2009 Permalink | Reply
    Tags: compiling HEX Editor in fedora, compiling HEX Editor in linux, download HEX Editor, download HEX Editor for fedora, download HEX Editor for fedora 10, download HEX Editor for linux, GHex, HEX Editor, HEX Editor for fedora, HEX Editor for fedora 10, HEX Editor for linux, Install Gnome HEX Editor GHex, Installing GHex, Installing Gnome HEX Editor GHex, Installing HEX Editor   

    Installing Gnome HEX Editor GHex 

    Gnome Hex Editor, GHex is an useful tool for manipulating [generally editing/merging] binary files in LINUX based distributions. We can install GHex with the following steps.

    • Download GHex source archive from here.
    • Extract the archive using Archive Manager.
    • Run the Terminal, change the directory to the source of ghex-2.24.0.
    • Type ./configure && make && make install.

    This is all you have to do.
    You can run GHex from Applications>Programming>Hex Editor.
    ENJOY!

     
    • bijan 4:05 pm on November 2, 2009 Permalink | Reply

      It is very helpful for us. Thanks a lot………….

  • iamsrijon 6:14 am on August 30, 2009 Permalink | Reply
    Tags: Chromium [popularly known as "Google Chrome"], Google Chrome, install chromium in fedora 10, install chromium in linux, install Google Chrome, install Google Chrome in fedora, install Google Chrome in fedora 10, install Google Chrome in LINUX   

    Install Chromium [Google Chrome] in Fedora 

    Chromium [popularly known as "Google Chrome"] is now available for LINUX based distribution. We can install it in Fedora [fc10 tested] by the following steps.

    That’s all. You can start Google Chrome from “Applications>Internet>Chromium Web Browser” in top panel. These instruction accurately works in Fedora 10 installed in a x86 compatible pc.

     
    • Mahmud 6:31 am on August 30, 2009 Permalink | Reply

      Cool…………..
      so nice link I feel…………..
      Thanks for sharing

  • iamsrijon 8:24 am on August 27, 2009 Permalink | Reply
    Tags: download mplayer, download mplayer standalone, encoding video in linux, installing mplayer with all codecs, installing mplayer with mencoder, installing mplayer with samba, installing mplayer with smb, mencoder with x264, mencoder with xvid, mplayer, mplayer all in one, mplayer allinone, mplayer standalone, mplayer standalone including all codecs, mplayer standalone with all codecs, mplayer with mencoder, mplayer-allin1   

    Install MPlayer Standalone 

    Popular Media Player for LINUX based distributions, MPlayer now comes with all useful codecs.

    • Just Download MPlayer Standalone from here.
    • Extract mplayer-standalone-yyyy-mm-dd.tar.bz2 using Archive Manager or just right click on the file and click “Extract Here”.
    • Double Click on the file ‘install’ and press “Run in Terminal”

    That’s all. It will install Gnome MPlayer as a Front-end. To play ANY media file from local or network [smb://], just open the file with Gnome-MPlayer.
    You can ENCODE videos using ‘MEncoder’ which is installed with the bundled package.
    Sample Scripts are given in a folder “Mencoder_script”.
    Thanks from Chinmoy & Srijon.
    ENJOY!

     
  • iamsrijon 4:05 pm on August 22, 2009 Permalink | Reply
    Tags: Disable "Low Disk Space Alert" in Windows Xp, Disable Low Disk Space message in Windows Xp, hard disk space, how to Disable Low Disk Space Alert, how to Disable Low Disk Space Alert in Windows Xp, low disk, low disk space, Low Disk Space Alert, low drive space, low hard disk space, low hard disk space balloon, low space   

    Disable “Low Disk Space Alert” in Windows Xp 

    As you know, Microsoft Windows XP displays a Pop up Balloon in system tray, if you don’t have enough free space in your hard drive. The following tips is useful for users to disable this pop up.

    • Click Start menu and then click RUN. Run dialog box will appear.
    • In Run dialog box type “regedit” (without quotes) and then click OK. To run Microsoft Registry editor.
    • Find following key :
      QUOTE
      HKEY_CURRENT_USER\Software\Microsoft\Windows\Current Version\Policies\Explorer
    • Right click on right panel and create a new DWORD value and name “NoLowDiskSpaceChecks”.
    • Finally give a value of 1.
    • Close Registry editor and restart your computer.

    Windows Xp no longer display low space warning massage.

     
  • iamsrijon 9:54 pm on August 20, 2009 Permalink | Reply  

    Alarming Alert! Virus “W32/Nuwar” is on its way to ATTACK via email 

    Beware when wants to pick up online electronic greeting cards or postcards (e-greeting cards or e-postcards) that appears to be sending by your friends, colleagues from relatives in your inbox, as these pick up links spread virus. These appear-to-be-legitimate but actually spoofed sender email spam email is actually a scam to entice users into clicking the link in the email and visiting sites hosting exploits that would result in a drive-by download.

    A typical postcard or greeting card email has the following messages as its text:

    Hi. Family member has sent you a postcard.
    See your card as often as you wish during the next 15 days.

    SEEING YOUR CARD

    If your email software creates links to Web pages, click on your
    card’s direct www address below while you are connected to the Internet:

    http://xx.xx.xx.xxx/?c8b2a44c604a1e290b516c3c2cd8a7c0b58e47d

    Or copy and paste it into your browser’s “Location” box (where Internet
    addresses go).

    We hope you enjoy your awesome card.

    Wishing you the best,
    Postmaster,
    Postcards.Org

    The emails seem to have plenty of title too, such as the following long list:

    You’ve received a greeting card from a admirer!
    You’ve received a greeting card from a class mate!
    You’ve received a greeting card from a class-mate!
    You’ve received a greeting card from a colleague!
    You’ve received a greeting card from a family member!
    You’ve received a greeting card from a friend!
    You’ve received a greeting card from a mate!
    You’ve received a greeting card from a neighbor!
    You’ve received a greeting card from a neighbour!
    You’ve received a greeting card from a partner!
    You’ve received a greeting card from a school friend!
    You’ve received a greeting card from a school mate!
    You’ve received a greeting card from a school-mate!
    You’ve received a greeting card from a worshipper!
    You’ve received a greeting ecard from a admirer!
    You’ve received a greeting ecard from a class mate!
    You’ve received a greeting ecard from a class-mate!
    You’ve received a greeting ecard from a colleague!
    You’ve received a greeting ecard from a family member!
    You’ve received a greeting ecard from a friend!
    You’ve received a greeting ecard from a mate!
    You’ve received a greeting ecard from a neighbor!
    You’ve received a greeting ecard from a neighbour!
    You’ve received a greeting ecard from a partner!
    You’ve received a greeting ecard from a school friend!
    You’ve received a greeting ecard from a school mate!
    You’ve received a greeting ecard from a school-mate!
    You’ve received a greeting ecard from a worshipper!
    You’ve received a greeting postcard from a admirer!
    You’ve received a greeting postcard from a class mate!
    You’ve received a greeting postcard from a class-mate!
    You’ve received a greeting postcard from a colleague!
    You’ve received a greeting postcard from a family member!
    You’ve received a greeting postcard from a friend!
    You’ve received a greeting postcard from a mate!
    You’ve received a greeting postcard from a neighbor!
    You’ve received a greeting postcard from a neighbour!
    You’ve received a greeting postcard from a partner!
    You’ve received a greeting postcard from a school friend!
    You’ve received a greeting postcard from a school mate!
    You’ve received a greeting postcard from a school-mate!
    You’ve received a greeting postcard from a worshipper!
    You’ve received a postcard from a admirer!
    You’ve received a postcard from a class mate!
    You’ve received a postcard from a class-mate!
    You’ve received a postcard from a colleague!
    You’ve received a postcard from a family member!
    You’ve received a postcard from a friend!
    You’ve received a postcard from a mate!
    You’ve received a postcard from a neighbor!
    You’ve received a postcard from a neighbour!
    You’ve received a postcard from a partner!
    You’ve received a postcard from a school friend!
    You’ve received a postcard from a school mate!
    You’ve received a postcard from a school-mate!
    You’ve received a postcard from a worshipper!
    You’ve received an ecard from a admirer!
    You’ve received an ecard from a class mate!
    You’ve received an ecard from a class-mate!
    You’ve received an ecard from a colleague!
    You’ve received an ecard from a family member!
    You’ve received an ecard from a friend!
    You’ve received an ecard from a mate!
    You’ve received an ecard from a neighbor!
    You’ve received an ecard from a neighbour!
    You’ve received an ecard from a partner!
    You’ve received an ecard from a school friend!
    You’ve received an ecard from a school mate!
    You’ve received an ecard from a school-mate!
    You’ve received an ecard from a worshipper!

    Worse, the sender email address is spoofed and the sender can be from webmaster of 1LoveCards.Com, administrator of greet2k.com, webmaster of FunnyPostcard.com, postmaster of Postcards.Com, Mail Delivery System of 2000greetings.com, postmaster of VintagePostcards.Com, webmaster of E-Cards.Com and etc.

    However, receiving these infectious spam mail does not mean that your system is infected with the virus, although most virus scanner now stop the mail in inbox and direct them to bulk folder. Only when you click and visit the URL link, then a cocktail of browser and application exploits that attempts a drive-by install of malware on the users machine is performed. If your system is not secured with anti virus and patched with latest security hotfixes, the chances to get infected will be higher.

    Most anti virus and security suites can now detect and remove this threat. Simply update the virus signatures to latest version, or if you haven’t yet, install a antivirus software.

     
  • iamsrijon 5:01 am on June 27, 2009 Permalink | Reply
    Tags: GTK Term, gtk terminal, Hyper Terminal GTK Term, Hyper Terminal in LINUX, Hyper Terminal in LINUX [GTK Term], install GTK Term, install GTK Term in fedora, install Terminal in LINUX, installing GTK Term, Terminal   

    Hyper Terminal in LINUX [GTK Term] 

    GTK Term is a GNU Clone of Hyper Terminal program for Serial Communication. U can install GTK Term from its Source by following some easy steps.

    • Download GTK Term 0.99.5 source from Softpedia or GTK Term 2-0.2.3 source from SourceForge
    • Download VTE 0.20.4 from Softpedia. It’s a prerequisite of GTK Term.
    • Extract GTK Term source & VTE source using Archive Manager
    • Copy “vte-0.20.4″ folder into gtkterm-0.99.5 folder
    • Create an Empty file named it “do-all” in gtkterm-0.99.5 directory
    • Open terminal from top panel [Applications -> System Tools -> Terminal]
    • Change the directory. Suppose u have extracted gtkterm-0.99.5.tar.gz in /root/Desktop, then write “cd Desktop/gtkterm-0.99.5″ without cotes in terminal & press Enter.
    • Change the permission of the file “do-all” by typing “chmod 777 do-all” in terminal & press Enter.
    • Write the following lines in “do-all” file & save it.

    #! /bin/sh
    cd `pwd`
    # install vte
    cd vte-0.20.4
    ./configure && make && make install
    make distclean
    cd ..
    # install gtkterm
    ./configure PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
    make && make install
    make distclean
    # Copy vte libraries
    cp /usr/local/lib/libvte.so.10* /usr/lib
    # Creating Desktop Link
    cd $HOME/Desktop
    link=”GTK Terminal”
    > $link
    echo “[Desktop Entry]” >> $link
    echo “Version=1.0″ >> $link
    echo “Encoding=UTF-8″ >> $link
    echo “Name=GTK Terminal” >> $link
    echo “Type=Application” >> $link
    echo “Terminal=false” >> $link
    echo “Icon[en_US]=gsd-xrandr” >> $link
    echo “Exec=gtkterm” >> $link
    echo “Name[en_US]=GTK Terminal” >> $link
    echo “Icon=gsd-xrandr” >> $link

    • Now,  just run the file “do-all” by double clicking the file & Press “Run in Terminal”
    • That’s all. U will get a Link “GTK Term” in Desktop to run GTK Term.

    This “do-all” script work accurately for gtkterm-0.99.5 & vte-0.20.4. U must change version numbers according to the version of vte-x.xx.x & gtkterm-x.xx.x if u have different versions of those source packages.

     
    • adminmsi 7:44 pm on July 2, 2009 Permalink | Reply

      cool site,but not much content.Dnt be lazy.okay–
      I am working on em px & %

      ——- Sirajul islam

  • iamsrijon 3:42 pm on June 26, 2009 Permalink | Reply
    Tags: download ns2, installing ns2 in fedora, installing ns2 in linux, Network Simulation, ns, ns2, ns2.33, ns2.33 install in linux   

    Installing NS2 in Fedora 10 (fc10) 

    You can install NS2 [Network Simulator 2] in Fedora 10 (fc10) by following some simple steps.

    • Download ns-allinone-2.33
    • Extract ns-allinone-2.33.tar.gz using Archive Manager
    • Create an Empty file named it “do-all” in directory ns-allinone-2.33.
    • Open terminal from top panel [Applications -> System Tools -> Terminal]
    • Change the directory. Suppose u have extracted ns-allinone-2.33.tar.gz in /root/Desktop, then write “cd Desktop/ns-allinone-2.33″ without cotes in terminal
    • Change the permission of the file “do-all” by typing “chmod 777 do-all” in terminal & press Enter.
    • Write the following lines in “do-all” file

    cd `pwd`
    ./install
    cp ns-2.33/ns /bin
    cp nam-1.13/nam /bin
    cp xgraph-12.1/xgraph /bin

    • Run the file. Write “./do-all” & Press Enter.
    • Thats all. U can run ns by writing ‘ns’ without cotes in terminal.

    All version number varies according to the version of ns-allinone-x.xx.tar.gz

     
    • rahul jain 5:24 am on August 10, 2009 Permalink | Reply

      hii,
      thanx a lot the tutorial ws really helpful, keep posting and helping us…

c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
esc
cancel