Delete Particular Rows in Excel

July 25, 2011

I have found an interesting macro to format excel.  Suppose, I have an excel file just like this:

SL Roll Name GPA Year
1 33001 Tukhrejul Inam 3.27 2008
2 33002 Ali Hossain 3.87 2007
4 33003 Jahangir Hossain 3.54 2006
5 33004 Moyen Hossain 3.29 2009

I want to delete all rows which contain name like ‘Hossain’. Then I hae to run a macro just like this:

Sub Test()
Dim Rng As Range
Dim x As Long
Set Rng = Range(“C1:C” & Range(“A65536″).End(xlUp).Row)
For x = Rng.Rows.Count To 1 Step -1
If InStr(1, Rng.Cells(x, 1).Value, “Hossain“) = 1 Then
Rng.Cells(x, 1).EntireRow.Delete
End If
Next x
End Sub

Here, C1:C will be column which contains the particular text. =1 means all rows which have the match, will be deleted. If I use ’0′, then all rows which don’t have the match, will be deleted.


Picking up rate for all dates from few day’s rate

May 18, 2011

I want to discuss an important query just now. I have done today it. Suppose, I have a rate_info table like this

dt rate
01/01/2011 24.50
5/01/2011 23.45
15/01/2011 20.34
25/01/2011 28.22
10/02/2011 15.25

Now I have to calculate rate for all dates. The rate will be same until the rate has been changed. Then the query will be like this:

select a.*,(select rate from rate_info where dt=(select max(dt) from rate_info where dt <=a.dt_new))rate_new from
(select to_char((select min(dt) from rate_info)+(level – 1),’DD-MON-RRRR’)dt_new from dual
    connect by level <= ((select max(dt) from rate_info) – (select min(dt) from rate_info)+1))a

If  a single day contain multiple rate with different version like this:

dt rate Version
01/01/2011 24.50 1
5/01/2011 23.45 1
15/01/2011 20.34 1
25/01/2011 28.22 1
10/02/2011 15.25 1
10/02/2011 13.24 2

Then the rate with maximum version will be picked up and query will be like this:
select a.*,(select rate from rate_info where dt=(select max(dt) from rate_info where dt <=a.dt_new)
and version =(select max(version) from rate_info where dt=(select max(dt) from rate_info where dt<=a.dt_new )
))rate_new from
(select to_char((select min(dt) from rate_info)+(level – 1),’DD-MON-RRRR’)dt_new from dual
connect by level <= ((select max(dt) from rate_info) – (select min(dt) from rate_info)+1))a


Filling blank field with previous row value in PL/SQL

May 14, 2011

Suppose I have Table named emp like this

empno comm
033001 RUET
033002
033003
033004 KUET
033004
033005 CUET

Now I want to fill the blank cells with the previous value. Such as comm of 033002, 033003  will be RUET. comm of 033004 will be KUET. How can I do this? I had googled and found an interesting query.

1. I have to execute following query:

select empno,comm, lag(comm ignore nulls) over (order by empno)prev_comm from emp order by empno.

Then I get a view like this :

empno comm prev_comm
033001 RUET
033002 RUET
033003 RUET
033004 KUET RUET
033004 KUET
033005 CUET KUET
CUET

2. Suppose the previous view is represented by mm.
Then I have to write the following query on mm view.

select empno, case when comm is null then prev_comm else comm end as comm from mm.

Then we will get the desired view :

empno comm
033001 RUET
033002 RUET
033003 RUET
033004 KUET
033004 KUET
033005 CUET

So, the final query will be:

select empno, case when comm is null then prev_comm else comm end as comm from (select empno,comm, lag(comm ignore nulls) over (order by empno)prev_comm from emp order by empno)


I Miss C++ Programming

July 26, 2010

Really, I am missing the C++ programming very much. When I was the programmer at Kento Studios, I was directly involved with c++ programming. Really, I miss the pleasure of innovation. When I have passed whole day to solve even a single problem and found it was solved at evening, I couldn’t express in words the pleasure of that moment. I have left Kento Studios about ten months ago. Later on, I have programed with C#, PHP, Java and Oracle successfully. But, I found, working with C++ is much more interesting. I also miss the team with which I have worked. We were eight programmers working together for application development for Nintendo DS. Writing technical specification, resource estimation(such as: sound, graphics requirement analysis), time estimation, task scheduling and solving our own tasks were regular works of ours. Everyone worked with deep attention, then we used to discuss each other with everyone’s task and if we found any error or exception something, then we tried to solve it together. Really, those moments were much very interesting; I really miss now. I cannot but mentioning the name of one programmer-Mr. Suruz. He could solve any problem any how, but he did not keep in mind the feasibility. Generally he wrote  code of long length though it would be solved with few lines of code. Sometimes he used huge memory for solving a problem. I used to collect all the works from programmers as team leader. I tried to make him understand that you couldn’t use such a huge memory or code, you had to use optimum memory, because the device memory is limited. But it was so hard to make him agree to rewrite the code. Sometimes he became angry. We smiled seeing his angry face. At last he rewrote the code and felt a heaven pleasure when I accepted his code.


