Flash Player video colors are weird (Incl Youtube) – Fix

24 06 2012

My laptop runs on Ubuntu 12.04LTS and I see the youtube and other flash player videos in tinted blue colors. I’ve googled a bit a got a fix for that.

Put the video in full screen mode –> Right click –> Settings –> Click on the ‘Display Tab’ and disable the hardware acceleration. This should fix the issue.

I’ve tried lots of sudo code before i found this easy fix. This was pretty easy.





BMI: How to decide if the organization needs multiple commerce processes?

5 01 2012

While replicating an organizational sales process in the ERP-CRM environment, BMI is often preferred to have the quoting part of it and some level of price execution. The important decision revolves around having multiple commerce (quoting) processes or single for an organization. This decision definitely needs in-depth study of the company structure and considering the industry best practices to organize it. Leveraging this on technical feasibilities might lead to inefficiency.

Considering the BMI best practices, I was able to derive the basic parameters that are needed for evaluating this need.

The important parameters that need to be considered as Complexity of the Business Process, Localization Scope, User Experience and Administrative capabilities.

Business Process Complexity – If there are large differences between the Channel Sales and Internal Sales process & If there are large differences in the way the Pricing is handled within/per business process, then it makes sense to have multiple commerce processes within the organization.

Localization – A single commerce process can multi-currency or multiple languages. Pricing or related scripts in BML can easily handle multi-currency if designed efficiently. Hence for this case, a single commerce process is good enough.

User Experience – Since BMI is good at hiding and showing things based on conditions and not good at organizing elements within the quoting screen, if it a critical requirement to have dynamics on the quoting screen dynamically, it is recommended to have multiple processes, otherwise just one.

These are the basic elements which can help us evaluate the necessity of multiple commerce processes while designing the BMI architecture for an organization.





Retrieving the last value of a delimited string in XSL

14 07 2011

I had to print the last value of a dynamic tilde (~) delimited string in the HTML (email content). The style sheets are done in XSL. This is how i made it work:

I defined a template:

	<xsl:template name="returnLastValueofString">
		<xsl:param name="inputString"/>
		<xsl:choose>
			<xsl:when test="substring-after($inputString,'~')">
				<xsl:call-template name="returnLastValueofString">
					<xsl:with-param name="inputString" select="substring-after($inputString,'~')"/>
				</xsl:call-template>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="$inputString"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

This is how i called the value:

	<xsl:call-template name="returnLastValueofString">
		<xsl:with-param name="inputString" select="$OriginalStringAttribute"/>
	</xsl:call-template>




BML – Solving the array identifier error

2 04 2011

After doing a BMQL or getpartsdata() in BML, doing a for loop for validating something on the records often would cause some errors. For example,

tableResults = bmql("SELECT SelectColumn FROM DataTable WHERE WhereColumn1=$WhereAttribute and WhereColumn2=$Variable");
for result in tableResults {
if (ConditionAttribute == result[0]) {
resultVariable = result[0];
break;
}
else {
resultVariable = "StaticValue";
}
}.....

The above rule, eventhough it looks perfectly alright, BML engine throws errors like “result in line x is not a valid array identifier”. I’ve realized that we cannot directly associate the record value to a condition attribute in a for loop of table results. If it was getpartsdata(), then we could declare the ‘SelectColumn’ as a string field and solve this array identifier error. But in BMQL, we don’t have the flexibility of declaring a table column in the rule.

So, i figured out if we return the coluimn values to a variable by ‘get’ function, this would solve the issue.

GetVariable=get(result,"SelectColumn");

Hence the modified script would be

tableResults = bmql("SELECT SelectColumn FROM DataTable WHERE WhereColumn1=$WhereAttribute and WhereColumn2=$Variable");
for result in tableResults {
GetVariable=get(result,"SelectColumn");
if (ConditionAttribute == GetVariable) {
resultVariable = GetVariable;
break;
}
else {
resultVariable = "StaticValue";
}
}
.....





Setting Jawbone 2 to Pairing Mode

25 02 2011

I just received the Jawbone 2 bluetooth headset which i bought online. To start using this headset, i am supposed to pair this up with my mobile phone (or any other bluetooth device). Apparently, the device, when i start it for the first time, it should automatically attempt to pair to the accessible device. If it doesn’t then it has to be troubleshooted this way:

Indication that the device is attempting to pair : The indicator blinks in red and white continuously

Steps:

1. Turn on the device – Holding the ‘Talk’ button for few seconds will turn it on

2. While the headset is blinking red, press Noise Assassin button, Talk button, Talk button, Noise Assassin, Talk, Talk

3.  Step 2 is hard reset. Once this is done, the device restarts and immediately starts auto-pairing.





Generating Parts on-the-fly (buy side) – SOAP via BML

24 02 2011

