Styling table cells in a particular column using CSS

While cleaning up and refactoring my code, i used the following CSS hack. This one made my code look more beautiful and readable, 

To apply CSS style to every table cell (td) in a particular column, without applying the class/style attribute to every table cell in that column, and without JavaScript, we can use pseudo classes and /or sibling selectors: 

For the first and last columns you can use the :first-child and :last-child pseudo class:

td:FIRST-CHILD {
    /* Properties for first cell of every row */
}
td:LAST-CHILD {
    /* Properties for last cell of every row */
}

You can also To style specific table cells you can use and combine :first-child with the adjacent sibling selector+ 

td:first-child {
    /* Properties for first column of every row */
}
td:first-child + td {
    /* Properties for second column of every row */
}
td:first-child + td + td {
    /* Properties for third column of every row */
}

This works like a charm.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

MVP Summit Nov 2013 Recap

Last week had been a roller coaster ride for me. Within span of seven days, i had one of the best experiences of my life more than once. And one of them was Microsoft MVP Summit 2013 – Part II . MVP Summits are the best part of the Microsoft MVP Program. Being in US, i was lucky, i could make easy travel plans to attend the MVP Global Summit twice this year within short gap of 10 months.

The summit was a great event and place to meet fellow MVPs, engage product groups and with regards to the contents presented or discussed (which for obvious reasons I can’t disclose as they are under NDA). It started with the MVP showcase at the Hyatt. It was great to see the exciting stuff MVPs around the globe are doing. MVPs presented their apps, ideas and projects they are working on. Apart from the great food at Hyatt (please read that sarcastically), there were some info desks from various Microsoft teams which were quiet informative.

The summit was well organized like last year,with frequent transportation from the hotel to the summit locations on Microsoft campus for sessions during the day time. Evenings were filled by regional or global events for meeting people while enjoying food and drinks. This included a party by Infragistics, Github Meetup party, South Asia MVP Dinner, MVP Welcome party, PGI Dinner followed by the final party at Seattle aquarium with lots of good food, sea animals, a ferris wheel, tattos, casinos and music.

The benefit of attending the MVP summit is the chance to interact with the Product Group (PG) members in Microsoft as well as network with other MVPs. This opportunity to talk, share pain points and things that are working well is invaluable. I was so happy to discuss with the Outlook team that my feedback which i provided in last summit was taken in consideration and two of the three pain points i shared were already taken care of.  Having sessions presented by the PG team members and the ability to give feedback is cool. I had some awesome conversations with Internet Explorer team their vision and EC6. Discussing EC6 with the guys who are implementing and working on it from Microsoft front, is really a great experience.

Learnt about tools like fiddler and one of the best part was the creator of tool who was a Microsoftie and present MVP took time to explain me the tool in depth. Followed by this session, i attended Bing for Developers session. Though i can not say much about it, but Bing would be the best thing a developer would require in near future. Totally loved the **** feature. (Can’t talk about it due to NDA i signed up with Microsoft, but this is one exciting feature).

During the 4 days is spent there, i learnt a lot, and enjoyed/partied a lot. I am really glad and thankful to the team behind the scenes. A big thank you to the MVP Award program, the MVP Global Summit organization, my MVP lead Biplab Paul and last but not least the product groups for providing such great content and finding time to engage with MVPs.

All the pictures from my trip to Seattle and the MVP Summit are up here Thhislife: https://it.thislife.com/o2V4Vdut Skydrive: http://sdrv.ms/17Pwhys

And this one is my favorite picture:
WP_20131120_15_29_01_Pro

Taken up by Lumia 1020.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Web development and debugging tools

MVP Summit at Microsoft was an event with loads of information. Within the short span of three days, i learnt about several new tools that can make life of a developer easier. These tools can be used for development, debugging, testing and more processes. Here are some of the tools which i came across and learnt and found useful for a developer .

1. Fiddler : A free web debugging proxy for any browser, system or platform http://fiddler2.com/

2. JSHint : A tool that helps to detect errors and potential problems in your JavaScript code.  http://www.jshint.com/

