Beyond Web Logs

Discuss technology, web development, networks and more ...

Recent posts

Tags

First time here? At BeyondWebLogs we discuss technology, web development, personal development, networks and more. You can subscribe to the RSS feed so that you keep up to date with the latest content. Now, on with the regular content...

SQL How To - Syntax of INNER JOIN, EQUIJOIN and NATURAL JOIN

 

An INNER  JOIN combines the records from two tables using comparison operators in a condition. Columns are returned only where the joined rows match the condition. 

Here the quick review of the syntax of the INNER JOIN: 

SELECT somecolumns
FROM table1
INNER  JOIN
table2
ON somecondition

If the condition (somecondition in above syntax) tests the equality then INNER JOIN becomes EQUIJOIN. EQUIJOIN tests for equality.

Similarly, if the same condition testes in-equality using <> symbol, then INNER JOIN becomes NON-EQUIJOIN.

Last but not the least, is the NATURAL JOIN. Natural Joins only work if the columns you are joining by has the same name in both tables. So NATURAL JOIN, bascially identifies joining column names automatically and you don't have to specify condition.

  

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: SQL
Posted by Waqas on Thursday, May 29, 2008 5:57 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Simple Open Source Logging Framework for .Net

There is a new simplified open source logging framework in the block for .Net developers. Here is the link for your review:

Live Labs Logging 

Do let me know if its of any help!

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: Better Coding
Posted by Waqas on Thursday, May 29, 2008 12:07 PM
Permalink | Comments (0) | Post RSSRSS comment feed

ASP.NET DropDown selected text problem - How to retain SelectedIndexChanged data


There is a common pitfall faced by many ASP.NET developers that they bind their drop down lists in Page_Load and then expect it to maintain its SelectedIndexChanged state across page loads, which in reality never happens.

Actually, that binding should be done in Page_Init so that data binding and its associated event handlers are not being reloaded during Page_Load.

So conclusion is, always bind your drop down list in Page_Init() to avoid selecteditem text loss in asp.net drop down lists.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: Tips n Tricks
Posted by Waqas on Tuesday, May 27, 2008 8:31 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Free tool to analyze your C# code to produce elegant, consistent code - Microsoft Source Analysis

Here is a new tool from Microsoft called "Source Analysis" that perfoms its analysis on source code directly, unlike FxCop which only works on binaries.

The ultimate goal of Source Analysis is to allow you to produce elegant, consistent code that your team members and others who view your code will find highly readable. In order to accomplish this, Source Analysis does not allow its rules to be very configurable. Source Analysis takes a one-size-fits-all approach to code style, layout, and readability rules. It is highly likely that you will not agree with all of the rules and may even find some of the rules annoying at first - However, the majority of teams using this tool within Microsoft have found that after a short adjustment period, they came to appreciate the rules enforced by Source Analysis, and even began to find it difficult to read code not written in this style. 

Source Analysis comes with a set of default rules analyzers covering approximately 200 best practice rules. These rules are full compatible with the default layout settings in Visual Studio 2005 and Visual Studio 2008.

Specifically, these rules cover the following, in no particular order:

  • Layout of elements, statements, expressions, and query clauses
  • Placement of curly brackets, parenthesis, square brackets, etc
  • Spacing around keywords and operator symbols
  • Line spacing
  • Placement of method parameters within method declarations or method calls
  • Standard ordering of elements within a class
  • Formatting of documentation within element headers and file headers
  • Naming of elements, fields and variables
  • Use of the built-in types
  • Use of access modifiers
  • Allowed contents of files
  • Debugging text

After installation, Source Analysis can be run from within the Visual Studio IDE, and can also be integrated into MSBuild-based command line builds.

Source Analysis for C# can be downloaded Here.

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: Better Coding
Posted by Waqas on Monday, May 26, 2008 7:57 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Improve performance of your machines - 10 great tips to increase your system performance

We all want faster machines. Slow machines, especially ones that freeze up, constantly interrupt one's thought process and can pull them out of the zone. It's not just the extra 20 minutes spread throughout the day, it's also all the time lost to re-focus yourself after waiting for a long process. I'm no machine performance expert, but here are some tips:

1. Run Defrag.

You can run this via the command line, such that you hook it up to a weekly script. This MSDN explains: "Disk fragmentation slows the overall performance of your system. When files are fragmented, the computer must search the hard disk when the file is opened to piece it back together. The response time can be significantly longer."

defrag c:\ /v /f

2. Clean up your hard drive.

