Dec 31 2009

Media Centre Pictures

Category: .media centerAmit Bahree @ 11:58 pm

Sorry this took so long (been extremely busy lately), but as promised here are pictures of the media centre during the various stages of being built. Clicking on the thumbnails below, will show you a larger version of the photos.

Also given my previous experience with the MCE, the wife is always very sceptical whenever I say anything about ‘fixing’ the MCE. Moral of the story (as I learned the hard way) the MCE is a ‘production’ class machine which does not get touched without adequate planning with fall back options planned.

Of course since I build this in the summer of 2009, I don’t suppose this is “new” anymore. :oops:

Tags:


Dec 24 2009

Upgraded to WordPress 2.9

Category: .miscAmit Bahree @ 3:27 pm

I just upgraded to WordPress 2.9 and wow what a pleasant experience compared to Community Server 2007! Excluding backing up the DB and the site, the actual upgrade took only a few seconds and was so painless! Such a different experience from Community Server 2007, which was so much more difficult. Loving WordPress and all the add-ins and the goodness of the communities! :mrgreen:

Tags:


Dec 24 2009

Eclipse CDT Blues

Category: .opensourceAmit Bahree @ 2:24 pm

Sigh, why is Eclipse CDT to flaky? Well, there might be a slight exaggeration in that but nevertheless, I did not have so many issues with Visual Studio / VC++. :roll:

I have uploaded this particular log file here if anyone is interested.

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0xb263d1f7, pid=20331, tid=3085625024
#
# JRE version: 6.0_16-b01
# Java VM: Java HotSpot(TM) Client VM (14.2-b01 mixed mode, sharing linux-x86 )
# Problematic frame:
# C  [libQtGuiCppIntegration.so.4+0x6531f7]  _ZN16QtCppIntegration12QLineControl18removeSelectedTextEv+0×27
#
# An error report file with more information is saved as:
# /home/amit/hs_err_pid20331.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0xb263d1f7, pid=20331, tid=3085625024
#
# JRE version: 6.0_16-b01
# Java VM: Java HotSpot(TM) Client VM (14.2-b01 mixed mode, sharing linux-x86 )
# Problematic frame:
# C  [libQtGuiCppIntegration.so.4+0x6531f7]  _ZN16QtCppIntegration12QLineControl18removeSelectedTextEv+0x27
#
# An error report file with more information is saved as:
# /home/amit/hs_err_pid20331.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

Tags:


Dec 22 2009

Pan-Fried Asparagus

Category: .foodAmit Bahree @ 5:49 pm

Yes I am a foodie (quite surprising, a lot of people find that surprising). 8-)

Anyways, this is what I intend to cook tonight among other things. I cannot claim credit for this, I found it online some time back and now its stored on my Wiki at home and I don’t know who to give credit for it anymore.

Ingredients:

  • 1/4 cup butter
  • 2 tablespoons olive oil
  • 1 teaspoon coarse salt
  • 1/4 teaspoon ground black pepper
  • 3 cloves garlic, minced
  • 1 pound fresh asparagus spears, trimmed

Method:

  1. Melt butter in a skillet over medium-high heat.
  2. Stir in the olive oil, salt, and pepper.
  3. Cook garlic in butter for a minute, but do not brown.
  4. Add asparagus, and cook for 10 minutes, turning asparagus to ensure even cooking.

Tags:


Dec 22 2009

Making sense of primary-expression error

Category: .codeAmit Bahree @ 11:38 am

If you are new to C++ then some of the compiler errors can be a bit confusing and daunting at first. For example if the compiler given you an expected primary-expression error (e.g. expected primary-expression before ‘.’ token), at face value it does not make sense.

void RGBViewer::accept() {
	QMessageBox::information(this, "Button Clicked", "You clicked OK", QMessageBox::Ok);

	QColor color = QColor(Ui_RGBViewerClass.spinBoxRed->value(),
			Ui_RGBViewerClass.spinBoxGreen->value(),
			Ui_RGBViewerClass.spinBoxBlue->value(),
			255);

	qDebug() << color;

	QBrush brush(color);
	brush.setStyle(Qt::SolidPattern);
	ui.graphicsView->setBackgroundBrush(brush);
	ui.graphicsView->backgroundBrush();
}

When I compile the above code snippet, I get the following error from the compiler:

rgbviewer.cpp: In member function ‘virtual void RGBViewer::accept()’:
rgbviewer.cpp:19: error: expected primary-expression before ‘(’ token
rgbviewer.cpp:19: error: expected primary-expression before ‘.’ token
rgbviewer.cpp:20: error: expected primary-expression before ‘.’ token
rgbviewer.cpp:21: error: expected primary-expression before ‘.’ token

All this means is that I need to initialize the type ‘Ui_RGBViewerClass’ as the compiler does not understand it. In other words, I need to use a new.

Here is the ‘fixed’ version below of the same code snippet.

Ui::RGBViewerClass ui; //Defined in the header; shown here for completness

void RGBViewer::accept() {
	QMessageBox::information(this, "Button Clicked", "You clicked OK", QMessageBox::Ok);

	QColor color = QColor(ui.spinBoxRed->value(),
			ui.spinBoxGreen->value(),
			ui.spinBoxBlue->value(),
			255);

	qDebug() << color;

	QBrush brush(color);
	brush.setStyle(Qt::SolidPattern);
	ui.graphicsView->setBackgroundBrush(brush);
	ui.graphicsView->backgroundBrush();
}

Tags:


Dec 19 2009

Allowing remote desktop with blank passwords on Win7

Category: .geek,.media centerAmit Bahree @ 12:47 pm

I finally got the time to upgrade my MCE with the RTM bits of Win7 (was running an old RC build until now). Given this is a dedicated MCE with nothing else on it and an on an isolated part of the network, I don’t have a password set for the Account I use to login (of course not a recommended practice). Now, I wanted to RDP to the machine and I realised then that Win 7 does not allow RDP with blank passwords by default (Vista behaves in the same fashion). The workaround is a simple fix – to update the group policy as Dan shows in this post. Even though that post is for Vista, its the same steps for Win 7.

Tags: ,


Dec 17 2009

Thought of the day

Category: .live and learnAmit Bahree @ 1:10 pm

Premature optimization is the root of all evil; on the other hand we cannot ignore efficiency.
     – Knuth and Bentley

Tags:


Dec 13 2009

Opening File explorer from a terminal

Category: .opensourceAmit Bahree @ 5:10 pm

In Ubuntu if you want to open File Explorer from a terminal (especially as root) then you need to enter the following command: sudo nautilus

If you want this to run as a background process then just add an “&” in the end (without the quotes of course).

Tags:


Dec 11 2009

Extending WCF Adapters in BizTalk

Category: .microsoftAmit Bahree @ 6:40 pm

I know a little bit about WCF :) but never really used it in anger in BizTalk and also did not get an opportunity to extend the adapter.

I was looking for something else and came across this post form Paolo which explains in a lot of detail how does one go about extending and customizing WCF adapters. If you don’t know anything about WCF the first part explains that in general before going in to the BizTalk specific things.

Tags:


Dec 08 2009

10 must have WordPress plugins

Category: .miscAmit Bahree @ 5:42 pm

If you search online you will loads of ‘best plugin lists’ for WordPress, however of the lot that I have seen I truly think that this one is certainly one of the best ones.

Tags:


Dec 06 2009

BizTalk Flat File schema optional attribute issue

Category: .geek,.microsoftAmit Bahree @ 11:37 pm

I encountered this interesting issue and thanks to Colin we were able to resolve it. There will be situations you will encounter when adding additional optional attributes to a Flat File (FF) schema in BizTalk will cause problems. To get around this you basically will need to set the following properties to relax the parsing of the attributes which break.

  • parser_optimization="complexity"
  • allow_early_termination="true"
  • early_terminate_optional_fields="true"

This got me thinking more and wanting to understand what does changing these attributes mean under the covers. Below is what I found out on each of these.

On parser_optimization:

  • Setting the parser_optimization to complex essentially generates a more complicated grammar (it uses both a top down and bottom up parsing); this grammar is then used to parse the FF.
  • The complicated grammar is better when parsing records with more optional nested options – however it still cannot handle all the layout conditions and can still break in some situations.
  • And given the runtime is doing more things, this will be slower than the other option called ‘speed’ (yeah no kidding Sherlock!).
    • The reason the ‘speed’ option is faster is because it uses top-down parsing only.
  • In addition you should also set lookahead_depth to zero (more on this below) to avoid validation failures (against a schema) when there are many optional nodes in the same group/record.

Changing the lookahead_depth itself is trivial but you need to be a little more aware of what this means:

  • This essentially tells the parser when making a parsing prediction how far ahead to look in the token stream.
  • Setting this to Zero essentially means ‘infinite lookahead’ which in turn means more memory will be consumed.
    • Depending on how busy your BizTalk servers are and how much memory pressure you already experience processing various files (and their sizes), this might be an issue.

Basically, the FF parser is a streaming parser and implemented as a leftmost derivation which takes in a CFG. Essentially when we change the lookahead_depth to zero we change do not restrict this and the parser can recognize tokens using DFA perhaps (of course we don’t know the real implementation).

For those old school like me, and have played with yacc – that is a LL(1) parser – essentially parse the grammar with one token lookahead.

On allow_early_termination="true":

  • When working with FF’s BizTalk expects that every line is of the same length (either because of the data contained padded with spaces). However if it finds a newline (CR + LF) character then it breaks and you get an error something along the lines of “Unexpected data found while looking for: \r\n”.
  • Adding the allow_early_termination setting helps fix this. Read more here.
  • Also note that only the right-most positional field is allowed to early terminate.

Lastly, the early_terminate_optional_fields attribute enables early termination of optional trailing fields. A couple of points to note on this:

  • If your schema does not have this annotation and you open that in the BizTalk editor, then it will automatically add this annotation explicitly and set it to the default value of False.
  • This only takes affect if you also have the allow_early_termination annotation set to True.
  • More details on this here.

And in case you were wondering this is a supported option by Microsoft as shown in this KB article.

Tags: ,


Dec 06 2009

Default QT4 path

Category: .opensourceAmit Bahree @ 10:53 pm

If you wanted to know the default path where QT4 is installed (on Ubuntu) then look in /usr/share/qt4/bin.

Tags:


Next Page »
Get Adobe Flash playerPlugin by wpburn.com wordpress themes