Monday, December 8, 2014

Intro to Delphi

Delphi Enterprise
from Pascal and Lazarus(Use Pascal Compiler)

Delphi Code:
procedure TForm1.btnShowMessageClick(Sender: TObject);
begin
     MessageDlg('It is fun to program with Delhi', ,mtInformartion, [mbOK], 0);
end;

Visual Basic:
private sub btnShowMessage(sender As Object, e As EvemtArgs) Handles

btnShowMessage.Click
MessageBox.Show("It is fun to program in Visual basic", "Information",

MessageBoxButtons.OK, MessageBoxIcon.Information)

End Sub

C#:
private void btnShowMessage_Click(object sender, EventArgs e)
{
MessageBox.Show("It is fun to program in C#", "Information",

MessageBoxButtons.OK, MessageBoxIcon.Infomation);
}

RAD(Rapid Application Development):
Programmers add Custom Code with an existing chunk of code and prepare a productive programs.


IDE:
Speed Bar
Component Pallete - Organise components
Often used are: Standard and Additional Tabs
Object Preview - Article list of Project which we used.And displayed in a tree view.
Below Object Inspector - Change the properties and events of particular Object on the screen.


Delphi Saving and Organizing Files:
Saving :

  • Unit File(.pas extension) Unit1, Unit2, etc...(frmFirstDemo_u)
  • The Project File(.dpr Extension - delphi project) FirstDemo_p


-- All files are saved the place where Unit Files are saved.

Exploring Delphi Files:
Initially when we save 2 files it haves 8 files
View > Forms for UI when the UI is not displyed.

For Run: F9

Naming Convension

Wednesday, December 3, 2014

Difference between ViewData, ViewBag and TempData ?


ASP.NET MVC offers us three options ViewData, ViewBag and TempData for passing data from controller to view and in next request. ViewData and ViewBag are almost similar and TempData performs additional responsibility. Lets discuss or get key points on those three objects:

Similarities between ViewBag & ViewData :

Helps to maintain data when you move from controller to view.
Used to pass data from controller to corresponding view.
Short life means value becomes null when redirection occurs. This is because their goal is to provide a way to communicate between controllers and views. It’s a communication mechanism within the server call.
Difference between ViewBag & ViewData:
  • ViewData is a dictionary of objects that is derived from ViewDataDictionary class and accessible using strings as keys.
  • ViewBag is a dynamic property that takes advantage of the new dynamic features in C# 4.0.
  • ViewData requires typecasting for complex data type and check for null values to avoid error.
  • ViewBag doesn’t require typecasting for complex data type.


ViewBag & ViewData Example:


public ActionResult Index()
{
    ViewBag.Name = "Narendra Modi";
    return View();
}

public ActionResult Index()
{
    ViewData["Name"] = "Narendra Modi";
    return View();
}

In View we use as:

@ViewBag.Name
@ViewData["Name"]

TempData:

It is also a dictionary derived from TempDataDictionary class and stored in short lives session and it is a string key and object value. The difference is that the life cycle of the object. TempData keep the information for the time of an HTTP Request. This mean only from one page to another. This also work with a 302/303 redirection because it’s in the same HTTP Request. Helps to maintain data when you move from one controller to other controller or from one action to other action. In other words when you redirect, “Tempdata” helps to maintain data between those redirects. It internally uses session variables. Temp data use during the current and subsequent request only means it is use when you are sure that next request will be redirecting to next view. It requires typecasting for complex data type and check for null values to avoid error. generally used to store only one time messages like error messages, validation messages.

public ActionResult Index()
{
  var model = new Review()
            {
                Body = "Start",
                Rating=5
            };
    TempData["ModelName"] = model;
    return RedirectToAction("About");
}
public ActionResult About()
{
    var model= TempData["ModelName"];
    return View(model);
}


The last mechanism is the Session which work like the ViewData, like a Dictionary that take a string for key and object for value. This one is stored into the client Cookie and can be used for a much more long time. It also need more verification to never have any confidential information. Regarding ViewData or ViewBag you should use it intelligently for application performance. Because each action goes through the whole life cycle of regular asp.net mvc request. You can use ViewData/ViewBag in your child action but be careful that you are not using it to populate the unrelated data which can pollute your controller.

Tuesday, November 25, 2014

To Fetch the Top most result in SQL Server 2012



The Task is to fetch the top most value from the same identical other column values:

For Ex:


Create table #MyTemp(Name varchar(10), Value varchar(10))

insert into #MyTemp(Name, Value) values('Awais', '100')
insert into #MyTemp(Name, Value) values('Raghu', '500')

insert into #MyTemp(Name, Value) values('Awais', '110')
insert into #MyTemp(Name, Value) values('Raghu', '550')

Code:

select * from #MyTemp

select *
FROM #MyTemp
WHERE Value NOT IN
(
SELECT MAX(Value)
FROM #MyTemp
GROUP BY Name)



Saturday, May 18, 2013

Being negative is not how we make progress - Larry Page @ Google I/O 2013