A crowded hard drive makes your machine run slower - there's just less wiggle room for the operating system. I've heard some suggest that you should have at least 25% free. You'll need two big things for this: (A) a backup drive for offloading infrequently used files, and (B) a tool to find obsolete files. One good, free, tool is CCleaner, which detects most of the common spots for dead-weight files. Another tool, SequoiaView, shows all files sizes in a treemap graph so that you can easily see which files are taking up space.

3. Clean out your registry

If you're continually installing and uninstalling programs, your registry may get bloated, causing big slowdowns. Modifying your registry is dangerous and could irreparably corrupt your entire machine (i.e. back up your registry and machine data first). But, given the potential performance gain, it's still worth doing some easy changes. While there are several commercial  registry cleaner products out there, CCleaner is free and works well - it plays it safe and only removes the obvious registry errors. CCLeaner has a feature to clean out much of the garbage from your registry.

4. Adjust your UI settings

Windows XP (I haven't touched Vista yet) lets you choose the balance between "pretty UI" vs. "fast UI". The idea is that pretty graphics (shading, rounded corners, transitions, etc...) take extra resources to render. If you're a developer who wants speed and doesn't care about gradient-shaded window panels, you can turn that stuff off: In "My Computer > Advanced > Performance Options", adjust for "best performance." This will make everything look like old, grey, boxes - but it will be faster.

5. Kill or Block certain "hog" processes and system startup apps

Background services are a big culprit for hogging resources, because these services could always be running. Skim through your Window Services to make sure that all the currently running (or automatic ones) are ok. If a service doesn't sound familiar, ask your IT department if you can kill it. In addition to services, applications that automatically start up when the machine turns on can make for a slow system startup. CCLeaner has an option for this as well, where you can explicitly block unwanted apps from automatically starting up.

6. Avoid running too many programs at once

This is pretty obvious. Under Task Manager, the Performance and Processes tabs can show you your CPU, Commit Charge, and stuff like that.

7. Uninstall the programs you don't need

The more stuff on your machine, the slower it will run. For example, if you no longer develop with VS 2003, remove it. This is also a good reason to avoid installing all those games on your poor, overworked PC.

8. Use batch scripts to turn off processes when you don't want them

Sometimes you need that heavy service running in the background, but sometimes you don't. For example, SQL Server can take a lot of resources. Consider having a batch script that starts it up and shuts it down - not just opening and closing SQL Studio, but stopping the actual service. You can use the "net" command in a batch script to start and stop services:

net start "SQL Server (SQLSERVER2005)"
net start "Distributed Transaction Coordinator"
 

net stop "SQL Server (SQLSERVER2005)"
net stop "Distributed Transaction Coordinator"

9. Startup script

I try to avoid re-booting my machine because I loose all my sessions - open windows, loaded files, running applications, etc... One thing that slightly eases the pain is having a batch script (clickable from my desktop) that re-opens all my standard stuff, like NotePad, Browsers, Cmd, and Windows Explorer. I don't necessary want this as part of my startup, but it saves me a minute to just click the batch and have several applications all re-open themselves.

10. Run Disk Cleanup

Sometimes your machine may run slow because of a bad disk. Consider running Disk Cleanup. This MSDN article describes more (it also mentions freeing up disk space and defragmenting).

Other ideas

There's always more you can do. I found these other articles to be infromative reads:

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: Tips n Tricks
Posted by Waqas on Monday, May 26, 2008 7:41 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Tips to increase your Empathy

Empathy is the ability to identify or sense what another person is feeling.  It is like seeing through someone else’s eyes.  Empathy should not be confused with compassion, which is the desire to alleviate the suffering of another, and sometimes contains empathy, but really goes beyond it.  You can act compassionately even when you do not empathize with a person’s emotional state or situation.

Some people are naturally empathic, but it’s a skill that can be developed with practice.  Here are 5 steps you can take that will lead to greater empathy:

1.  Listen intently to others
Do you ever find yourself in an interesting or heated conversation and all you’re doing is thinking about what you’re going to say next without really hearing what the other person is saying?  If you’re not listening, how can you understand their points?  And if you’re not listening to them, there’s a real good chance they’re not listening to you!  The next time you find yourself in a conversation with someone, listen intently.  Quiet the chatter in your own mind and really listen to what the other person is saying.  You might hear something you would normally have missed.  Don’t decide in advance what you’re going to say.  Just listen.  When you do this, you’ll begin picking up feelings and emotions from the person talking which will help you understand them better.  Then when you respond, you’re coming from a place of understanding.

2.  Imitate body language
Many years ago Steve and I went to a Tony Robbins Firewalk seminar.  During one portion we had to break into groups of three.  I found myself paired up with two men I’d never met.  Person A was supposed to think of a time in their lives when they were having a strong emotional reaction.  They were then supposed to get into that state again.  Person B was supposed to exactly model Person A’s physiology.  And Person C was there to make sure that Person A and Person B were a total match down to eyelids twitching or blinking.  So in our case, Person A got into a state and I had to model his physiology.  One of my legs was jumping up and down, my breathing was fast, and my hands were clawing at my legs.  Once Person C said we were a match I was supposed to say what emotion I was feeling.  I said, “I feel really nervous right now.  In fact, I feel like I’m about to jump out of an airplane.”  Person A exclaimed, “Oh my God!  That’s the exact memory I was thinking of.  The first time I jumped out of an airplane.”  Not only did I pick up on his emotion correctly, I knew the exact memory he was having.  Total stranger.  Picked it right out of his brain, or I should say, his physiology.

So what do you think would happen if you modeled or imitated the physiology of the person you’re talking to?  Right!  You will understand them better, you may even discover you have telepathy. :) Modeling the physiology of other people will increase your empathy.

