Archive for January, 2011

[ Shopify ] : Walk the themes

Posted in Eclipse, IDE, Technical, work with tags , , , , , , on January 3, 2011 by saffrongeek

#1. Login to the shopify admin site, http://shop.myshopify.com/admin

#2. To the right top corner you can find the Themes drop down. Themes settings , Template editor are the handy controls for working with shopify themes.

#3. THEME SETTINGS

Basically, this is generated from the settings.html in the config folder of themes. If you peak in to the settings.html in the config folder , what you would find is a set of fieldsets with form elements. For eg:-

Homepage
Disabled Enabled

<fieldset>
<legend>Homepage</legend>
<table>
<tr>
<th><label for=”header”>Header Image</label></th>
<td>
<select name=”header” id=”header”>
<option value=”disabled” selected=”selected”>Disabled</option>
<option value=”enabled”>Enabled</option>
</select>
</td>
</tr>
<tr>
<th><label for=”header_file”> Header Image</label></th>
<td><input type=”file” name=”header.gif” id=”header_file” data-max-width=”292″ data-max-height=”75″ /></td>
</tr>
<tr>
<th><label for=”header_file”>Hero Image</label></th>
<td><input type=”file” name=”header_hero.jpg” id=”header_file” data-max-width=”1000″ data-max-height=”355″ /></td>
</tr>
</table>
</fieldset>

#4. TEMPLATE EDITOR

a.Templates can be exported and imported. The theme has a default structure with few folders. Note that assets folder contains all the theme specific javascripts, images, styles. Import is done with a zipped format of the structure.Layout is the main container file.

Import and Export feature

b.Template section shows the standard functional blocks of shopify from the theme – navigational element perspective.

Templates and Snippets

Snippets is a very handy useful concept to get a extended functional block developed.

c. Theme related assets can be added or managed from here as shown in below. CSS files overridden or new images or styles added , or new liquid files are added from here and the editor gives support to work onsite itself easily.You can see the asset upload section at the bottom of the asset section.

Also notice the preset settings file which is none other than the theme settings file.

Assets and Preset section

Assets and Preset section

Must know the following stuffs while you work with theme or liquid files.

1. Understanding the of theme structure.

2. Liquid Templating Engine

3. Use of snippets, settings.html and layout.

To know more: Read: Know Basics of theme Tool to assist shopify theme development , Theme Store

 

Advertisements

[ Shopify ] : a quick walkthrough

Posted in Eclipse, IDE, Technical, work with tags , , , , , , , , on January 3, 2011 by saffrongeek

Shopify is a web-based e-commerce platform.This web application allows businesses to create an online store. It was built using the Ruby on Rails open source web application framework.

Templates

Blogs & Pages

Products

Customers

Collections

Configurations

cart

checkout

notification templates

 

 

LOGARITHMIC Effectiveness AND Scaling : Interesting uses : 1

Posted in Algorithm Approach, civiCRM, Dolphin, Drupal, Joomla, PHP, Technical, Wordpress, work with tags , , , , , , on January 1, 2011 by saffrongeek

LOGARITHMIC Effectiveness AND Scaling : Interesting uses : 1

Remembering Logarithm’s few applications in couple of algorithm writing.

A logarithmic timeline is a timeline applied out according to a logarithmic scale.Let us think about a popularity factor calculation of an user.
In our logic, we define the Aging as the number of days from the event of interest.we use a log7 scale.

Log7 scale gives advantage as it provides three key segments for application consideration.They are :-

In about a week (7X1 = 7 days),
In about 6 – 8 weeks (7X7 = 49 days),
those towards later half of year (7X7X7 = 343 days).

 

Now, to add advantage for recent activity, invert the scale by using  (log7 365 – log7 DAYS)

Ranking algorithm=>Cleansing time dependency=>Efficient approach

Posted in Algorithm Approach, Apache, civiCRM, coldfusion, Dolphin, Drupal, Eclipse, Flex, IDE, Joomla, Linux, mysql, NoSQL, PHP, Technical, Wordpress, work with tags , , , , , on January 1, 2011 by saffrongeek

Application idea suggested in thebroth.com and linkibol algorithm detailing.

To know more on Bayesian Averaging : Bayesian

The bayesian rating can be given as:

br = ( (C* avg_rating) + (this_num_votes * this_rating) ) / (C + this_num_votes)

Where

* C: is an ad-hoc constant. If it’s high. It will require more votes for the adjusted (dampened) rating of an item to approach its original unadjusted value.
* avg_rating: The average rating of each item (again, of those that have num_votes>0)
* this_num_votes: number of votes for this item
* this_rating: the rating of this item

br = ( (avg_num_votes * avg_rating) + (this_num_votes * this_rating) ) / (avg_num_votes + this_num_votes)

Showing filesize human readable way

Posted in civiCRM, Dolphin, Drupal, Eclipse, IDE, Joomla, Linux, mysql, NoSQL, PHP, Technical, Wordpress, work with tags , , , , on January 1, 2011 by saffrongeek

function getsize($filesizebytes)
{
if($filesizebytes < 1024)
{
return $filesizebytes.”Bytes”;
}
if($filesizebytes > 1024)
{
$filekb=$filesizebytes/1024;
if($filekb < 1024)
{
$flieinkb = round($filekb,2);
return $flieinkb.”KB”;
}
if($filekb > 1024)
{
$filemb = $filekb/1024;
$fileinmb = round($filemb,2);
return $fileinmb.”MB”;
}
}
}

Algorithmic Approach to generating Unique traceable paths for uploads-2

Posted in Apache, civiCRM, Dolphin, Drupal, Flex, IDE, Joomla, Linux, mysql, NoSQL, PHP, Technical, Versioning, Wordpress, work with tags , , , , , on January 1, 2011 by saffrongeek

To reach the unique file repository its easy right.Let us see how.

Function hashSlice just needs to be returning a substr from hash to branch out unique.Say, like below:-

return substr($hashValue,0,$num);

// pass a class attribute that is assigned/configured to a fixed length.

Logic to generate a fixed member and unique branch for attachment or upload object path for a traceable event:

function inputs are $handle, $type.
$handle = ( $username || $metafilename )
$type = ( user | usrobj )

1. Generate the hashed value with the below strategy.

$hash = 0;
for($i=0; $i < strlen($handle) ; $i++)
{
$value = substr($handle, $i, 1);
$hash = $hash*17 + ord($value);
$hash %= 9000;
}

2. Now prepare the fixed user homepath using

$home .=(1+($hash % 9));
OR
$home .=SERVER_PATH.(1+($hash % 9));

(// this is for usrobj type.)based on $type.

3. Apply bitwise shift to 3 places and get modulo of hash.

$hash >>=3;
$hash %=1000;

4. Prepare the homepath of the user as

$home .= “/$hash/$handle”;
OR
$home .= “/$hash/”;

%d bloggers like this: