Skip to content

Instantly share code, notes, and snippets.

View codyherring's full-sized avatar

Cody Herring codyherring

  • Mercent
  • Seattle
View GitHub Profile
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.update_activity);
final Handler handler;
handler = new Handler();
final EditText getCustID = (EditText) findViewById(R.id.customer);
final EditText custvar1 = (EditText) findViewById(R.id.var1);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.update_activity);
final Handler handler;
handler = new Handler();
final EditText getCustID = (EditText) findViewById(R.id.customer);
final EditText custvar1 = (EditText) findViewById(R.id.var1);
@codyherring
codyherring / gist:5193077
Created March 19, 2013 01:57
INPUT FILE
<Product>
<mpn>_Shoes_Clothing</mpn>
<manufacturer>Manufacturer1</manufacturer>
<site_name>name</site_name>
<product_name>_Shoes_Clothing</product_name>
<product_description>_Shoes_Clothing_Shoes_Clothing</product_description>
<currency>US_DOLLAR</currency>
<original_retail_price>10.0000</original_retail_price>
<price>123.00</price>
<stock>N</stock>
@codyherring
codyherring / XSLT HELL
Created September 16, 2013 21:18
XSLT HELL
Data:
a > b > c > d > e
XSD:
<xs:element name="department">
<xs:annotation>
<xs:documentation>Merchant defined department hierarchy.</xs:documentation>
</xs:annotation>
<xs:complexType>
// Data Rows Below Header Row
switch(dr["TransactionType"].ToString())
{
case "OutgoingFeed":
if(!(bool)ColumnIsNull["FeedFileLocation"])
sb.AppendFormat(DATAFormat, "Feed:",
BuildDownloadLink(dr["TransactionCorrelationID"].ToString(), "incomingOutgoing",
dr["FeedFileLocation"].ToString(), "FeedFile"));
if(!(bool) ColumnIsNull["MarketplaceURL"])
sb.Append(GetDeliveryURL(DATAFormat, dr));
<xsl:if test="../VariationData/Parentage or AgeGenderCategory or Amperage or BikeRimSize or BootSize or Bounce or CalfSize or Caliber or Capacity or Club or ancestor::Product/Color or Curvature or Design or Diameter or DivingHoodThickness or FencingPommelType or Flavor or GolfFlex or GolfLoft or GripSize or GripType or Hand or HeadSize or ancestor::Product/DescriptionData/ItemDimensions/Height or Irons or ItemThickness or ancestor::Product/DescriptionData/ItemDimensions/Length or LensColor or LieAngle or LineCapacity or LineWeight or ancestor::Product/Attributes/Attribute[@name='Material'] or Model or Quantity or Rounds or ShaftLength or ShaftMaterial or ShaftType or Shape or ancestor::Product/Size or Style or TemperatureRating or TensionLevel or Volume or Wattage or ancestor::Product/DescriptionData/ItemDimensions/Weight or WeightSupported or WheelSize or ancestor::Product/DescriptionData/ItemDimensions/Width or Wood">
private MarketplaceCategory ParseMarketplaceCategory(XElement categoryXml)
{
string industryName = (string)categoryXml.Element("IndustryName");
string industryCode = (string)categoryXml.Element("IndustryCode");
string subcategoryName = (string)categoryXml.Element("SubcategoryName");
string[] splitSubcategoryName = NeweggUtility.SplitCategoryName(subcategoryName);
string marketplaceCategoryName = string.Empty;
//if the length is greater than 1, the IndustryCode might be in the SubcategoryName
//look at the first element to see if it's in the dictionary