3. JSComplexity : Software complexity analysis for Javascript projects. http://www.jscomplexity.org/complexity

4. ESPrima : A high performance, standard-compliant ECMAScript parser written in ECMAScript. http://esprima.org/

5. Postman (Chrome extension) : A REST Client that stores history of sent requests and collections. Chrome Webstore : Postman

6. Poster (Firefox extension) : A developer tool for interacting with web services and other web resources that lets you make HTTP requests, set the entity body, and content type. Pretty much like Postman.  https://addons.mozilla.org/en-us/firefox/addon/poster/

7. JSON Viewer : Convert JSON Strings to a Friendly Readable Format jsonviewer.stack.hu

8. JSLint : A JavaScript program that looks for problems in JavaScript programs. It is a code quality tool. http://jslint.com/

9. JSFiddle : Online Web Editor http://jsfiddle.net/ Chrome webstore: jsfiddle

10. Cdnjs : Host almost all the popular JavaScript libraries, CSS, SWF, images, etc! http://cdnjs.com/

11. Sql Fiddle : Build a representative database (schema and data) and post a link to it in for sharing with online Q and A communities like Stackoverflow. http://sqlfiddle.com/

12. Firebug : Off course i need not to explain this one. The best one of all. http://getfirebug.com/

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Upcoming changes in ECMAScript 6

ECMAScript is a standard that scripting languages like JavaScript and ActionScript are based on. ECMAScript is owned by ECMA International which owns other number of standards like ECMAScript intern and JSON too.  At one of the sessions today during MVP Summit,  the speaker discussed about ECMAScript 6 and changes in programming constructs being added to it.

ECMA 6 allows the following constructs:

Let and Const

  • let is the new var
  • const is read only let
  • let/const can replace var
  • Semantics
    • Block scoped
    • No use before declaration
    • Const cant be reassigned

Let Statement
const Statement

New collections

Internationalization in ECMA 6

  • Huge Unicode data tables
  • Culture sensitive string sorting, number/date formatting
  • Adds native JavaScript support for
    • 364 locales
    • 18 numbering systems
    • Data patterns
    • Calendaring systems: gregorian/islamic/hebrew etc

ES6 upcoming features

  • Classes in JavaScript
  • New function signatures
    • Arrow function -terse
    • Default paramaeters – if no parameter, use default value is used
    • Rest parameters – bind any trailing parameters to an actual array
  • Iterators
    • Call a.next() until end
    • New looping constructs
  • Generators
    • Function can yield many times before returning

To test let construct, you may use following script:

<script>
 var i =5;
 alert(i);
 let j = 10;
 alert(j);
 </script>

This will run perfectly fine on IE11, for Chrome go to chrome://flags and enable experimental Javascript, Firefox try nightly build to test the new features.

More Code examples to follow.

TC39 drafts: http://tc39wiki.calculist.org/

ES Wiki: http://en.wikipedia.org/wiki/ECMAScript

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Debugging in Smarty template

While trying to debug a variable in PHP i love the var_dump() method. Off course i have debugger tools like xDebug enabled in my IDE i love using var_dumps. One of the thing i like about var_dump is it gives the complete structure of an object at that instance. Using MVC model for PHP usually ties you up with a framework and a choice of view. For Zend it is smarty which i use, and smarty is not straight forward to debug like PHP. After some research i found out various ways to use var_dump. Here are they:

Method 1:

{php}
$var = $this->get_template_vars('var');
var_dump($var);
{/php}

Using php tags is not good practice and ideally they should be disabled for security reasons anyway

Method 2:

{$var|@print_r}

It only outputs the values and not the keynames, and there are no spaces between the values, so it’s not ideal for debugging.

Method 3:

{$var|@var_dump}

Method 4:

 {debug}

just use debug in your .tpl and look at your sourcecode

Method 5:

{$varname|@debug_print_var}

Few of these methods are taken from StackOverflow. If you know more do comment or cite them. Will update the list.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Reverse Commit Code changes in SVN

SVN is one of the great tools when it comes to controlling the version of your code. Code can be committed at instances to the repositories and each change is saved as a change set. Sometimes while working with SVN, there comes a need for reversing a change. Rolling out a committed change set is not straight forward in SVN and may require some trick.