One Year of DS Programming

July 22, 2009

NintendoDSAt 1st June 2009, I have completed my one year of DS programming. Just one year ago when I have joined at Kento Studios, my project manager told me that I had to work with ‘Nintendo DS’. Then I had asked him, “What?” He said again, “Nintendo DS” and stared at me. Perhaps my appearance expressed that I had not understood the word. Then he had written the word ‘Nintendo DS’ on a paper. He also said, this platform is completely new in Bangladesh and no one had worked with it still then in Bangladesh.

I, with my colleague, started to learn about the Nintendo DS, its features, what it was, how we could develop applications for it etc. searching at Google. We used to work hard so much, as we both are fresh graduates, our company was completely new with game development and the platform was also new in Bangladesh. All the new made troublesome for ours to work. Anyway, after studying hard, we found that the development resources are highly restricted and there was also a open source library named Palib for homebrew development. We had started to work with palib and said the authority to apply for license at warioworld for Nintendo DS game development. We had made an environment with devkitPro and palib and started to work. We studied various game logic, graphics, game development methodology and various terms related to game. We also implemented them at palib. We developed five demo games with palib. They are
* Abby Mathematicas
* Aymun & the Machon Pirates.
* 20.000 Leguas de Viaje Submarino
* Don Quijote.
* Olimpiadas del Sabar.
These were PC games and we made first level of these games for Nintendo and proposed the publisher to make all these games for Nintendo. It’s really pleasure to say that publisher was satisfied with our works though we were at very initial position of game development and gave the order to us for final production with original NitroSDK.

Meanwhile, we got the license from Nintendo as a developer and again started to study the new SDK and programming manuals. But we found that we had to work at very core level with assembly & C code. We worked hard continuously one month but we found that it would take longer time if we would go this way. We realized that we had to develop a development framework to speed up the development. We discussed it with authority. Company also realized it and managed a framework from Annino Games Inc. It also was not complete framework. We had started to work with it and filled up the lickings of it.

Anyway, the framework helped us more and we developed two games with it AbbyMathDS and OtijocsDS. Working at Kento Studios with Nitro makes us very confident that we can learn any new technology quickly and can work at any environment successfully.


Thanks to Chipmunk Family

July 14, 2009

First of all, I would like to convey thanks to chipmunk famaliy, specially to Scott Lembcke, who is the author of the chipmunk physics engine. It is a 2D physics engine & open source. I have studied about it for one week deeply and found it very interesting. I can emplement any actions related to physics rules to  2D games. I have studied the codes of  the engine and all demos. They are very easy to emplement. As I am working with Nitro environment for nintendo DS, I have tried to use the engine in that environment. I have done some examples easily related with collition path, bounce, gravity, speed etc. The 7 demos reflects most of the physics rules. If anybody can understand all these demos clearly, he can emplement any action easily, I think. More over the engine has a forum. I have found lots of help from this forum and answers of my questions within very short time.

We can learn more about chipmunk here:

http://code.google.com/p/chipmunk-physics/wiki/Documentation

The forum of chipmunk:

http://www.slembcke.net/forums/index.php


Profile

February 21, 2008

I am Md. Tukhrejul Inam Shamim. I have completed my BSc Engineering in CSE from RUET,            Rajshahi. Now I am working as a software engineer at Kento Studios Ltd. since June 01′ 08. It is a spain based multinational company. I am working with C++ to develop Nintendo DS  applications. Our company is a lisenced developer of Nintendo Inc. America. I have taken an  exclusive training on Object Oriented programming with Dot net Framework at BASIS,  Bangladesh. I, with my team members, have also taken training on Lot Check for DS application  at Oxygen Studios, UK and DS programming with ADSE at Annino Games Inc. Phillipines. I am  also doing my MSc Engineering at IICT, BUET.

Md. Tukhrejul Inam

Cell: +8801717450748


Follow

Get every new post delivered to your Inbox.