The flexibility for business to develop SKUs or Custom codes (for parts) is needed in many of the supply-demand scenarios. Most of the enterprises come up with such requirement where the Business, to be precise, the Sales would want to call for a new part (a SKU or an Item Code) which they never made, to be developed for a specific customer. This is a possibility for them as the Business is clear of the specifications and technology the SKU/Item should be made of. Most of the supply-demand automation platforms like BigMachines do not come up with the infrastructure to do this. Thanks to the open ends of these platforms powered by SOAP etc, these interesting requirements can be solved.

In BMI’s perspective, I need to be able to create parts being on the configurator on the buy side. One possible solution for this is SOAP via BML.

BML understands a function called urldatabypost(). Basically the BML engine reads the file uploaded available at at URL and attempts to parse it. As long as the file is in a language which is understandable by BM, it works.

So the solution for this case is, i generate a dynamic SOAP request using the BM Webservices, add some keys to it (keys add dynamics to the request. In our case, we need the Part Number to be dynamic, so it could be a key) and add the SOAP XML as a file to the BM File Manager. Then i call this file using urldatabypost() and replace the keys with a BM function which generates a part number pattern.

Sample:
// Clearances
cdataStart = "<![CDATA[";cdataEnd = "]]>";
// Call the SOAP file saved in File Manager
mySOAPURL = "https://customersite.bigmachines.com/bmfsweb/devge/image/SOAP/addgenericpart.xml"; //File Location
myPartFile = urldatabypost(mySOAPURL,"",""); // This calls the file
// Replace keys a.k.a Holder Text with the dynamic data
// _BM_USER_SESSION_ID a system attribute in configuration (an equivalent is available in commerce)
myPartFile = replace(myPartFile,"SESSION_ID", cdataStart +_BM_USER_SESSION_ID + cdataEnd);
// transactionID is a user defined configurable attribute
myPartFile = replace(myPartFile,"GENERIC", cdataStart +partListStr[i]+ cdataEnd);
// partListStr was a string which captures the length of the parts array
soapURL = "https://customersite.bigmachines.com/v1_0/receiver"; // location to send the soap call (receiver url)
soapResponse= urldatabypost(soapURL, myPartFile ,""); // sends the soap call and returns response to variable.





Bringing ‘Commerce’ data to ‘Configuration’

7 01 2011

Retrieving Commerce attribute values to Configuration has been one of the BigMachines’ limitations that BigMachines has. Most of the implementations follow SFDC->Quote-> Configurator->Quote->SFDC flow. In such scenarios, it is very common to have a requirement which needs Quote data to be used in Configuration.

The clean and easiest solution for this is writing a JS Cookie. Write a cookie and paste it in the ‘Header&Footer’ section of the admin. The ‘Header&Footer’ is typically the placeholder to store all the JS related to Config/Commerce manipulations.

Sample Cookie snippet:

\\File Manager by default has an util_class.js which has many commonly used JS functions like get cookie, set cookie defined. So use it
<script type="text/javascript" src = 'https://testge.bigmachines.com/bmfsweb/testge/image/Scripts/util_class.js'>
</script>
<script type="text/javascript">
\\On the commerce page, find the commerce attribute and store its value in the browser
if (document.bmDocForm) {
var commerceAttr1 = document.getElementsByName("commerce_attribute");
if(commerceAttr1.length != 0){
var tempcommerce_attribute = commerceAttr1[0].value;
_util.setCookie("config_attribute",tempcommerce_attribute, 2);
}
}
var changed = false;
\\Now search for the config attribute and then apply the cookie value to it
if (document.configurationForm)
{
if (document.configurationForm.config_attribute)
{
var tempconfig_attribute = _util.getCookie("config_attribute");
if (document.configurationForm.config_attribute.value != tempconfig_attribute)
{
if (tempconfig_attribute != null && tempconfig_attribute != "")
{
document.configurationForm.config_attribute.value = tempconfig_attribute;
changed = true;
}
}
document.configurationForm.config_attribute.readOnly = true;
}
if (changed)
{
submitPage(document.configurationForm, true, true);
}
}

Now this helps to auto-populate the configuration attribute with a commerce attribute value. Whenever user populates value to this ‘commerce_attribute’ on the quote page and then opens the configuration (via add line items or reconfigure), this cookie value is stored and then applied to the configuration attribute after arriving there.

This answers a lot of scenarios.  Most of the requirements which need SFDC values to be populated in configuration, can make use of this effort. Also if the SFDC values are not directly the values that needs to be populated in configuration, but if they have a mapping index, all you have to do is get those values to config and then do a BML across the mappings table to populate the config data.





Renaming ‘Recommended Items’ header in BigMachines Configurator

28 12 2010

The BigMachines configurator limits you from renaming the ‘Recommended Items’ template. In most of the customer scenarios, it is mandated to have a custom name like ‘Selected Products’, ‘Configured Items’ etc. The systems’ page templates won’t let the administrator to change the label. Based on the recommended items rule type, this section gets either of the names – ‘Recommended Items’ or ‘Mandatory Items’.

