jeudi 2 décembre 2010

Game Development Degree vs Computer Science Degree

Abouth to have or not to have a Degree I found a very interesting question to look at Game Development. I keep on thinking that in my personal point of view, well is needed to have a way to do things properly and save time instead on finding by your self. This is were a degree is useful, but there is nothing like experience, this makes academy a bit slower than real life issues on the frontdesk or de back office.

vendredi 6 août 2010

File.Copy method in C#



this is a quick example of how to use the copy method of the System.IO namespace

using System;
using System.IO;

class Test
{
public static void Main()
{
string path = @"c:\temp\MyTest.txt";
string path2 = path + "temp";

try
{
// Create the file and clean up handles.
using (FileStream fs = File.Create(path)) {}

// Ensure that the target does not exist.
File.Delete(path2);

// Copy the file.
File.Copy(path, path2);
Console.WriteLine("{0} copied to {1}", path, path2);

so try it for the common use of files..

vendredi 23 juillet 2010

Developer Productivity Mean vs. Median

Let’s debunk some of the myths about developer skills for project managers who have been assigned for the first time to software projects. Understand that really good software developers are much more productive than average ones. In fact, some statistics say that really good developers are multiple orders of magnitude better than poor ones. One order of magnitude is the same as multiplying a quantity by 10. The point is, a skilled programmer isn’t just a little better than an average one, the difference is huge.

What should this mean to our newly minted software project managers as they plan the development of this product? Managers erroneously think that even if you can't get the best and brightest, you still get some usefulness out of mediocre developers. But building software isn't like digging a ditch, where even the poorest ditch diggers can make a hole.

In software development, what is programmed today becomes the foundation for tomorrow. If you have mediocre developers building your foundation, the really good developers have to go back and fix the flaws before they can move on. Hiring mediocre or average developers slows project velocity*. Frequently, taking a poor performer off the team is more beneficial than adding a good one.

Couple this with the fact that adding people to a late project makes it even later, and you can understand why most enterprise development moves at a glacial pace. The non-experienced software project manager might reason that if adding more warehouse men allows a truck to be loaded faster, hiring additional programmers would shorten the time necessary to complete a software project.

That won’t work. It will take time, and pull other programmers off-task, to get the new guys/gals up-to-date. In addition, the communication channels increase with each addition to the team. With a team of 2, there is one channel - Betsy Sue to Bill. Add Mike, you jump to three channels. The number of channels continues to grow exponentially.

Here’s the formula: n(n-1)/2. With 12 people on the team you have 12(12-1)/2 channels, or 66 relationships you must maintain as the project manager. Add one more person and you now have 78 communication channels to oversee.

Building software with average developers exposes two project myths: 1)that you can shorten a project by adding people and, 2) that its OK to have average developers produce average (buggy/off-task) code at an average pace. In truth, average developers drag overall productivity down and the project takes longer than necessary to complete.

The solution? Give good developers powerful tools. You'll get higher quality software faster. Second, having warm bodies doesn't help projects, and having to baby-sit poor developers cuts the productivity of your good developers, who are craftsmen. Software is too complex to turn into an assembly line manufacturing process.

Want faster software development? Spend the extra money to hire and nurture excellent software developers. It will pay off in both the short term, and in the long term when it’s time to maintain the code.

  • Velocity - A term used in agile software development to show the rate of progress for a team or a team member. How much can an individual programmer be able to produce in a given time period.

mardi 15 juin 2010

Example WebSiteMap