3.  Put yourself in their shoes
One of the best ways to increase your empathy is to imagine what life is like in someone else’s shoes.  Most people won’t go to the trouble, but if you can imagine what someone else might be going through, it will increase your level of empathy by a huge factor.  The next time you’re with someone who is going through a rough time, or even a really exciting time, take a moment to get out of your own head and imagine what they’re feeling.  Then ask them if that’s how they’re feeling.  “Hey Johnny, I heard you lost your job.  I imagine you’re feeling a depressed and anxious, right?”  Or, “Sophia, congratulations on becoming a grandmother.  You must be feeling excited!”  See what she says.

You can do this with total strangers too.  Ever witness a car accident and think, “Glad that wasn’t me,” or “I can’t be late for work so I hope they clear this out of the way fast!”  That’s not empathy.  Next time take a moment to imagine what the people involved in the accident are feeling.  “Wow, I’ll bet that person is really shaken up.  I hope he’s alright.”  Spare a thought for your fellow man.  But for the grace of God, it could have been you.  If you offer help, that’s compassion, or what I like to think of as empathy in action.

4.  Show understanding
Think about the last time you felt totally and completely understood by someone.  Feels good doesn’t it?  Return the favor.  The next time a friend, child, or your partner is telling you about something that happened to them show that you are listening by repeating back what you heard.  “So what you’re telling me is that you feel lonely when I go out every weekend with the boys and you want me to spend more time with you.  Is that right?”  This is also called empathic listening.  It works great in an argument.  The next time you’re fighting with someone listen to what they’re saying, don’t interrupt, and then repeat back to them your understanding of what they just said.  I cannot tell you how powerful this is.  Refrain from making your own point until your partner indicates he or she feels completely understood.  They’ll be more willing to hear you speak when you’ve shown you’re willing to understand their point of view first.

5.  Expand your awareness
You don’t live in a bubble, even though sometimes it might feel like it.  The world doesn’t revolve around you either.  You’re sharing it with billions of people.  Expand your awareness of what other people are doing.  For fun sit down in a crowded place like a movie theater, mall, bookstore, etc. and do some people-watching.  You’ll see people who are in a hurry, people arguing with each other, people who are worried, teen boys checking out teen girls, and all manner of behavior.  See if you can discern what’s going on.

Ref: http://www.erinpavlina.com/blog/2008/05/5-steps-to-greater-empathy-and-oneness/

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: Personal Dev
Posted by Waqas on Wednesday, May 21, 2008 8:01 PM
Permalink | Comments (1) | Post RSSRSS comment feed

DTMF (touch Tone) issue : not able to enter valid pin code with Asterik on VOIP

DTMF issue while dial in/out pin code and some time extensions, this is very common issue and you can solve it easly.

It's not asterisk problem. It's your provider....
And the dtmf mode as if you are using dtfmmode=inband and the provider did something with their system and now all of a sudden it doesn't work.
try to use rfc2833 it is common mostly used by VoIP providers.

dtmfmode=rfc2833
canreinvite=yes

And if that doesn't work-

one more thing you can:

dtmfmode=auto (it works)

if still you are not able to go throught then who is your provider? check their portal or create trouble ticket there.

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: Asterisk
Posted by Naveed on Tuesday, May 20, 2008 11:44 PM
Permalink | Comments (0) | Post RSSRSS comment feed