The simplest and best way to answer this requirement is to over-ride the label using simple JavaScript. Here’s how we do it:

• Using firebug, find the HTML of the recommended items section header and the inner-table header ‘recommended parts’.

  “<td colspan="38">Recommended Items</td>”
  “<td width="70%" colspan="36">Recommended Parts</td>”

• Copy the above mentioned HTML tags

• Go to Admin -> Header & Footer and navigate to the ‘Footer’ section. Now, without meddling with the script in the footer content, add a new at the bottom of the script

• Inside the new script, write the JS Desired. The new JS should have a condition. The condition is that it should only be rendered for a specific product line or only during an attribute’s presence. This is just to make sure that this JS is not triggered always.

• Sample JS:

if(document.getElementsByName('conditionAttribute')[0].selectedIndex!=0)

{

if(document.getElementsByClassName('view-header')[6].innerHTML=='<td colspan="38">Recommended Items</td>')

{

document.getElementsByClassName('view-header')[6].innerHTML="<td class='top-bar' colspan='38'>Configured Items</td>";

}

if(document.getElementsByClassName('view-header')[7].innerHTML=='<td colspan="36" width="70%">Recommended Parts</td><td><table><tbody><tr><td colspan="2" width="50%">&nbsp;</td></tr></tbody></table></td>')

{

document.getElementsByClassName('view-header')[7].innerHTML='<td colspan="36" width="70%">Configured Parts</td><td><table><tbody><tr><td colspan="2" width="50%">&nbsp;</td></tr></tbody></table></td>';

}

}




Way to cut down maven dependency updation time – Eclipse Hack

26 04 2010

For all the developers working on Eclipse and having a central code repository (like SVN, CVS etc), one big problem faced from time-to-time is updating their maven dependencies. This eats up hours of time sometimes especially when dependency changes are made. Developers utilize their valuable time in smoke zone or pantry while their maven dependencies are being updated.

I eventually realized that there is a typical hack to cut down this time. Eclipse usually does update the maven repository in two ways. One during launch, which does from top-to-bottom and is instantaneous. And the other during progressive schedule, which is record-by-record and is a lot of time consuming.

So, the hack is whenever a developer is in middle of a progressive schedule, he can just save the workspace, quit eclipse and then go to task manager and kill the eclipse process and then relaunch the IDE. So when eclipse restarts, it automatically does the instantaneous top-to-bottom update without even asking the user to manually go for updation. This is one better way to avoid smoke and caffeine 🙂





Installing Testlink in the simplest way [on PHP vs MySQL]

19 03 2010

I tried installing Testlink 1.8 for my test management today. The installation guide is simple, but for windows users it doesn’t give much of troubleshooting steps which users face often. I figured out some solutions for the problems which windows users face while installing this application as web server.

This is the complete flow including the troubleshooting steps for most commonly faced issues:

1. Download Testlink from the site

http://sourceforge.net/projects/testlink/files/

2. Extract the source file using any free zip extractor

3. Now download any PHP Server; I’ve chosen the WAMP (http://www.wampserver.com/en/download.php), which is a very simple server administrator

4. WAMP uses port 80 by default, which is commonly used by many applications (including IMs like skype), so better change it to any other port (say 81)

Go to this file Drive:\wamp\bin\apache\Apache2.2.11\conf\httpd.conf and change the port number

5. Now that the WAMP installation is done, place the extracted Testlink folder to the ‘www’ directory of the WAMP folder. (WAMP folder can be found on the installed drive directly Drive:\wamp)

6. Now, start the WAMP server and type the URL http://localhost:81/testlink/install/index.php

7. While this page is being opened, open your MySQL client (I use MySQL yog free edition) and create a database with name ‘testlink’ on your localhost

8. Extract the data tables and data inside the tables (using SQL restore) on this database. Both these SQL files can be found inside the test link folder that you’ve extracted. The location is Drive:\wamp\www\testlink\install\sql\mysql

9. Back at step 7, the installation page would have been open on your browser, give the location credentials:
DB URL: localhost:3306
DB User id, Password, Optional User ID and Password

10. Done, you are ready and can access the testlink

Most of the users find the below error after configuring test link & opening the page

Deprecated: Function ereg_replace() is deprecated in C:\wamp\www\testlink\lib\functions\lang_api.php on line 173

This is because the ereg command is no more used in the PHP versions > 5.2. So the solution for this is either reverting back to PHP 5.2 or lower (or) do the following tweak:

Go to the Drive:\testlink\lib\functions\ and go to line number 173 in the file ‘lang_api.php’. Change this line:
$t_lang_var = ereg_replace( ‘^TLS_’, ”, $t_var );
to be this line:
$t_lang_var = preg_replace( ‘/^TLS_/’, ”, $t_var );