Sunday, February 13, 2011

Understanding ASP NET ORM 101

LINQ stands for language integrated query. It allows you to use "SQL style" query language directly within C# to extract information from data sources.

  • That data source could be a SQL server database - this is Linq to SQL
  • That data source could be an data context of entity framework objects - Linq to entities.
  • That data source could be ADO.net data sets - Linq to Dataset.

That data source could also be an XML file - Linq to XML.
Or even just a Collection class of plain objects - Linq to Objects.

LINQ describes the querying technology, the rest of the name describes the source of the data being queried.

For a bit of extra background:

Datasets are ADO.net objects where data is loaded from a database into a .net Dataset and Linq can be used to query that data after it's loaded.

With Linq to SQL you define .net classes that map to the database and Linq-to-SQL takes care of loading the data from the SQL server database

And finally the Entity framework is a system where you can define a database and object mapping in XML, and can then use Linq to query the data that is loaded via this mapping.

And also

  • all of them are LINQ - Language Integrated Query - so they all share a lot of commonality. All these "dialects" basically allow you to do a query-style select of data, from various sources.

  • Linq-to-SQL is Microsoft's first attempt at an ORM - Object-Relational Mapper. It supports SQL Server only. It's a mapping technology to map SQL Server database tables to .NET objects.

  • Linq-to-Entities is the same idea, but using Entity Framework in the background, as the ORM - again from Microsoft, but supporting multiple database backends

  • Linq-to-DataSets is LINQ, but using is against the "old-style" ADO.NET 2.0 DataSets - in the times before ORM's from Microsoft, all you could do with ADO.NET was returning DataSets, DataTables etc., and Linq-to-DataSets queries those data stores for data. So in this case, you'd return a DataTable or DataSets (System.Data namespace) from a database backend, and then query those using the LINQ syntax

Saturday, January 8, 2011

MACOSX SVN 101

MACOSX SVN 101

1.Light up your terminal window

2.Add the following line into your .bash_profile , save it and quit

export SVN_EDITOR="/usr/bin/vim"

3.Check your changes by reloading Terminal and printing the SVN_EDITOR environment variable to screen by using the following
echo $SVN_EDITOR

It should output: /usr/bin/vim

4.To import files into your SVN

svn import project https://[PROJECT_NAME].googlecode.com/svn./trunk/ -m "initial import" --username [GMAIL_ACCOUNT_NAME]

5.To checkout the files from your SVN

svn checkout https://[PROJECT_NAME].googlecode.com/svn/trunk/ [PROJECT_NAME] --username [GMAIL_ACCOUNT_NAME]

6.Basic SVN work cycle
The typical work cycle looks like this:
1. Update your working copy.
• svnupdate
2. Make changes.
• svnadd
• svndelete
• svncopy
• svnmove
3. Examine your changes.
• svnstatus
• svndiff
4. Possibly undo some changes.
• svnrevert
5. Resolve conflicts (merge others' changes).
• svnupdate
• svnresolve
6. Commit your changes.
• svncommit

Friday, December 24, 2010

Time

HAPPY HOLIDAYS!

Sunday, December 19, 2010

me, myself and C

Most beginning programmer get lost with the C programming language specifically the heart and soul which is POINTERS!

Why we need C/C++ POINTERS

1.Data management on the free store
2.Accessing class member data and functions
3.Passing variables by reference to functions

Example:

char m[] = {1,2,3,4,5}
char *p;
p = &m[3];

Pointers on C-POINTERS

1. Variables in C are memory locations
2. If you are going to change the variable you pass the variable by using pointers otherwise pass it by value e.g

changing the variable "s" pass by pointers

char *str( int i, char *s)
{
while(i) {
s++;
i--;
}
return s;
}


void none(int i)
{
i = i + 1;
return 1;
}

3.) C++ Friend function/classes are used for accessing methods + variables between classes of different type its a communication tool

4.) static void () the function is only visible in the file in which it is defined





Friday, December 17, 2010

Mono tips

Finally, after much sought speculation and stuff like that I installed the mono thingy into my
machine with the following configuration:


Configuration summary for mod_mono

* Installation prefix = /usr
* Apache version = 2.2
* Apache modules directory = /usr/libexec/apache2
* apxs = /usr/sbin/apxs
* apr-config = /usr/bin/apr-1-config
* apu-config = /usr/bin/apu-1-config
* CFLAGS = -g -O2 -I/usr/include/apache2 -I/usr/local/include -I/usr/include/apr-1 -I/usr/include/apr-1
* Verbose logging (debug) = no
* GCOV options used = no
* Profiling enabled = no
* mono prefix = /usr
* Default MonoApplicationsConfigDir = /private/etc/apache2/mod-mono-applications

Take note that there's a problem with the pkg-config-0.18.1.tar.gz stuff on Snow Leopard 10.6.5
you will need to download those shitnitz here http://ftp.novell.com/pub/mono/sources-stable/

:)

Thursday, December 16, 2010

XKCD 541 Emoticon Conundrum

Answer to emoticon conundrum http://xkcd.com/541/

When on Mac, press option+command+t and select the happy face character. Unfortunately that don't solve the problem entirely, there's no wink character ;-)

Saturday, December 11, 2010

Run multiple instances of an app on Mac OS X

Click Applications on Dock, select Automator. Choose Application. On searchbox, type: shell. Choose Run Shell Script, double click it. Then on text area, replace it with this text:

if [ -n "$*" ]; then
    open -n "$*"
else
    osascript -e 'tell app "Finder" to display dialog "PLZ DRAG AN APP 2 MULTIPLE INSTANCE" with title "MULTIPLE INSTANCE LAUNCHER" buttons { "OH HAI" } '
fi

On Pass input, change it to as arguments. Press command+S, on Save as type: Multiple Instance, on Where, choose Applications, click Save. Quit Automator.

Click Applications, drag Multiple Instance to Dock, preferably near Applications folder.

Click Applications, drag an app(example: Calculator) to Multiple Instance, repeat to launch multiple instance of that app.

Watch it on YouTube

mysql anyone?

Saying SEQUEL SERVER instead of MSSQL SERVER is a big no-no for me how about you ? What's up with that? What are the problems of the world ? Why are we here? Those questions intrigues me. Lol! To get you going with uninstalling MySQL on Mac OS X Leopard.

To uninstall MySQL and completely remove it (including all databases) from your Mac do the following:

Use mysqldump to backup your databases to text files!
Stop the database server

sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
rm -rf ~/Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*

The last two lines are particularly important as otherwise, you can't install an older version of MySQL even though you think that you've completely deleted the newer version!

Steve Ballmer on Developers

Are you a "Steve Ballmer" today? I mean, is the weather to hot that you sweat a lot? Your car aircon does not work? Is the sun so high you want to go to the beach?

You get my drift? Maybe this video can help.



This video came from this videos:



and



Credit goes to the respective YouTube uploaders.