The keynote address at Google I/O 2013 was undoubtedly an incredible experience. While Google made some breathtaking announcements about new products and number of users, what remained with me is the talk by Larry Page.

Some of the key messages from his talk worth pondering over -

Being negative is not how we make progress, everything is not a zero sum game.

Open standards and reciprocal approach will lead to an evolved tech world, inter-operations needs to exist, in the process grows the whole eco-system (and not just take).

Collaboration and speed is needed to evolve technology at a much faster pace than currently what is happening India and other geographies in the east are evolving much faster than we can imagine, mobile is driving the change

People are starving in the world not because we do not have enough food but because we are not organised
Young people need to get involved in studying engineering, maths and sciences

Larry Page radiated an optimism saying, “we have hit only 1 percent of what we are capable of producing (honestly the announcements before his talk, especially the massive earth image in the background made it hard to believe that it’s just the beginning  ), his humility while taking questions from the audience was very inspiring and clearly demonstrated what makes him the head of a global tech giant.


Source - YourStory.in

Sunday, October 28, 2012

New Project and plan at a budding stage...!!

After some small research got finalized to get go for an unknown path for my future...
Implementing new ideas which was rarely implemented in our whole country...
I will try my level best to make it happen as early as possible...

Monday, December 26, 2011

Continuing with the Windows Phone 7 Tutorails...

After a long back now again have to kick start my windows phone 7 applications learning through www.Pluralsight.com earlier have completed the courses :

"WP7 Fundamentals(Overview)" which was a platform introduction to the WP7 which deals with :
  1.  Mobile OS
  2. Consumer Focused
  3. Features :  Smart Design & Integrated
which was successfully completed and then started the Video - 2 i.e,
"Core Windows Phone 7 Development" which has many topics included as :
  1. Isolated storagefiles,
  2. Isolated storagesettings,
  3. Isolated storagefilestream
Then continued with Launchers and Choosers...

and then Video - 3 which was loaded with Accelerometer & Gestures...

now have to again start and have to complete the whole course and even have to start "SILVERLIGHT" as it has a major deal with my MINI-Project too..

Monday, November 28, 2011

Aakash to fit small pockets, not for Apple addicts
- ‘World’s cheapest tablet’ comes with low price and some attendant uncertainties
  

India launched “the world’s cheapest tablet” that will eventually be sold at Rs 1,000 to students and Rs 3,000 to others.

First, the features that should win Aakash applause.

The government will give subsidy of Rs 800 on each device, bringing the cost to nearly Rs 1,000 apiece.

Mainstream tablets with similar specifications sell for Rs 5,000-plus even after discounts. The price tag makes Aakash accessible to those who so far have not been able to afford any computing device. The big daddy — Apple’s iPad costs a $600 (Rs 30,000) in India. Last week, Amazon’s Kindle Fire shook up the global tablet market with a price tag of $199 (Rs 9,750). The cheapest tablet so far has been the HP Touchpad at $99 (Rs 4,851).
Now the less effusive points.
Some of the mainly middle-class students at today’s event said it needed refinement but was a good option for the poor. 


Specifications : 

  • Unbeatable Price:
    • Only Rs.2,999 for the UbiSlate
    • Monthly internet charges: Rs.98 / 2GB
  • High Quality Web Anytime & Anywhere:
    • Connect via GPRS or WiFi
    • GPRS: Embedded modem eliminates the need for external dongles and allows Internet access everywhere
    • WiFi: Allows fast Youtube videos at hotspots
  • Multimedia Powerhouse:
    • HD Quality Video
  • Watching movies in the palm of your hand on a 7” screen
    • Audio library software helps manage your full collection of songs
  • Applications Galore with Android 2.2:
    • Games
    • Productivity software: Office suite
    • Educational software
    • Over 150,000 apps!
  • Full sized-USB port & Micro-SD slot:
    • Expand memory to 32GB
    • Use any ordinary pen-drive
    • Even plug-in a 3G dongle
  • And It’s a Phone!
Configuration :
  • Hardware:
    • Processor: Connexant with Graphics accelerator and HD Video processor
    • Memory (RAM): 256MB RAM / Storage (Internal): 2GB Flash
    • Storage (External): 2GB to 32GB Supported
    • Peripherals (USB2.0 ports, number): 2 Standard USB port
    • Audio out: 3.5mm jack / Audio in: 3.5mm jack
    • Display and Resolution: 7” display with 800x480 pixel resolution
    • Input Devices: Resistive touch screen
    • Connectivity and Networking: GPRS and WiFi IEEE 802.11 a/b/g
    • Power and Battery: Up to 180 minutes on battery. AC adapter 200-240 volt range.
  • Software:
    • OS: Android 2.2
  • Supported Document formats: DOC, DOCX, PPT, PPTX, XLS, XLSX, ODT, ODP
  • PDF viewer, Text editor
  • Multimedia and Image Display
    • Image viewer supported formats: PNG, JPG, BMP and GIF
    • Supported audio formats: MP3, AAC, AC3, WAV, WMA
    • Supported video formats: MPEG2, MPEG4, AVI, FLV