This can be really helpful in case when you are working on a repository copy like /trunk and you find the changes made by you in last revision or changeset (Say Changeset #783) are wrong or they should not have been committed. Now one of the solution in such scenarios can be making changes again to your codebase which revert the changes you just committed. That works, and i have done it sometimes. But, what happens if you have multiple files and many code changes that you commit in changeset #783. Or what happens when you have committed multiple changesets after that and are sitting on Changeset #783 may be.

For such situation, you can use svn merge to “undo” the change in your working copy, and then commit the local modification to the repository.

For this you need to do is to specify a reverse difference:

$ svn merge -r 783:782 http://svn.windowsvj.com/coderepo/trunk/library/
U badFile.php
$ svn status
M badFile.php
$ svn diff
# verify that the change is removed …
$ svn commit -m “Undoing change committed in r783.”
Sending badFile.php
Transmitting file data .
Committed revision 850.

By using the -r switch, svn merge apply a changeset, or a whole range of changesets, to the working copy. In this case, SVN merge is applying changeset #783 to the working copy backwards.

Keep in mind that rolling back a change like this is just like any other svn merge operation, so you should use svn status and svn diff to confirm that your work is in the state you want it to be in, and then use svn commit to send the final version to the repository. After committing, this particular changeset is no longer reflected in the HEAD revision.

Although the master branch is Good now, the original change still exists in the repository’s history.

In case, you find an error like :

svn: Cannot reverse-merge a range from a path’s own future history; try updating first

Try updating your working copy before making any commits.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Centre a DIV Block using CSS Styling

helloWorldCSS

Working on some templates these days, one of the most painful thing i found was styling the div containers. While styling the DIV containers, one of the roadblock was to centre align a DIV. At first i thought its as simple as adding text-align styling to center for that div as below:

#divToBeAligned {
    text-align: center ; 
}

However, the rule centres the text inside the box, instead of the block itself. This was causing the block to stay at the same position but internal contents to be aligned center, which is not as I desired i.e. centre the entire block but leave the internal contents formatted as it was before.

To center the block in CSS i had to do the following:

1. Specify a width for the DIV block.
2. Set both its left and right margins to auto.

When both margins are set to auto, web browsers are required by the CSS standard to give them equal width.

For example, if you want your div block to have a width of 526px pixels, the following code will centre the block.

#divToBeAligned {
  width: 526px ;
  margin-left: auto ;
  margin-right: auto ;
}

This will get the block in the shape you want. Happy Styling :)

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Windows Phone 8 .. almost there only if they get …

I am a Windows Phone 8 user since almost an year grabbed Lumia 920 to start with, love the platform UX/UI and have developed some apps for it too. Apps for WP8 by Me.

485799_10151025732242397_1466152788_n

There are some changes suggestions, i have for this platform, which if added can make it the perfect phone, and here i am talking about some very basic features, apps which may have alternatives but they are not the best…

1. Create a folder on the homepage. I always want to group a set of apps. Didn’t found anything for WP8 yet.

2. Notifications ? I hope GDR3 fixes that, but till its not there, i would add that to list.

3. Music: Playlist – Understand i can get some songs on storage of phone, but its really painful to create a playlist. And it drives me crazy that Apps like Spotify (with rating almost 3 of 5) are still being counted when it comes to music on WP8. Xbox Music, i admit its a nice improvement, but it needs to get a recommendation system plus playing the music on WP8 should be as easy as it is on web service for Xbox music. I am from India, love the hindi music, and there is a perfect web service for that, Saavan. It is also called Desi-Spotify but this is absent from the WP8 platform. India being major consumer for WP8, shouldn’t the WP8 team make efforts in this direction ? It will definitely please a lot of customers.

4. Ability to sort apps in WP8, pretty much same thing which Windows 8.1 offers now. when you have a couple of apps installed, its difficult to find the one you installed recently. Same case when you install bunch of apps at a go, its hard to find which one you just installed.

5. Default “Pin to taskbar” option when an app is installed would be an awesome feature and if it is added, this can take care of requirements in Point # 4.

