Sunday, December 11, 2011

FCIH initiative is group of FCIH graduates who are interested in passing their experience & knowledge to FCIH students. The kick off was on 7 November 2009; during these two years, we managed to hold number of sessions and Java training.

We think of the initiative as our role towards the society and as a chance to help others find their way in life. Currently, we are hoping to add new members to FCIH initiative family. Kindly, if you are interested, take a few minutes to fill this form, if you are already a member please fill the form as well.

Please, feel free to spread the word to other FCIH graduates who might be interested.

Wednesday, November 16, 2011

In this post we will talk about currying, why you
may need it, how to implement it with different paradigms (OOP,
meta-programming, and functional).

Let's first talk about motivation. Consider the
simple scenario where you have a list of integers, and you want to filter it to
extract only the integers you want. For instance this list could be a list of
user IDs, and you want to extract only the users who are late in their payments
to send them an email.

It is pretty much straight forward to do it in a
loop; but we want a clearer way that focuses on semantics. For example consider
something like

send_email_to(select_from(all_users, payment_due))

I've colored payment_due in
red to make it clear its a function, not a variable. The function select_from could
contain the loop structure (and maybe some database processing), where in each
loop they apply the function payment_due to
some user like this:

select_from(list, test)

{

selected = {};

for(i=0; i < list.length; i++)

if(test(list[i]) == true)

append(selected,list[i])

return selected;

}

Notice that the function payment_due must be a function that takes only one
parameter, because that is how it will be called from inside select_from. In most
languages which have first-class
functions there is a built-in function which acts like select_from, exactly
for this kind of purpose. This includes C++ and all functional programming
languages. In C++11 it is called copy_if (it was dropped from C++ by accident).

Consider another «test» function that takes as
argument a user ID, and returns true if the user’s monthly salary is more than
3000. That could be written as:

salary_greater_than_3000(user)

{

return
user.salary > 3000;

}

send_email_to(select_from(all_users, salary_greater_than_3000))

Maybe we have something like this:

salary_greater_than_x(user,x)

{

return
user.salary > x;

}

salary_greater_than_3000(user)

{

return
salary_greater_than_x(user,3000);

}

send_email_to(select_from(all_users, salary_greater_than_3000))

C++ macros won’t do the same thing as above, but
C++ STL bind2nd
(which is also compile-time meta-programming) can do the same thing.

If we don’t know the value 3000 at compile time and
instead we only have it in run-time, we can’t do this call select_from(all_users,
salary_greater_than_x). This
wouldn’t work because select_from expects a function taking
one parameter only.

In C++ this could be fixed by using a functor,
which is a class which overrides operator(), and hence could be used as a
function. For example (this example is valid C++, not just pseudo code as the
previous examples):

class salary_greater_than_x

{

const
int x;

public:
salary_greater_than_x(int x): x(x){}

bool
operator()(User user) { return user.salary() > x; }

}

send_email_to(select_from(all_users, salary_greater_than_x(3000)))

Lambda expressions does the same thing exactly,
without the need to write a class for it. In C++11 (which supports lambda
epxressions) that would be like:

The lambda expression, just like the functor,
stores the value 3000, which is a sort of a closure.

Lambda expressions is too powerful; you can define
arbitrary functions. We don’t need all that power, we only need to fix one
argument of another function. This is what currying does. For instance, we know
that salary_greater_than_x takes two
arguments. If the language we are using supports implicit currying (like Haskell) if we omitted the
second parameter we end up with a function whose first parameter is fixed.
Concretely speaking we can do this (notice I switched the first and second
parameters in the definition of salary_greater_than_x) :

Tuesday, July 12, 2011

If you love your country and want to take effective steps to raise Egypt

If you're seeking development, freedom, knowledge and science

So, you're a proactive Egyptian and FCIan and should join our FCIH Revolution

A revolution of knowledge, learning, working and a revolution of dreams

We're all together; FCIH Graduates and Students

We're all here to help each others; we're all here to develop our skills

Together, we'll have a better world, we'll have a better tom, and we'll have a better Egypt

We'll attend Technical & Business sessions to know

We'll be trained to learn

We'll do projects…and then we'll be ready to achieve

Let's join and train ourselves

Let's join and know the business world from experts from each field

Let's join and start building our future and career from now

Our program will be divided into three phases:

1-Sessions Phase:
These sessions will open us a window to the business world, discuss technical topics and tell us about the world outside FCIH

2-Training phase:we'll have more than one training track, each track will be delivered and leaded by a group of experts in this track, we'll learn how to learn and how to apply what we've learned

3-Projects phase:

After all this knowledge, it'll be our chance to do and achieve. We'll develop projects simulating business cases and deliver it according to modern software engineering methodologies used in real business by leading companies.

Thursday, March 03, 2011

Probably you're familiar with the sharing button (at least on Firefox and Chrome) offered by Google reader to help you share stuff that don't have feeds. Today, for some reason I realized that mine wasn't working!

C:\OverlappingTabs.csproj : error : Unable to read the project file 'OverlappingTabs.csproj'.
C:\OverlappingTabs.csproj(108,3): The imported project "C:\Program Files\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Silverlight.CSharp.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

Sunday, January 09, 2011

Sometimes you'd pop into cases where you find yourself in a situation where you have to force undo pending code changes of someone else (say a colleague who is no more around, or even temporarily) or your own pending changes if say your machine (along with your workspace on it).

Well, there a Visual Studio tool for that.. That's tf command-line utility, which you can look for in your VS directory under Common7\IDE..

Using tf has lots and lots of uses, here's a really LONG list of them. Note: there's 3 sub-lists for VS2005, 2008, 2010. But for our tiny problem here, we mainly have to options, I'm using here the most straight forward ones:

Undoing pending changes for a specific file:

That will need mainly main parameters to start with: The name/path of the file checkout, User name (of the user who did the checkout), and the Workspace in which the checkout was done (usually your machine name if you didn't create an new workspace).

You could have an issue with the third one (workspace name), so you might have to check the Workspaces command for more details, but generally a small command like the one below will do just ok in most cases:

tf workspaces /owner:UserName

Knowing the above you can easily undo the pending changes as below, note: parameters are in squiggly braces like {these}:

The other option is to delete the whole workspace, which in turn delete any related checkouts. A simple command for that could be:

tf workspace /delete {workspace};{username} /server:{TFS name/IP}

which with some example parameters might look like:

tf workspace /delete Shady-PC;FCIH\shady /server:10.0.0.2

UPDATE:

After a comment by Meligy, I think I needed to add this: Most of the above needs you to be logged in as an account with TFS admin privileges, check the exact required permissions for Undo, Workspace and Workspaces commands.

If you're not logged in as the appropriate account, you can append {/login:username, [password]} to provide the authorized username and password.

Meligy, also, mentioned another tool called TFS Sidekicks that can do similar stuff.

About us

We are a group of bloggers from Faculty of Computers & Information, Helwan University. We have a passion for technology, enjoy programming and we enjoy blogging. This blog is the result of combining those skills and the desire to share our knowledge with others.