                                                       //close the node                                //close the node                                          //close the node

mardi 6 avril 2010

On meeting for developers

A few decades ago, "Datamation" magazine ran a short article on "how to hold good meetings".

Three points they hit are extremely important.

1.

Have a WRITTEN agenda, circulated to everyone well in advance of the meeting, and KEEP to it.
2.

The meeting must be chaired (run) by the highest-ranking line manager present. Reason: He/she will run it anyway, so you might as well make it official.
3.

Whenever possible, limit the time to NOT MORE THAN ONE HOUR. If, as the one hour mark approaches, it is clear that more time is needed, the only topic you should be discussing is when and where you will reconvene, and what action items must be accomplished before then.

There has been a HUGE amount of research on optimum meeting lengths. Every study has shown, very clearly, that people's attention and energy drops DRAMATICALLY after about fifty minutes.

Another point should be mentioned. If Joe doesn't need to be there, DON'T MAKE HIM ATTEND. Send him a convenience copy of the agenda, send him a summary if he needs to know the results, but, if he isn't an active participant, don't waste his time.

join to remove values in tsql

I was looking at this post at stackoverflow. I found it interesting for those of us who are in to the tsql madness. well newbie sometime and a pro on the next..

mardi 16 mars 2010

Polymorphism in C#

so here's a basic question on Polymorphism in C#, i found at SO. looking for the basics these days.

class A {
public virtual void Method1(){}

public void Method2() {
Method1();
}
}

class B:A {
public override void Method1() { }
}

class main {
A myobject
= new B();
myobject.Method2();
}

So which function gets called?
B.Method1();

gets called because it properly overrides the virtual method A.Method1();

lundi 15 mars 2010

VB.Net equivalent of C# “As”

Here is an equivalance of the as of C# to VB programmers.

in C# you do this:

var x = y as String;
if (x == null) ...

in VB you do this :

Dim x As String = TryCast(y, String)
If x Is Nothing Then ...

meaning  "as" = "TryCast"



jeudi 11 mars 2010

Database Backup on Sql Server



Full Backup. This type of backup will lets you to backup all of extents of your database. In my previous articles, I've already explain about extent in SQL Server 2005. SQL Server always save your data in pages and extents. 1 pages contains 8 Kb of your data, and 1 extents is a group of 8 pages which contains 64 Kb data of your database. To use this type of backup, you must set your recovery model to full, before you backup your database. To set your database recovery model, you can use this query :

ALTER DATABASE [ database_name ]

SET RECOVERY [ FULL | BULK_LOGGED | SIMPLE ]

,and you can do full backup by using this query :

BACKUP DATABASE [ database_name ] TO DISK = '\' WITH INIT

TO DISK clause specify the location of your backup device, while WITH INIT clause is the common clause to tell SQL Server to overwrite existing data in backup device. You can make backup device by using SSMS or simply by using this query. Backup device is logical backup medium to save your backup data. It has extension .bak.

Differential Backup. This type of backup will backup your database since the last full backup. SQL Server will make extent map to recognize the new data in your database. When you insert data in your database, extent will have bit with 0 to 1 to represented their information. After you do full backup, it will be reseted to 0, in this way SQL Server know which data that have to be backed up in differential backup methods.Notes that you can do this type backup if you have done full backup to your database.

You can do differential backup by using this query :

BACKUP DATABASE [ database_name ] TO DISK = '\' WITH DIFFERENTIAL

Incremental Backup. This type of backup looks similar to differential backup. But actually, it's really different. Incremental backup will back up your database since the last full backup and the last incremental backup. So if you have 100 Mb data on Sunday, 150 Mb data on Tuesday, 200 Mb data on Wednesday, and 250 Mb data on Thursday. So the size of full backup data taken on Sunday is 100 Mb, while the incremental backup data taken on Tuesday, Wednesday, and Thursday are 50 Mb data for each day.

To restore this incremental backup, you must have all of your incremental backup data, or you won't be able to restore your database completely. For example, your incremental backup data on Wednesday is lost, you won't be able to restore your incremental backup data on Thursday. This type of backup are not recommended for production database, since it has a lot of risks.

Transaction Log Backup. This type of backup needs full backup of your database. Transaction Log Backup will back up all actives log files of your database. To use this type of backup you can use this query :

BACKUP LOG [ database_name ] TO DISK = '\' WITH INIT

You also can make operators and scheduled tasks to be assigned backup job to automated backup process of your database. I won't explain it this time, but I promise I'll tell you about this later.

jeudi 18 février 2010

setting value to a RadDatePicker on load

I had to come with a page who has a link and returns to the selected values of a list . So here is the way i did it.


private void SetDateRequest(string dateValue, RadDatePicker datePicker, DateTime valueDate)
{
DateTime dateOut;
datePicker.SelectedDate = valueDate;
if (DateTime.TryParseExact(dateValue, "yyyy-MM-dd", null, DateTimeStyles.None, out dateOut))
{
datePicker.SelectedDate = dateOut;
}
}

and this is how I call it :

SetDateRequest(dateTo, ToDateRadDatePicker, endDate);


Cheers,

mardi 16 février 2010

Error on TortoiseSVN installing on Windows 7

I made the upgrade to windows 7 enterprise edition this past weekend. But happen that when trying to install tortoise ver 1.6.7 the context menu did not show up. So I google around and found the answer:

Install the 32bit version of tortoise SVN parallel the 64bit version.
TC is a 32bit program and the 64bit shell extension can't be used by [u]any[/u] 32bit program.


this solved my problem to be able to export the projects from the code repository I was in urge for.

Cheers,

mardi 2 février 2010

DateTime.ToString() display “A.M.” or “P.M.”


Is there any way to use the DateTime.ToString() method to display the meridiem of the time portion as "A.M." instead of "AM"?


here is the work around.

using System;
using System.Globalization;

class Program {
public static void Main() {
CultureInfo c = (CultureInfo)CultureInfo.CurrentCulture.Clone();
c.DateTimeFormat.AMDesignator = "A.M.";
c.DateTimeFormat.PMDesignator = "P.M.";
Console.WriteLine(DateTime.Now.ToString("tt",c));
}
}

This are a second way to try with a designator. But here you have a static date format and therefore miss the culture.


DateTime time = DateTime.Now;
string s = time.ToString("yyyy.MM.dd hh:mm:ss t.\\M.");
Console.WriteLine(s);



Cheers








mercredi 27 janvier 2010

Dictionary on C#

this will get a mapping for values of page names and attach the resource to redirecto to each value.

string previousPage = Request.QueryString["Src"];
string DP = Request.QueryString["DP"];
var dictionary = new Dictionary();
dictionary["AccountingDetail"] = "AccountingDetail.aspx?DP="+DP;
dictionary["Fixing"] = "Fixing.aspx";
dictionary["Payment"] = "Payment.aspx";

if (dictionary.TryGetValue(previousPage, out pageMap ))
{
Response.Redirect(pageMap );
}

and here is the data format when you want to pass a datetime value in de parameters of an url from a source page:

DataNavigateURLFormatString="MyPage.aspx?product={0}&category={1}&date={2:d}"





jeudi 7 janvier 2010

update with join from a table with one field


To update a field from other table were we want one that field and we know there is a join.


update tableA
set Email = b.email
from tableA a inner join tableAbkp b on a.UserName = b.Username
where b.UserName not like '%user01%'

so here is an example to do the trick


orphan childs in tsql

Sometimes when we restore a db we include a user on it and it might be as well available at the server we are restoring. Sometimes the user stays orphan so you can't access the database even if you have the same user as the login on the server. Here's a quick workaround for it.

to see wich users are orphan:
sp_change_users_login @Action='Report';

to perform the action:

sp_change_users_login @Action='update_one', @UserNamePattern='',
@LoginName='';

hope this helps .