6. Deal with it, People Tile is one of the most interesting feature, that is not living it to its potential. What’s the use of this ? just to see who changed their profile pic ? Really ? Would n’t it be nice if we can click on the people tab and it can take to profile of the specific person we tapped on ?

7. Speedy updates. Remember you have not just to match competitors but to surpass them. Have been hearing about GDR 2 since last 3 months not available on AT&T yet for Lumia 920, GDR 3 rumors are around the corner too. I hope with almost 25K Nokia employees this can be put on priority.

8. Hear customer voice. Do the same thing which Windows team did, heard from customer and incorporated the changes in the next version 8.1 which is very well received and appreciated even before the public availability.

9. File Manager. i need that badly. Although i have been learning to adjust with that, but why when it is provided by competitors. And this will sure enhance UX.

10. I NEED STATUS BAR (Liked by almost every other WP8 user) And under status bar, shortcut to turn on/off connections and Internet sharing. I have paid for extra Mobile data so many times because i forgot to turn off the data many times as it was not visible in status bar.

I have great expectations from GDR 2, GDR 3 with Kortona, only if they get them on time. Microsoft already knows they have a lot to catch, and they have seen a drastic change from Windows mobile to Windows Phone 7 to Windows Phone 8. But every day delayed is dragging them behind. With rumors of Windows RT being integrated into Windows Phone devices, they may seek huge advantage too, but they need to hear what customers/consumers want plus they need to SHIP IT and ensure wireless carriers follow the same model of speedy updates.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Fourth Anniversary Giveaway : Win gifts worth over $1000

Hi All,

As you know WindowsVJ just completed four years in the blogosphere. To celebrate the same and thanks all the readers, we have a pretty sweet giveaway.

FourthBirthday-MARRIAGEANDBEYOND

To start with, Shutterfly Inc was generous enough to allow us to share some discount cards and gift cards. We have five each to share from Shutterfly Inc brands Shutterfly, Tinyprints, Weddingpaperdivas and Treat.

The other giveaway is one Windows 8 License. :)

And the final one is three Amazon Gift cards worth $100.

And yes, every one who participates will get a free digital copy of my book on Microsoft Office 2010.

How to win ? No sweat…. Just follow the rules and increase the chances to win. To enter the contest all you need to do is Comment here with your favorite blog post from WindowsVJ, However, to maximize the chances you may also practice the following :

1. Subscriber to WindowsVJ.com Newsletter: Just type your email address and complete the subscription request. (A verification mail will be delivered to Inbox, follow the mail to verify the subscription to complete the request)
2. Be a Fan of WindowsVJ @ Facebook and share this post and your favorite posts.
3. ReTweet and/or share your favorite posts at WindowsVJ from Twitter (Any number of Posts).
4. You can join our LinkedIn group and be a fan of that page.
5. Download our apps for different mobile platforms, rate and comment there Windows 8 App, Blackberry Playbook App, Blackberry Mobile App, Windows Phone 8 App.

You can do any of them or all of them. The more you do more chances you will have towards winning the top giveaway gift. Only thing you may want to do is comment here once to be eligible for winning. It would be nice if you can include share urls too. :)

Winners will be announced in next two weeks. Sept 7th 2013. Stay Tuned and keep visiting WindowsVJ.com. Thank you once again for visiting us. :)

Image Source

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

WindowsVJ is now available on Windows Phone 8 platform too

Hi All,

Recently i submitted an app at Windows Phone 8 store for WindowsVJ blog. And i am happy to share the app has been approved in three days time.

WindowsVJ blog feed app for Windows Phone 8 grabs the RSS feed of WindowsVJ.com and displays the most recent 20 articles. This App also features Text to speech, share on social network, live tile refresh, deep pinning features. Deep pinning is one feature which WP8 users will love too use.

Here are some screenshots :

62ad1378-3db7-4e5e-aa1e-a941e1920cc9 a8de26e7-6edb-42e7-91a1-e63ab35787c1 023ae5cc-a604-43b1-a4bc-c56c7b238fd2

App is available for download at

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
http://www.windowsvj.com/outlet