Monday, 30 September 2013

Discuss the convergence of the sequence: $a=?iso-8859-1?Q?=5F1=3D1=2Ca=5F{n+1}=3D\sqrt{2+a=5Fn}_\quad_\forall_n_\in_?=\mathbb{N}$ – math.stackexchange.com

Discuss the convergence of the sequence: $a_1=1,a_{n+1}=\sqrt{2+a_n} \quad
\forall n \in \mathbb{N}$ – math.stackexchange.com

Computing the first few terms $$a_1=1,
a_2=\sqrt{3}=1.732....,a_3=1.9318....,a_4=1.9828...$$ I feel that
$(a_n)_{n\in \mathbb{N}}$ is bounded above by 2, although I have no
logical reasoning for this. …

What is the best method for creating and deploying mandatory profiles within an Active Directory using Windows 7 clients?

What is the best method for creating and deploying mandatory profiles
within an Active Directory using Windows 7 clients?

What is the best method for creating and deploying mandatory profiles
within an Active Directory using Windows 7 clients?
I have a number of Windows XP computers that are used as shared
workstations for students, some are in a library and others in a computer
lab. I am using Redirected Folders to enable users to have access to their
personal documents regardless of what PC they happen to log into.
The problem I have is Win7 no longer allows a local profile to be copied
to the network for use with mandatory profiles.
I've done some research on Google, but most of what I find are hacks to
re-enable the "Copy To" button or instructions involving sysprep.
I've also considered trying to use GPOs to recreate the effect of a
pre-configured profile, however I haven't found a way to modify the
start-menu.
I'm looking for an awesome answer that explains the best way to setup
mandatory profiles when using Windows 7 clients or another way to
re-create the effect.

How to make expandable sliding menu?

How to make expandable sliding menu?

Good day=) How to make a expandable sliding menu looks like
http://yadi.sk/d/xsLWlWSrA7qj2 ?

How to create user customized report in mvc 4

How to create user customized report in mvc 4

I have to create a custom invoice receipt . Means a user can create his
own custom receipt according to his need. What is the best way to
implement it in MVC 4?

Sunday, 29 September 2013

VB.NET (VS2012) Treeview owner draw example from MS - odd behaviour

VB.NET (VS2012) Treeview owner draw example from MS - odd behaviour

I have a need to provide the count of items within a treeview folder after
the folder name, like Outlook does. ie: Inbox (134)
I found an example of the code I was looking for in the following
Microsoft Developer Network article.
http://msdn.microsoft.com/en-us/library/system.windows.forms.treeview.drawnode.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-2
There is at least one issue with this code, and a second I have
encountered from the parts of the code I have extracted for my own use.
The first issue with the code itself is when you do not load the treeview
with all nodes expanded (comment out ExpandAll line). When you expand the
node (Task 3 in the example) that contains a subnode with the additional
ownerdraw field to appear after the node, that text also appears after the
root node (Task 1 in the example). But this only happens the first time.
If you now click Task 1, the additional data disappears from next to it
and you cannot reproduce this behaviour unless you restart the code.
Secondly, and this is not possible to show with the example as it is the
only control on the form, is when the treeview control loses focus.
When the treeview control loses focus, the ownerdrawn part of the node
becomes bold. There is no reference to bold anywhere in the code. When you
reselect the same node in the treeview the text stays bold, but if you
then select another node, the bold disappears.
This behaviour doesnt occur while the treeview remains in focus, you can
select whatever nodes you like and the ownerdrawn section behaves as it
should (not change to bold).
It looks to me that the code is incomplete somehow but I dont know enough
about ownerdraw coding at this stage to work out what is required.
Any help would be greatly appreciated.
Regards
Greg J

How to get session id with SocketIO?

How to get session id with SocketIO?

I have a chat and i need to manage unique connections, I searched on the
internet but the solutions that I found seemed depreciated.
So how to get session id with SocketIO?
Im using node, express and socket.io.
Thanks.

Gnuplot: plotting the maximum of two files

Gnuplot: plotting the maximum of two files

let's assume I have two files formatted like this: x y 0 2 1 2.4 2 3.6
which differ for the values of y. is there a way to plot a single graph
that is, for every x, the maximum value of y between the two files?
Dunno if explained my self sufficiently well.
I was trying with conditional sentences but I couldn't find any expression
that let me search in 2 different files

how can i download and store data in an android app?

how can i download and store data in an android app?

i'm new to android! and i want to write a flash card app that has the
ability of shopping. so far i'v faced these problems:
how can i download a file from a service or an url?
how should i transfer my data that includes audio,images and text(buying
flashcards)? i mean what format of data should i use? for example can i
zip my data on the server and extract it inside my app and use the data or
is it a better way?
is there a specific method of client/server authentication (log in)?!so
stupid question...
the last but not least : maybe it would be better to change the question
to how can i write this program?!!!what are the things that i need to
learn?!!
i know my questions are general but as i said i'm newbe so help me find a
good view of what i am doing:D
feel so dumb for asking this question

Saturday, 28 September 2013

problems inheriting from a c++ template class

problems inheriting from a c++ template class

So I'm trying to work out how inheritance works when templates are in the
mix. Most compilers really don't seem to have this figured out yet, so I'm
having a little syntax difficulty. All the weird includes in SkipNode.h
are from trying to get eclipse to stop yelling at me. I'm getting a syntax
error when trying to declare the constructor in SkipNode.h, so any help
here would be useful.
Here is node.h
#ifndef NODE_H_
#define NODE_H_
template<class T>
class Node
{
public:
Node(Node<T>* next, Node<T>* prev, T item);
virtual ~Node();
Node* getPrev() { return prev;};
Node* getNext() { return next;};
Node* getItem() { return item;};
void setItem(T item){Node<T>::item = item;};
void setNext(Node* next){Node<T>::next = next;};
void setPrev(Node* prev){Node<T>::prev = prev;};
private:
Node* next;
Node* prev;
T item;
};
Here is SkipNode.h, where skipnode inherits from Node.
#include "Node.h"
#include "Node.cpp"
#include "SkipNode.h"
#include "SkipNode.cpp"
template <class T>
class SkipNode: public Node
{
public:
SkipNode(Node<T>* next, Node<T>* prev, Node<T>* child, T item) :
Node(next, prev, item);
virtual ~SkipNode();
Node* getChild(){return child;};
void setChild(Node* child){SkipNode::child = child;};
private:
Node *child;
};

App crashes when converting Array to Data

App crashes when converting Array to Data

When I convert NSArray to NSData with this code:
NSData *data = [NSData dataWithData:folderOpened.arrayOfItems];
NSMutableArray *newObjects = [[NSMutableArray
alloc]initWithArray:[NSKeyedUnarchiver unarchiveObjectWithData:data]];
if (!newObjects) {
newObjects = [[NSMutableArray alloc]init];
}
[newObjects addObject:subfolders];
NSArray *speacilArray = [[NSArray alloc]initWithArray:newObjects];
NSData *finalData = [NSKeyedArchiver
archivedDataWithRootObject:speacilArray];
the app crashes with this message:
-[NSKeyedUnarchiver initForReadingWithData:]: data is empty; did you
forget to send -finishEncoding to the NSKeyedArchiver?
Anyone know why?

Symfony 2 - Generating a Bundle (Windows)

Symfony 2 - Generating a Bundle (Windows)

I am new to Symfony. I am running Windows and am using xammp to learn
Symfony 2. How would I run the following command? I seem to be getting an
error and not sure how to run commands like these successfully. I
appreciate any suggestions. Must I use CMD to create a bundle for
Symfony2? Is there an easier way to generate a bundle?
$ php app/console generate:bundle --namespace=Blogger/BlogBundle --format=yml

Parse error: syntax error, unexpected T_PRIVATE

Parse error: syntax error, unexpected T_PRIVATE

I'm getting the above error on my site, here is the code and it says line
104 which relates to private function SetPreorderData() - ie the first
line of my code. If anyone can shed any light on this i'd appreciate it!
private function SetPreorderData()
{
$GLOBALS['SNIPPETS']['ProductExpectedReleaseDate'] = '';
if (!$this->productClass->IsPreOrder()) {
return;
}
if ($this->productClass->GetReleaseDate()) {
$GLOBALS['ReleaseDate'] =
isc_html_escape($this->productClass->GetPreOrderMessage());
if (!$GLOBALS['ReleaseDate']) {
return;
}
} else {
$GLOBALS['ReleaseDate'] = GetLang('PreOrderProduct');
}
$GLOBALS['SNIPPETS']['ProductExpectedReleaseDate'] =
$GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('ProductExpectedReleaseDate');
}
/**
* Set the display options for min/max qty
*/
private function SetMinMaxQty()
{
$js = '';
if ($this->productClass->GetMinQty()) {
$GLOBALS['HideMinQty'] = '';
$GLOBALS['MinQty'] = $this->productClass->GetMinQty();
$js .= 'productMinQty=' . $this->productClass->GetMinQty() . ';';
$js .= 'lang.ProductMinQtyError = ' .
isc_json_encode(GetLang('ProductMinQtyError', array(
'product' => $this->productClass->GetProductName(),
'qty' => $this->productClass->GetMinQty(),
))) . ';';
} else {
$GLOBALS['HideMinQty'] = 'display:none;';
$GLOBALS['MinQty'] = '';
$js .= 'productMinQty=0;';
}
if ($this->productClass->GetMaxQty() !== INF) {
$GLOBALS['HideMaxQty'] = '';
$GLOBALS['MaxQty'] = $this->productClass->GetMaxQty();
$js .= 'productMaxQty=' . $this->productClass->GetMaxQty() . ';';
$js .= 'lang.ProductMaxQtyError = ' .
isc_json_encode(GetLang('ProductMaxQtyError', array(
'product' => $this->productClass->GetProductName(),
'qty' => $this->productClass->GetMaxQty(),
))) . ';';
} else {
$GLOBALS['HideMaxQty'] = 'display:none;';
$GLOBALS['MaxQty'] = '';
$js .= 'productMaxQty=Number.POSITIVE_INFINITY;';
}
$GLOBALS['ProductMinMaxQtyJavascript'] = $js;
}
Here is the entire code of the file:
CLASS ISC_PRODUCTDETAILS_PANEL extends PANEL
{
/**
* @var ISC_PRODUCT Instance of the product class that this panel is
loading details for.
*/
private $productClass = null;
/**
* @var MySQLDb Instance of the database class.
*/
private $db = null;
private $hasRequiredFileFields = false;
/**
* Set the display settings for this panel.
*/
public function SetPanelSettings()
{
$this->productClass = GetClass('ISC_PRODUCT');
$this->db = $GLOBALS['ISC_CLASS_DB'];
if(!empty($_SESSION['ProductErrorMessage'])) {
FlashMessage($_SESSION['ProductErrorMessage'], 'error');
}
$GLOBALS['ProductDetailFlashMessages'] = GetFlashMessageBoxes();
$GLOBALS['ProductName'] =
isc_html_escape($this->productClass->GetProductName());
$GLOBALS['ProductId'] = $this->productClass->GetProductId();
$GLOBALS['ProductPrice'] = '';
if(isset($_SESSION['ProductErrorMessage']) &&
$_SESSION['ProductErrorMessage']!='') {
$GLOBALS['HideProductErrorMessage']='';
$GLOBALS['ProductErrorMessage']=$_SESSION['ProductErrorMessage'];
unset($_SESSION['ProductErrorMessage']);
}
$GLOBALS['ProductCartQuantity'] = '';
if(isset($GLOBALS['CartQuantity'.$this->productClass->GetProductId()]))
{
$GLOBALS['ProductCartQuantity'] =
(int)$GLOBALS['CartQuantity'.$this->productClass->GetProductId()];
}
$product = $this->productClass->getProduct();
if($product['prodvariationid'] > 0 || $product['prodconfigfields']
|| $product['prodeventdaterequired']) {
$GLOBALS['ISC_CLASS_TEMPLATE']->assign('ConfigurableProductClass',
'ConfigurableProduct');
}
else {
$GLOBALS['ISC_CLASS_TEMPLATE']->assign('ConfigurableProductClass',
'NonConfigurableProduct');
}
// We've got a lot to do on this page, so to make it easier to
follow,
// everything is broken down in to smaller functions.
$this->SetVendorDetails();
$this->SetWrappingDetails();
$this->SetProductImages();
$this->SetShippingCost();
$this->SetPricingDetails();
$this->SetProductDimensions();
$this->SetProductReviews();
$this->SetBulkDiscounts();
$this->SetBrandDetails();
$this->SetInventoryDetails();
$this->SetMiscAttributes();
$this->SetPurchasingOptions();
$this->SetProductVariations();
$this->SetPreorderData();
$this->SetMinMaxQty();
###### LOGIN FOR PRICE HACK BOF#############
$customerClass = GetClass('ISC_CUSTOMER');
if(!$customerClass->GetCustomerId()) {
return;
}
$groupId = 0;
$customerClass = GetClass('ISC_CUSTOMER');
$customer = $customerClass->GetCustomerInfo();
if(isset($customer['custgroupid'])) {
$groupId = $customer['custgroupid'];
}
if($customer['custgroupid'] == 0) {
return;
// Mobile devices don't support file uploads, so if this is a
mobile device then don't show
// any configuration for the product and show a message that the
product must be purchased
// on the full site.
if($this->hasRequiredFileFields &&
$GLOBALS['ISC_CLASS_TEMPLATE']->getIsMobileDevice()) {
$GLOBALS['SNIPPETS']['ProductFieldsList'] = '';
$GLOBALS['SNIPPETS']['VariationList'] = '';
$GLOBALS['SNIPPETS']['EventDate'] = '';
$GLOBALS['ConfigurableProductClass'] = 'NonConfigurableProduct';
$GLOBALS['DisplayAdd'] = 'none';
$GLOBALS['SNIPPETS']['SideAddItemSoldOut'] =
$GLOBALS['ISC_CLASS_TEMPLATE']->getSnippet('ProductNotOrderableOnMobiles');
}
$GLOBALS['SNIPPETS']['ProductAddToCart'] =
$GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ProductAddToCart");
}
/**
* Set display options for a preorder product
*
*/
private function SetPreorderData()
{
$GLOBALS['SNIPPETS']['ProductExpectedReleaseDate'] = '';
if (!$this->productClass->IsPreOrder()) {
return;
}
if ($this->productClass->GetReleaseDate()) {
$GLOBALS['ReleaseDate'] =
isc_html_escape($this->productClass->GetPreOrderMessage());
if (!$GLOBALS['ReleaseDate']) {
return;
}
} else {
$GLOBALS['ReleaseDate'] = GetLang('PreOrderProduct');
}
$GLOBALS['SNIPPETS']['ProductExpectedReleaseDate'] =
$GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('ProductExpectedReleaseDate');
}
/**
* Set the display options for min/max qty
*/
private function SetMinMaxQty()
{
$js = '';
if ($this->productClass->GetMinQty()) {
$GLOBALS['HideMinQty'] = '';
$GLOBALS['MinQty'] = $this->productClass->GetMinQty();
$js .= 'productMinQty=' . $this->productClass->GetMinQty() . ';';
$js .= 'lang.ProductMinQtyError = ' .
isc_json_encode(GetLang('ProductMinQtyError', array(
'product' => $this->productClass->GetProductName(),
'qty' => $this->productClass->GetMinQty(),
))) . ';';
} else {
$GLOBALS['HideMinQty'] = 'display:none;';
$GLOBALS['MinQty'] = '';
$js .= 'productMinQty=0;';
}
if ($this->productClass->GetMaxQty() !== INF) {
$GLOBALS['HideMaxQty'] = '';
$GLOBALS['MaxQty'] = $this->productClass->GetMaxQty();
$js .= 'productMaxQty=' . $this->productClass->GetMaxQty() . ';';
$js .= 'lang.ProductMaxQtyError = ' .
isc_json_encode(GetLang('ProductMaxQtyError', array(
'product' => $this->productClass->GetProductName(),
'qty' => $this->productClass->GetMaxQty(),
))) . ';';
} else {
$GLOBALS['HideMaxQty'] = 'display:none;';
$GLOBALS['MaxQty'] = '';
$js .= 'productMaxQty=Number.POSITIVE_INFINITY;';
}
$GLOBALS['ProductMinMaxQtyJavascript'] = $js;
}
/**
* Set the display options for the shipping pricing.
*/
private function SetShippingCost()
{
if(!GetConfig('ShowProductShipping') ||
$this->productClass->GetProductType() != PT_PHYSICAL) {
$GLOBALS['HideShipping'] = 'none';
return;
}
if ($this->productClass->GetFixedShippingCost() != 0) {
// Is there a fixed shipping cost?
$GLOBALS['ShippingPrice'] = sprintf("%s %s",
CurrencyConvertFormatPrice($this->productClass->GetFixedShippingCost()),
GetLang('FixedShippingCost'));
}
else if ($this->productClass->HasFreeShipping()) {
// Does this product have free shipping?
$GLOBALS['ShippingPrice'] = GetLang('FreeShipping');
}
// Purchasing is allowed, so show calculated at checkout
else if($this->productClass->IsPurchasingAllowed()) {
$GLOBALS['ShippingPrice'] = GetLang('CalculatedAtCheckout');
}
else {
$GLOBALS['HideShipping'] = 'none';
}
}
/**
* Set general pricing details for the product.
*/
private function SetPricingDetails()
{
$product = $this->productClass->getProduct();
$GLOBALS['PriceLabel'] = GetLang('Price');
if($this->productClass->GetProductCallForPricingLabel()) {
$GLOBALS['ProductPrice'] =
$GLOBALS['ISC_CLASS_TEMPLATE']->ParseGL($this->productClass->GetProductCallForPricingLabel());
}
// If prices are hidden, then we don't need to go any further
else if($this->productClass->ArePricesHidden()) {
$GLOBALS['HidePrice'] = "display: none;";
$GLOBALS['HideRRP'] = 'none';
$GLOBALS['ProductPrice'] = '';
return;
}
else {
$options = array('strikeRetail' => false);
$GLOBALS['ProductPrice'] = formatProductDetailsPrice($product,
$options);
}
// Determine if we need to show the RRP for this product or not
// by comparing the price of the product including any taxes if
// there are any
$GLOBALS['HideRRP'] = "none";
$productPrice = $product['prodcalculatedprice'];
$retailPrice = $product['prodretailprice'];
if($retailPrice) {
// Get the tax display format
$displayFormat = getConfig('taxDefaultTaxDisplayProducts');
$options['displayInclusive'] = $displayFormat;
// Convert to the browsing currency, and apply group discounts
$productPrice = formatProductPrice($product, $productPrice,
array(
'localeFormat' => false, 'displayInclusive' => $displayFormat
));
$retailPrice = formatProductPrice($product, $retailPrice, array(
'localeFormat' => false, 'displayInclusive' => $displayFormat
));
if($productPrice < $retailPrice) {
$GLOBALS['HideRRP'] = '';
// Showing call for pricing, so just show the RRP and
that's all
if($this->productClass->GetProductCallForPricingLabel()) {
$GLOBALS['RetailPrice'] =
CurrencyConvertFormatPrice($retailPrice);
}
else {
// ISC-1057: do not apply customer discount to RRP in
this case
$retailPrice = formatProductPrice($product,
$product['prodretailprice'], array(
'localeFormat' => false,
'displayInclusive' => $displayFormat,
'customerGroup' => 0,
));
$GLOBALS['RetailPrice'] = '<strike>' .
formatPrice($retailPrice) . '</strike>';
$GLOBALS['PriceLabel'] = GetLang('YourPrice');
$savings = $retailPrice - $productPrice;
$string = sprintf(getLang('YouSave'), '<span
class="YouSaveAmount">'.formatPrice($savings).'</span>');
$GLOBALS['YouSave'] = '<span
class="YouSave">'.$string.'</span>';
}
}
}
}
/**
* Setup the purchasing options such as quantity box, stock messages,
* add to cart button, product fields etc.
*/
private function SetPurchasingOptions()
{
if(!$this->productClass->IsPurchasingAllowed()) {
$GLOBALS['DisplayAdd'] = 'none';
return;
}
$GLOBALS['AddToCartButton'] =
$GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('ProductAddToCartButton');
$GLOBALS['CartLink'] = CartLink();
$GLOBALS['ProductCartQuantity'] = '';
if(isset($GLOBALS['CartQuantity'.$this->productClass->GetProductId()]))
{
$GLOBALS['ProductCartQuantity'] =
(int)$GLOBALS['CartQuantity'.$this->productClass->GetProductId()];
}
// If we're using a cart quantity drop down, load that
if (GetConfig('TagCartQuantityBoxes') == 'dropdown') {
if ($this->productClass->GetMinQty()) {
$GLOBALS['Quantity' . $this->productClass->GetMinQty()] =
'selected="selected"';
} else {
$GLOBALS['Quantity1'] = 'selected="selected"';
}
$GLOBALS['QtyOptionZero'] = "";
$GLOBALS['AddToCartQty'] =
$GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("CartItemQtySelect");
}
// Otherwise, load the textbox
else {
$GLOBALS['ProductQuantity'] = 1;
$GLOBALS['AddToCartQty'] =
$GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("CartItemQtyText");
}
// Can we sell this product/option
$saleable = IsProductSaleable($this->productClass->GetProduct());
$variations = $this->productClass->GetProductVariationOptions();
if(!empty($variations) &&
$this->productClass->GetProductInventoryTracking() == 2) {
$productInStock = true;
}
else {
$productInStock = $saleable;
}
if($productInStock == true) {
$GLOBALS['SNIPPETS']['SideAddItemSoldOut'] = '';
$GLOBALS['DisplayAdd'] = "";
if (GetConfig('FastCartAction') == 'popup' &&
GetConfig('ShowCartSuggestions')) {
$GLOBALS['FastCartButtonJs'] = ' && fastCartAction(event)';
}
}
else if($this->productClass->IsPurchasingAllowed()) {
$output =
$GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideAddItemSoldOut");
$output =
$GLOBALS['ISC_CLASS_TEMPLATE']->ParseSnippets($output,
$GLOBALS['SNIPPETS']);
$GLOBALS['SNIPPETS']['SideAddItemSoldOut'] = $output;
$GLOBALS['BuyBoxSoldOut'] = "ProductBuyBoxSoldOut";
$GLOBALS['DisplayAdd'] = "none";
$GLOBALS['ISC_LANG']['BuyThisItem'] = GetLang('ItemUnavailable');
}
if(GetConfig('ShowAddToCartQtyBox') == 1) {
$GLOBALS['DisplayAddQty'] = $GLOBALS['DisplayAdd'];
}
else {
$GLOBALS['DisplayAddQty'] = "none";
}
if($this->productClass->IsPurchasingAllowed()) {
$this->LoadEventDate();
$this->LoadProductFieldsLayout();
}
$GLOBALS['ShowAddToCartQtyBox'] = GetConfig('ShowAddToCartQtyBox');
}
/**
* Setup the list of variations for this product if it has any.
*/
private function SetProductVariations()
{
$GLOBALS['VariationList'] = '';
$GLOBALS['SNIPPETS']['VariationList'] = '';
$GLOBALS['HideVariationList'] = '';
$GLOBALS['ProductOptionRequired'] = "false";
// Are there any product variations?
$variationOptions =
$this->productClass->GetProductVariationOptions();
if(empty($variationOptions)) {
$GLOBALS['HideVariationList'] = 'display:none;';
return;
}
$variationValues =
$this->productClass->GetProductVariationOptionValues();
// Is a product option required when adding the product to the cart?
if($this->productClass->IsOptionRequired()) {
$GLOBALS['ProductOptionRequired'] = "true";
}
if(count($variationOptions) == 1) {
$onlyOneVariation = true;
$GLOBALS['OptionMessage'] = GetLang('ChooseAnOption');
}
else {
$GLOBALS['OptionMessage'] = GetLang('ChooseOneOrMoreOptions');
$onlyOneVariation = false;
}
$useSelect = false;
$GLOBALS['VariationNumber'] = 0;
foreach($variationOptions as $optionName) {
// If this is the only variation then instead of select boxes,
just show radio buttons
$GLOBALS['VariationChooseText'] = "";
$GLOBALS['VariationNumber']++;
$GLOBALS['VariationName'] = isc_html_escape($optionName);
$GLOBALS['SNIPPETS']['OptionList'] = '';
// Fixes cases where for one reason or another there are no
options for a specific variation
// Botched import?
if(empty($variationValues[$optionName])) {
continue;
}
if($onlyOneVariation && count($variationValues[$optionName])
<= 5 && !$this->productClass->IsOptionRequired()) {
$GLOBALS['OptionId'] = 0;
$GLOBALS['OptionValue'] = GetLang('zNone');
$GLOBALS['OptionChecked'] = "checked=\"checked\"";
$GLOBALS['SNIPPETS']['OptionList'] .=
$GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ProductVariationListSingleItem");
}
else if($onlyOneVariation &&
count($variationValues[$optionName]) > 5) {
$useSelect = true;
}
// Build the list of options
$GLOBALS['OptionChecked'] = '';
if (isset($variationValues[$optionName])) {
foreach($variationValues[$optionName] as $optionid =>
$value) {
$GLOBALS['OptionId'] = (int)$optionid;
$GLOBALS['OptionValue'] = isc_html_escape($value);
if($onlyOneVariation && !$useSelect) {
$GLOBALS['SNIPPETS']['OptionList'] .=
$GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ProductVariationListSingleItem");
}
else {
$GLOBALS['SNIPPETS']['OptionList'] .=
$GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ProductVariationListMultipleItem");
}
}
}
if($onlyOneVariation == true && !$useSelect) {
$output =
$GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ProductVariationListSingle");
}
else {
$GLOBALS['VariationChooseText'] = GetLang('ChooseA')."
".isc_html_escape($optionName);
$output =
$GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ProductVariationListMultiple");
}
$output =
$GLOBALS['ISC_CLASS_TEMPLATE']->ParseSnippets($output,
$GLOBALS['SNIPPETS']);
$GLOBALS['SNIPPETS']['VariationList'] .= $output;
}
}
/**
* Set the event date entry fields up.
*/
public function LoadEventDate()
{
$output = '';
$productId = $this->productClass->GetProductId();
$fields = ($this->productClass->GetEventDateFields());
if (empty($fields['prodeventdaterequired'])) {
return;
}
$GLOBALS['EventDateName'] = '<span
class="Required">*</span>'.$fields['prodeventdatefieldname'];
$from_stamp = $fields['prodeventdatelimitedstartdate'];
$to_stamp = $fields['prodeventdatelimitedenddate'];
$to_day = isc_date("d", $to_stamp);
$from_day = isc_date("d", $from_stamp);
$to_month = isc_date("m", $to_stamp);
$from_month = isc_date("m", $from_stamp);
$to_year = isc_date("Y", $to_stamp);
$from_year = isc_date("Y", $from_stamp);
$to_date = isc_date('jS M Y',$to_stamp);
$from_date = isc_date('jS M Y',$from_stamp);
$eventDateInvalidMessage = sprintf(GetLang('EventDateInvalid'),
strtolower($fields['prodeventdatefieldname']));
$comp_date = '';
$comp_date_end = '';
$eventDateErrorMessage = '';
$edlimited = $fields['prodeventdatelimited'];
if (empty($edlimited)) {
$from_year = isc_date('Y');
$to_year = isc_date('Y',isc_gmmktime(0, 0, 0,
0,0,isc_date('Y')+5));
$GLOBALS['EventDateLimitations'] = '';
} else {
if ($fields['prodeventdatelimitedtype'] == 1) {
$GLOBALS['EventDateLimitations'] =
sprintf(GetLang('EventDateLimitations1'),$from_date,$to_date);
$comp_date = isc_date('Y/m/d', $from_stamp);
$comp_date_end = isc_date('Y/m/d', $to_stamp);
$eventDateErrorMessage =
sprintf(GetLang('EventDateLimitationsLong1'),
strtolower($fields['prodeventdatefieldname']),$from_date,
$to_date);
} else if ($fields['prodeventdatelimitedtype'] == 2) {
$to_year = isc_date('Y', isc_gmmktime(0, 0, 0,
isc_date('m',$from_stamp),isc_date('d',$from_stamp),isc_date('Y',$from_stamp)+5));
$GLOBALS['EventDateLimitations'] =
sprintf(GetLang('EventDateLimitations2'), $from_date);
$comp_date = isc_date('Y/m/d', $from_stamp);
$eventDateErrorMessage =
sprintf(GetLang('EventDateLimitationsLong2'),
strtolower($fields['prodeventdatefieldname']),$from_date);
} else if ($fields['prodeventdatelimitedtype'] == 3) {
$from_year = isc_date('Y', time());
$GLOBALS['EventDateLimitations'] =
sprintf(GetLang('EventDateLimitations3'),$to_date);
$comp_date = isc_date('Y/m/d', $to_stamp);
$eventDateErrorMessage =
sprintf(GetLang('EventDateLimitationsLong3'),
strtolower($fields['prodeventdatefieldname']),$to_date);
}
}
$GLOBALS['OverviewToDays'] = $this->GetDayOptions();
$GLOBALS['OverviewToMonths'] = $this->GetMonthOptions();
$GLOBALS['OverviewToYears'] =
$this->GetYearOptions($from_year,$to_year);
$output .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('EventDate');
$GLOBALS['SNIPPETS']['EventDate'] = $output;
$GLOBALS['EventDateJavascript'] = sprintf("<script
type=\"text/javascript\"> var eventDateData =
{type:'%s',compDate:'%s',compDateEnd:'%s',invalidMessage:'%s',errorMessage:'%s'};
</script>",
$fields['prodeventdatelimitedtype'],
$comp_date,
$comp_date_end,
$eventDateInvalidMessage,
$eventDateErrorMessage
);
}
/**
* Generate a list of the day options available for event dates.
*
* @return string HTML string containing option tags for days 1 to 31.
*/
private function GetDayOptions()
{
$output = '<option value=\'-1\'>---</option>';
for($i = 1; $i <= 31; $i++) {
$output .= sprintf("<option value='%d'>%s</option>", $i, $i);
}
return $output;
}
/**
* Generate select options for selecting a delivery date month.
*
* @return string HTML string containing option tags for available
months.
*/
private function GetMonthOptions()
{
$output = '<option value=\'-1\'>---</option>';
for($i = 1; $i <= 12; $i++) {
$stamp = isc_gmmktime(0, 0, 0, $i, 1, 2000);
$month = isc_date("M", $stamp);
$output .= sprintf("<option value='%d'>%s</option>", $i, $month);
}
return $output;
}
/**
* Generate select options for selecting a delivery date year.
*
* @param int $from The year to start from.
* @param int $to The year to end at.
* @return string HTML string containing option tags for available years.
*/
private function GetYearOptions($from, $to)
{
$output = '<option value=\'-1\'>---</option>';
for($i = $from; $i <= $to; $i++) {
$output .= sprintf("<option value='%d'>%s</option>", $i, $i);
}
return $output;
}
/**
* Generate the configurable product fields if this product has any.
*/
public function LoadProductFieldsLayout()
{
$output = '';
$productId = $this->productClass->GetProductId();
$fields = $this->productClass->GetProductFields($productId);
if(empty($fields)) {
return;
}
foreach($fields as $field) {
$GLOBALS['ProductFieldType'] = isc_html_escape($field['type']);
$GLOBALS['ItemId'] = 0;
$GLOBALS['ProductFieldId'] = (int)$field['id'];
$GLOBALS['ProductFieldName'] = isc_html_escape($field['name']);
$GLOBALS['ProductFieldInputSize'] = '';
$GLOBALS['ProductFieldRequired'] = '';
$GLOBALS['FieldRequiredClass'] = '';
$GLOBALS['CheckboxFieldNameLeft'] = '';
$GLOBALS['CheckboxFieldNameRight'] = '';
$GLOBALS['HideCartFileName'] = 'display:none';
$GLOBALS['HideDeleteFileLink'] = 'display:none';
$GLOBALS['HideFileHelp'] = "display:none";
$snippetFile = 'ProductFieldInput';
switch ($field['type']) {
case 'textarea': {
$snippetFile = 'ProductFieldTextarea';
break;
}
case 'file': {
if(!$GLOBALS['ISC_CLASS_TEMPLATE']->getIsMobileDevice())
{
$GLOBALS['HideFileHelp'] = "";
$GLOBALS['FileSize'] =
Store_Number::niceSize($field['fileSize']*1024);
$GLOBALS['FileTypes'] = $field['fileType'];
}
if($field['required']) {
$this->hasRequiredFileFields = true;
}
break;
}
case 'checkbox': {
$GLOBALS['CheckboxFieldNameLeft'] =
isc_html_escape($field['name']);
$snippetFile = 'ProductFieldCheckbox';
break;
}
case 'select':
$options = explode(',', $field['selectOptions']);
$optionStr = '<option value="">' .
GetLang('PleaseChooseAnOption') . '</option>';
foreach ($options as $option) {
$option = trim($option);
$optionStr .= "<option value=\"" .
isc_html_escape($option) . "\">" .
isc_html_escape($option) . "</option>\n";
}
$GLOBALS['SelectOptions'] = $optionStr;
$snippetFile = 'ProductFieldSelect';
break;
default: break;
}
if($field['required']) {
$GLOBALS['ProductFieldRequired'] = '<span
class="Required">*</span>';
$GLOBALS['FieldRequiredClass'] = 'FieldRequired';
}
$output .=
$GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet($snippetFile);
}
$GLOBALS['SNIPPETS']['ProductFieldsList'] = $output;
}
/**
* Generate the bulk discounts window if this product has any.
*/
public function SetBulkDiscounts()
{
// Does this product have any bulk discount?
if (!$this->productClass->CanUseBulkDiscounts()) {
$GLOBALS['HideBulkDiscountLink'] = 'none';
return;
}
$GLOBALS['HideBulkDiscountLink'] = '';
$GLOBALS['BulkDiscountThickBoxTitle'] =
sprintf(GetLang('BulkDiscountThickBoxTitle'),
isc_html_escape($this->productClass->GetProductName()));
$rates = '';
$prevMax = 0;
$query = "
SELECT *
FROM [|PREFIX|]product_discounts
WHERE discountprodid = " .
(int)$this->productClass->GetProductId() . "
ORDER BY IF(discountquantitymax > 0, discountquantitymax,
discountquantitymin) ASC
";
$result = $this->db->Query($query);
while ($row = $this->db->Fetch($result)) {
$range = '';
if ($row['discountquantitymin'] == 0) {
$range = isc_html_escape(intval($prevMax+1) . ' - ' .
(int)$row['discountquantitymax']);
} else if ($row['discountquantitymax'] == 0) {
$range =
isc_html_escape(sprintf(GetLang('BulkDiscountThickBoxDiscountOrAbove'),
(int)$row['discountquantitymin']));
} else {
$range = isc_html_escape((int)$row['discountquantitymin']
. ' - ' . (int)$row['discountquantitymax']);
}
$discount = '';
switch (isc_strtolower(isc_html_escape($row['discounttype']))) {
case 'price':
$discount =
sprintf(GetLang('BulkDiscountThickBoxDiscountPrice'),
$range,
CurrencyConvertFormatPrice(isc_html_escape($row['discountamount'])));
break;
case 'percent':
$discount =
sprintf(GetLang('BulkDiscountThickBoxDiscountPercent'),
$range, (int)$row['discountamount'] . '%');
break;
case 'fixed';
$price =
CalculateCustGroupDiscount($this->productClass->GetProductId(),$row['discountamount']);
$discount =
sprintf(GetLang('BulkDiscountThickBoxDiscountFixed'),
$range,
CurrencyConvertFormatPrice(isc_html_escape($price)));
break;
}
$rates .= '<li>' . isc_html_escape($discount) . '</li>';
if ($row['discountquantitymax'] !== 0) {
$prevMax = $row['discountquantitymax'];
}
}
$GLOBALS['BulkDiscountThickBoxRates'] = $rates;
$GLOBALS['ProductBulkDiscountThickBox'] =
$GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ProductBulkDiscountThickBox");
}

Friday, 27 September 2013

Integer division, or float multiplication?

Integer division, or float multiplication?

If one has to calculate a fraction of a given int value, say:
int j = 78;
int i = 5* j / 4;
Is this faster than doing:
int i = 1.25*j; // ?
If it is, is there a conversion factor one could use to decide which to
use, as in how many int divisions can be done in the same time a one float
multiplication?
Edit: I think the comments make it clear that the floating point math will
be slower, but the question is, by how much? If I need to replace each
float multiplication by $N$ int divisions, for what $N$ will this not be
worth it anymore?

UIWebView buttons not responding to taps

UIWebView buttons not responding to taps

I have worked for a large company which provides an iPhone app and a
mobile web site.
The iPhone app uses a UIWebView to display HTML pages from the mobile site.
We've got a user that claims that the HTML buttons do not work, in either
the app or the mobile site.
We've ensured that Safari cookie and JavaScript settings are enabled.
Anyone have a clue as to the cause?

Python Grequests + multiprocessing

Python Grequests + multiprocessing

I'm trying to make async http calls using grequests from within a Pool
from the multiprocessing library. I'm encountering a problem that suggests
Grequests and multiprocessing are possibly incompatible with each other;
specifically, calling monkey.patch_all() messes with Pool creation.
Initially, without calling monkey.patch_all() in my code:
from gevent import monkey
monkey.patch_all()
I get these two errors:
NotImplementedError: gevent is only usable from a single thread
and
requests.exceptions.ConnectionError: None: Max retries exceeded with url:
SOME_URL (Caused by redirect)
Calling monkey.patch_all() fixes the above errors, but causes my code to
hang at:
p = Pool(THREAD_POOL_SIZE)
Not calling monkey.patch_all() leads to my Pool created successfully.
Calling monkey.patch_all(thread=False, socket=False) leads to my Pool
created successfully, too, but doesn't solve the initial two errors.

Why does std::make_tuple turn std::reference_wrapper arguments into X?

Why does std::make_tuple turn std::reference_wrapper arguments into X?

In the C++11 standard it states that (see cppreference.com, see also
section 20.4.2.4 of the standard) it states that
template< class... Types >
tuple<VTypes...> make_tuple( Types&&... args );
Creates a tuple object, deducing the target type from the types of arguments.
For each Ti in Types..., the corresponding type Vi in Vtypes... is
std::decay<Ti>::type unless application of std::decay results in
std::reference_wrapper<X> for some type X, in which case the deduced type
is X&.
I am wondering: Why are reference wrappers treated special here?

Crystal Reports suppressing an entire group based on one item in group

Crystal Reports suppressing an entire group based on one item in group

Say for instance I have a report with a bunch of groups that each contain
a few items as below. (4 items in group Patient Id 12345 and 3 items in
group 54321). Some of the groups all have dates, some of them do not. What
I need to do is suppress the entire group if one date is missing(Active)
as in group 12345. I know how to suppress a single row, but I can't figure
out how to suppress the group header and all of its rows. Help!
Patient Id----------Patient Name
12345---------------Smith, John
--------Discharge Date: 2013/09/05
--------Discharge Date: 2013/09/10
--------Discharge Date: Active
--------Discharge Date: 2013/09/20
54321---------------Smith, Jane
--------Discharge Date: 2013/09/03
--------Discharge Date: 2013/09/10
--------Discharge Date: 2013/09/18

How to read library version in Qt?

How to read library version in Qt?

I want to read a library version of dynamic library (.dylib on Mac and
.dll on Windows) with Qt method. Say I created several versions of given
library over time and now I want to read the version itself. We can add
the version to the project, see: add version. 1. I do know how to read Qt
library version: QT_VERSION_STR 2. I do know how to read the version of my
application: QApplication::applicationVersion()
I have the libraries created manually with some versions. Now I want to be
able to read from the file (.dylib or .dll) which version was set.

Thursday, 26 September 2013

Display fields when user selects particular value from combo box - Validation logic issue

Display fields when user selects particular value from combo box -
Validation logic issue

I have a combo box, and there are 2 values to be selected from it. either
Male or Female. When user selects Male then another 2 textboxes gets
displayed. Those 2 text box cann't be empty (as they are being validated).
The problem : When the user selects Female, the 2 textboxes discussed
above is hidden, and I am not allowed to navigate to the next screen
without filling some values to those 2 fields (because its being
validated). How can i solve this?
My COde
<table>
<tr>
<td align="left">
<select id="gender" name="gender"
onchange='genderfind(this.value);'>
<option value="female">female</option>
<option value="male">Male</option>
</select>
</td>
<td id="gb" style="display:none;"> <td>
<input type="text" name="name" /></td>
<td align="left"><span id="msg_name"></span>&nbsp;</td>
<td>
<input type="text" name="lastname" /></td>
<td align="left"><span id="msg_lastname"></span>&nbsp;</td>
</td>
</tr>
</table>
</body>
JQUERY
function validateStep() {
var isValid = true;
var un = $('#name').val();
if (!un && un.length <= 0) {
isValid = false;
$('#msg_name').html('first name missing').show();
} else {
$('#msg_name').html('').hide();
}
// validate password
var l = $('#lastname').val();
if (!l && l.length <= 0) {
isValid = false;
$('#msg_lastname').html('last name missing').show();
} else {
$('#msg_lastname').html('').hide();
}
return isValid;
}
///
<script>
function genderfind(val) {
//alert(element);
if (val == 'male' ) {
document.getElementById('gb').style.display = 'block';
} else {
document.getElementById('gb').style.display = 'none';
}
}
</script>

Wednesday, 25 September 2013

how to set phone number in (888) 777-7777 format in android?

how to set phone number in (888) 777-7777 format in android?

hiii everybody.. i want to do this (888) 777-7777 format. i am getting
like this 888-777-7777 i put my code which i have done with
editTextChandedListner so how is it posible using this my code.plz do
modify this code.help me and thanks in adavnce.
edt_clientphone.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before,
int count) {
// TODO Auto-generated method stub
boolean flag = true;
String eachBlock[] =
edt_clientphone.getText().toString().split("-");
for (int i = 0; i < eachBlock.length; i++)
{
if (eachBlock[i].length() > 3)
{
Log.v("data","cc"+flag + eachBlock[i].length());
}
}
if(flag){
edt_clientphone.setOnKeyListener(new OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent
event) {
// TODO Auto-generated method stub
if (keyCode == KeyEvent.KEYCODE_DEL)
keyDel = 1;
return false;
}
});
if (keyDel == 0) {
if (((edt_clientphone.getText().length() + 1) % 4) == 0)
{
if
(edt_clientphone.getText().toString().split(")").length
<= 2)
{
edt_clientphone.setText(edt_clientphone.getText()
+ "-");
edt_clientphone.setSelection(edt_clientphone.getText().length());
}
}
ab = edt_clientphone.getText().toString();
}
else
{
ab = edt_clientphone.getText().toString();
keyDel = 0;
}
} else {
edt_clientphone.setText(ab);
}
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
// TODO Auto-generated method stub
}
@Override
public void afterTextChanged(Editable s) {
// TODO Auto-generated method stub
}
});

Thursday, 19 September 2013

Algorithm for bicoherence and bispectrum

Algorithm for bicoherence and bispectrum

I am looking for a clear, precise statements for the algorithm for
bicoherence and bispectrum computation. All codes are giving different
results for the same input data. I am open on the use of any programming
language.
Also, I need a test problem to check my implementation.

A User with many Addresses, but User has a primary billing, shipping, and profile Address

A User with many Addresses, but User has a primary billing, shipping, and
profile Address

I'm building a Rails app where a User can have many Addresses. A User also
needs a primary billing Address, primary shipping Address, and primary
profile Address. These primary fields can point to the same Address. A
User cannot have more than one of any primary Address.
I've created a join table called AddressInfo, and I'm bouncing between a
few options:
Make 3 columns on the User model corresponding to each of the primary
Address ids (this would remove the need for the join model I think).
Add a primary boolean column to AddressInfo, and make sure only one is
true when scoped by user_id, address_id and purpose (purpose being
billing, shipping or profile).
Add a primary date time column to AddressInfo, and use the most recently
updated as the primary address (scoped like option 2).
Maybe these options aren't the best, but it's what I've come up with so far.
Any help on how to resolve this issue would be appreciated.
UPDATE:
To be clear, once an Address is created it should always belong to that
User and be undeletable. Ex. a User changes their primary billing address
to a new Address: they should still be able to retrieve that old Address
(maybe even make it a primary address again). If I go with option 1 and
remove the join table, that means I'll need a user_id on Address.

Compound interest calculator: TypeError: unsupported operand type(s) for /: 'str' and 'str'

Compound interest calculator: TypeError: unsupported operand type(s) for
/: 'str' and 'str'

I'm quite new to Python and I was given the task of creating a compound
interest calculator. This is what I've come up with so far:
print ('Hello and welcome to Interest Calculator')
print ('Type in the amount of money you would like to calculate and do not
include the £ sign')
Capital = input()
print ('Now type in the interest rate without the % sign')
InterestRate = input()
Hundred = 100
InterestRate1 = InterestRate / Hundred
print ('Finally, type in the number of years you plan to leave your money
for')
NumberOfYears = input()
Rate = 1 + InterestRate1
Rate2 = pow(Rate, NumberOfYears)
CompoundInterest = Capital * Rate2
print (CompoundInterest)
But as soon as I click run, it tells me this:
TypeError: unsupported operand type(s) for /: 'str' and 'str'

Only sent auto reports when there is data in the report

Only sent auto reports when there is data in the report

I have a report on SharePoint that I want to set up to send daily. The
problem is that sometimes this report will have no data in it.
So my question is, is it possible to set it up so it only sends out the
report if there is data in it?

Inserting date from java to Oracle DB

Inserting date from java to Oracle DB

i was trying to insert a value to one of the column with DATE datatype in
Oracle DB through java.
Tried with the below insertSurveyQuery.append("cast(to_date('12/31/8888',
'MM/dd/yyyy' )as date), ");
OP in Oracle DB:
DEC-31-88
but i want the date to be stored like 12/31/8888.
Any of your help is appreciated!
-Thanks!

How can I read inbox gmail messages from my gmail account?

How can I read inbox gmail messages from my gmail account?

How should I load the body of emails from Gmail in my listView without an
internet connection?
I use two classes to read messages from my gmail account.
public class GMailReader extends javax.mail.Authenticator {
private static final String TAG = "GMailReader";
private String mailhost = "imap.gmail.com";
private Session session;
private Store store;
public GMailReader(String user, String password) {
Properties props = System.getProperties();
if (props == null){
Log.e(TAG, "Properties are null !!");
}else{
props.setProperty("mail.store.protocol", "imaps");
Log.d(TAG, "Transport:
"+props.getProperty("mail.transport.protocol"));
Log.d(TAG, "Store: "+props.getProperty("mail.store.protocol"));
Log.d(TAG, "Host: "+props.getProperty("mail.imap.host"));
Log.d(TAG, "Authentication: "+props.getProperty("mail.imap.auth"));
Log.d(TAG, "Port: "+props.getProperty("mail.imap.port"));
}
try {
session = Session.getDefaultInstance(props, null);
store = session.getStore("imaps");
store.connect(mailhost, user, password);
Log.i(TAG, "Store: "+store.toString());
} catch (NoSuchProviderException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (MessagingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public synchronized Message[] readMail() throws Exception {
try {
Folder folder = store.getFolder("Inbox");
folder.open(Folder.READ_ONLY);
Message[] msgs = folder.getMessages();
return msgs;
} catch (Exception e) {
Log.e("readMail", e.getMessage(), e);
return null;
}
}
}
and MainClass
public class MainActivity extends Activity {
MyTask mt;
Message[] msg = null;
GMailReader gm=null;
ListView lv;
ArrayList<String> catnames = new ArrayList<String>();
ArrayAdapter<String> adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
gm=new GMailReader("myemail@gmail.com","mypassword");
mt = new MyTask();
mt.execute(gm);
lv = (ListView)findViewById(R.id.listView1);
}
class MyTask extends AsyncTask<GMailReader, Integer, Void> {
@Override
protected void onPreExecute() {
super.onPreExecute();
}
@Override
protected Void doInBackground(GMailReader... urls) {
try {
msg = gm.readMail();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(Void result) {
super.onPostExecute(result);
for(int i=0; i<msg.length; i++)
{
catnames.add(msg.toString());
}
adapter = new ArrayAdapter<String>(MainActivity.this,
android.R.layout.simple_list_item_1, catnames);
lv.setAdapter(adapter);
}
}
}
My Manifest is
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.jim"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission
android:name="com.google.android.gm.permission.READ_CONTENT_PROVIDER"
/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission
android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.jim.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
My activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</ListView>
</LinearLayout>
I tested this on Android 4.1.2. But it don't work. Why? Maybe there's
another solution?

Conversion failed while converting nvarchar value to datatype int

Conversion failed while converting nvarchar value to datatype int

I want to get the values of @sql to p. But while conversion it says that
"Conversion failed when converting the nvarchar value 'select sum(stock)
from[Hard disk]' to data type int."
declare @tname varchar(10);
declare @p int
declare @i int
declare @sql nvarchar(max);
set @tname = 'Hard disk';
set @sql = 'select sum(stock) from' + '[' + @tname + ']'
exec (@sql)
print @sql
select @p = convert(int,@sql)
print @p
What i want is to assign the result of the query @SQL in integer variable
@p..

Wednesday, 18 September 2013

How to use href attribute in mvc4

How to use href attribute in mvc4

I am having a < href > attributes in my .cshtml page at mvc4 @cp.Name in
my mvc 4 .... what i need is if a person clicks the above link . i have to
redirect him to any of the ActionName in Controller (for eg: Index in
HomeController )...... how to do it. In my above sample i have redirected
to google.com...... but i need to redirect to any of actionname in
controller...... My code:
<nav> @{ List<MenuRazor.Models.MenuItem> menulist = ViewBag.Menu; }
<ul id="menu">
@foreach (var mp in menulist.Where(p => p.ParentMenu_Id == 0)) {
<li> <a href="#">@mp.Name</a>
@if (menulist.Count(p => p.ParentMenu_Id == mp.Id) > 0)
{ @:<ul> }
@RenderMenuItem(menulist, mp)
@if (menulist.Count(p => p.ParentMenu_Id == mp.Id) > 0){@:</ul> }
</li> }
</ul>
@helper RenderMenuItem(List<MenuRazor.Models.MenuItem> menuList,
MenuRazor.Models.MenuItem mi)
{
foreach (var cp in menuList.Where(p => p.ParentMenu_Id == mi.Id)) {
@:<li> <a href="http://codeproject.com">@cp.Name</a>
if (menuList.Count(p => p.ParentMenu_Id == cp.Id) > 0) {
@:<ul>
}
@RenderMenuItem(menuList, cp)
if (menuList.Count(p => p.ParentMenu_Id == cp.Id) > 0) {
@:</ul>
} else {
@:</li>
}
} } </nav>

Detecting a property checked on a check box and applying a class

Detecting a property checked on a check box and applying a class

I have been using the following code to update div styles when a check box
is checked:
http://jsfiddle.net/tPawr/6/
$(document).ready(function() {
var checkbox = $('input[type="checkbox"]');
var checkimage = $('<div class="checkbox-image" />');
$(checkbox).each(function(){
$(this).show().before(checkimage);
});
$(checkbox).prop('checked',function() {
$('.checkbox-image').addClass('checked');
});
$('checkbox-image').on('click',function(){
$(this).toggleClass('checked').after().prop('checked',$(this).is('.checked'));
});
});
It was working fine, and then it stopped working and I can't work out why?
Can anyone help?

html5 validation error on simple javascript dropdown

html5 validation error on simple javascript dropdown

I have a simple javascript dropdown menu that I'm getting an HTML5
validation error. The error is "Bad value goto(this); for attribute
onchange on element select: identifier is a reserved word." Can anyone
help me out with what to change in the code:
<script>
<!--
function goto(choose){
var selected=choose.options[choose.selectedIndex].value;
if(selected != ""){
location.href=selected;
}
}
//-->
</script>
<strong><SELECT onChange="goto(this);"></strong>
<option value="">--Choose studio--</option>
<option value="[home]/studio-1/">Studio 1</option>
<option value="[home]/studio-2">Studio 2</option>
</SELECT>';

Fastest way to explode / split in PHP?

Fastest way to explode / split in PHP?

So I have a string which looks like this;
[CONTACT]John[FNAME]Doe[LNAME]0754XXXXXXX[ENDNO][ENDCONTACT]
What is the best way to iterate through the string and assign variables to
each part? At the moment I am doing an explode with
[ENDCONTACT]
as the delimeter.
And then doing a foreach to loop through the rest of the string. This is
where I'm stuck, whats the best way to split the rest of the string up
based on the tags.
The end result would be something like;
$fname = "John"; $lname = "Doe";
etc
Thanks!

Unable to sort columns in Pandas

Unable to sort columns in Pandas

The following should sort the names of my data frame columns based on
their mean value:
sorted(a.columns, key=lambda x: mydf.mean().loc[x])
so that I could use it to sort the actual columns as:
keyf = key=lambda x: mydf.mean()[x]), axis=1
mydf = mydf.reindex_axis(sorted(mydf.columns, key = keyf)
But instead I get
ValueError: The truth value of an array with more than one element is
ambiguous. Use a.any() or a.all()
Why?
Here is the data frame mydf:
Something Foo Bar Positive Negative
0 0.690489 0.475099 0.613022 0.690489 0.481065
1 0.633300 0.489058 0.620519 0.633300 0.504669
2 0.578095 0.457907 0.488271 0.578095 0.493823
3 0.680185 0.373466 0.579683 0.680185 0.564603
4 0.546329 0.527526 0.497956 0.546329 0.490985
5 0.539669 0.388896 0.553585 0.539669 0.502550
6 0.616210 0.490364 0.411997 0.616210 0.280764
7 0.463462 0.491058 0.577513 0.463462 0.491796
8 0.571062 0.506782 0.418724 0.571062 0.355602
9 0.642424 0.435661 0.514894 0.642424 0.485734
10 0.562427 0.518879 0.510625 0.562427 0.330446
11 0.651997 0.495033 0.485939 0.651997 0.541905
12 0.651075 0.586200 0.556045 0.651075 0.455618
13 0.642308 0.475351 0.454831 0.642308 0.494306
14 0.631409 0.387464 0.447110 0.631409 0.411720
15 0.610304 0.455503 0.569653 0.610304 0.319964
16 0.554888 0.482659 0.572695 0.554888 0.528743
17 0.620681 0.558925 0.585417 0.620681 0.463687
18 0.453624 0.407804 0.461207 0.453624 0.524084
19 0.623790 0.519005 0.451432 0.623790 0.449669

Toggle show hide others using child not parent?

Toggle show hide others using child not parent?

how to get toggle show hide from click of children not parent.
I want to toggle Image A when click on Thumbnail A, not the entire div.
Thanks.
Fiddle
http://jsfiddle.net/pandaktuai/Jeb86/
HTML
<div>
<dl>
<dt>Thumbnail A</dt>
<dd>Name A</dd>
<dd>Price A</dd>
</dl>
<ul class="details">
<li>Image A</li>
</ul>
</div>

Windows could not start the VMWare Authorization Service service on Local Computer

Windows could not start the VMWare Authorization Service service on Local
Computer

I tried to run VMWare Workstation but it gave me an error:
"Transport (VMDB) error -44: Message.
The VMware Authorization Service is not running."
I tried to find the solution to this and I got to this website:
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1007131
telling me to run the service manually. Then I tried to do everything they
said to do. and it gave me the error:
"Windows could not start the VMware Authorization Service service on Local
Computer
Error 1075:The dependency service does not exist or has been marked for
deletion"
So I found this question:
The VMware Authorization Service is not running
Which told me to "repair" when clicking the installer. So I ran:
VMware-Converter-all.exe (I dont even know if this is the right one) and I
clicked repair. So I tried it again and It still gave me the same error.
The Windows could not start error. Now I am at a dead end. What should I
do to fix this?

How to Start "Vaadin touch kit" with Android?

How to Start "Vaadin touch kit" with Android?

I am planning to create simple welcome application in android with make
use of "Vaadin Touch Kit" . But I do not know how to start and how to make
use of it. So I Would like to have some sort of suggestions to start .
Looking forward for the reply.

Method in listener does not work

Method in listener does not work

I've a class with several JMenuItem. I've added a listener which has to
call a method of the class. No compiling erros, but the method seems has
not called. How can I do to make the listener call the method?
Here my code, it will explain better:
public class FinestraOrario extends JFrame
{
private int semester;
private DBConnection connection = new DBConnection();
private Container c = this.getContentPane();
private JMenu subjMnu = new JMenu("Insegnamento");
private JMenu classMnu = new JMenu("Aula");
private JMenu profMnu = new JMenu("Docente");
public FinestraOrario(int i)
{
semester = i;
//Define menus
JMenuBar bar = new JMenuBar();
JMenu choice = new JMenu("Visualizza Orario per..");
//Define frame features
this.setSize(1150,650);
this.setLocationRelativeTo(null);
this.setJMenuBar(bar);
//Add JMenu
bar.add(choice);
choice.add(classMnu);
choice.add(subjMnu);
choice.add(profMnu);
//populate Menus
populateMenu();
}
private void ShowChoosenTable(int semester String condition)
{
//does something;
}
private void populateMenu ()
{
//data from database which populate the JMenu as JmenuItem
ArrayList<String[]> subjctesAndClasses=
connection.getSemesterData(semester, "");
ArrayList<String[]> teachers =
connection.getSemesterData(semester, "keep theachers");
Iterator<String[]> i=subjctesAndClasses.iterator();
Iterator<String[]> j=teachers.iterator();
Set<String> set1 = new HashSet<String>();
Set<String> set2 = new HashSet<String>();
Set<String> set3 = new HashSet<String>();
while(i.hasNext()) //check values
{
String[] value=i.next();
String subject = value[1]; //value contains at
subjects at index 1 and classes at index 2
String class=value[2];
set1.add(subject); //erase duplicate
set2.add(class);
}
//getting value without duplicates
for (String s: set1)
{
JMenuItem item = new JMenuItem(s);
subjMnu.add(item);
item.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
showChoosenTable();
}
});
}
for (String s: set2)
{
JMenuItem item = new JMenuItem(s);
classMnu.add(item);
}
while(j.hasNext()) //idem for teacher
{
String[] value=j.next();
String teacher = value[0];
set3.add(teacher);
}
for (String s: set3)
{profMnu.add(new JMenuItem(s));}
}
}

Tuesday, 17 September 2013

Java Replcae String

Java Replcae String

I am try to replace below String
#cit {font-size:16pt; color:navy; text-align:center; font-weight:bold;}
With
#cit {font-size:16pt; color:red; text-align:center; font-weight:bold;}
i am writting a Java code for this
strbuf.toString().replaceAll(Pattern.quote("#cit {font-size:16pt;
color:navy; text-align:center; font-weight:bold;}"), "#cit
{font-size:16pt; color:red; text-align:center; font-weight:bold;}");
but the String not get replace? please help me

SQL to return record counts in X intervals

SQL to return record counts in X intervals

I have a table like this:
id | created_on
1 2013-09-03 20:05:09
2 2013-09-05 17:03:13
...
How do I write a query to return a result of record counts that was
created from Date X to Date Y in 7-day intervals?
So the result would look like this:
count | created_on
4 2013-09-17 00:00:00
2 2013-09-24 00:00:00
1 2013-09-31 00:00:00
10 2013-10-07 00:00:00
...

Slimbox2 fit to window - CSS, jQuery

Slimbox2 fit to window - CSS, jQuery

I'm using Slimbox2 for my galleries but there is missing one important
feature - resize frame to fit the screen. When image is too large it goes
beyond the screen. Is there anyone who found solution for that ?
Plugin official site
Api documentation

Fixing this is really important for me, thanks in advance !

Why do these objects (from a generator) change when I add them to a list?

Why do these objects (from a generator) change when I add them to a list?

So I'm trying to get objects from a generator and add them to a list. But
the moment I add them to the list, the list fills with null objects
instead of the objects I've added. Why is that?
This code
#!/usr/bin/python
# Create a graph with 5 nodes
from snap import *
G = TUNGraph.New()
for i in range(5):
G.AddNode(i)
# Ids of these nodes are 0, 1, 2, 3, 4
for node in G.Nodes(): # G.Nodes() is a generator
print node.GetId()
lst = []
for node in G.Nodes():
lst.append(node)
print
# All of the nodes magically change to have ID -1
print [node.GetId() for node in lst]
print
# The nodes in the original graph are unchanged
for i in G.Nodes():
print i.GetId()
produces the output
0
1
2
3
4
[-1, -1, -1, -1, -1]
0
1
2
3
4

Get object value with variable in PHP

Get object value with variable in PHP

I am trying to get an object value using a variable passed to a function.
Here is a simple example of what I am trying to do:
function get_date($object, $date_name)
{
// this should execute like "$project->date_of_project"
return formatted_date($object->$date_name);
}
echo get_date($project, 'date_of_project');
I am getting the error:
Trying to get property of non-object
I read in a few places to try the following (but it does not work):
$object->{$date_name}[0]
A var_dump shows the property is there:
object(stdClass)#33 (1) {
["date_of_project"]=>
string(19) "2013-04-25 00:00:00"
}

Is there something that starts timer to make an action?

Is there something that starts timer to make an action?

Is there something, that puts a timer for making an action after days, in
php.
Like if I have blocked users table in DB... I've put it to the table, and
let's say I want to remove it from blocked user table after 5 days... is
there something that automates it???
Hope I asked correctly and you understood my thought

Sunday, 15 September 2013

What the best way to develop Unity3D plug-in?

What the best way to develop Unity3D plug-in?

I have a game developed by Unity3D. And now I want to add a plug-in for
this game (such as game forums). I have 2 solutions for this problem: -
Using Android/iOS native code(Java, Objective-C) - Using local HTML (using
PhoneGap library)
In my case, What is the best solution?
Thanks a lot.

Cakephp 1.3 facebook login and check hostname

Cakephp 1.3 facebook login and check hostname

I have this situation where user login via facebook needs to check on the
$_SERVER['HostName'] as in the database user table that keep records of
particular user details might have more than one row. The difference is by
the "hostname" (to differentiate which subdomain from).
In this situation I can login user with facebook without checking hostname
when it comes to hostname I don't know where should I integrate the check
of "hostname".
Any details that is needed to help understand the situation? I have been
looking around for 2 days and no luck on the solution :/

How to make Boxing game in Isometric 2.5D? please help me

How to make Boxing game in Isometric 2.5D? please help me

How to set x,y of my character to walk in isometric?
I don't use grid.
I'm not good at English. Sorry but I understand you everything.
Please help me.
Thank you.

Rectangle.intersection(Rectangle) returning a Rectangle with negative width and height

Rectangle.intersection(Rectangle) returning a Rectangle with negative
width and height

Does anyone know the circumstances in which this happens or should happen
a cursory glance at the documentation is not helpful.

Symfony2 Create Models

Symfony2 Create Models

Reading Symfony documentation I did not see that talking about Models.
The first thought I thought: I do not want to mix business logic
I dont want DQL in my controller actions. What about MVC than.
My idea is next:
Create new directory in bundle with name Models
Set __ namespace __ for that model and ( use ) attach the necessary
Doctrine class
In my Model class i put DQL logic connected with Entity
Next in controller use current Model.
Just simple controller action whitout mixing DQL in controller
use Company\Bundle\Models\MyModel;
public function getRecentMembersAction($max = 3)
{
$model = new Model() // get model
$list = $model->getRecentMembers($max); // DQL
// Render
return $this->render('CompanyBundle:Controller.index.html.twig',
array('list'=>$list);
}
My question is whether this is a good idea and good practice?

Getting true from the if statement which should return false

Getting true from the if statement which should return false

I'm building a chrome extension right now.
I'm almost done with building my extension, but I'm getting a weird problem.
I'm getting true from the if statement which should return false.
This is the code I'm working on right now.
var background = new Background();
chrome.runtime.onStartup.addListener(function(){
if(background.getStorage("track-mode").resetFlag == "success"){
var trackMode = background.getStorage("track-mode");
trackMode.resetFlag = "neutral";
background.setStorage("track-mode", trackMode);
//(1)It outputs "neutral" here in alert window as I expect.
alert(background.getStorage("track-mode").resetFlag);
//(2)It outputs true here. I'm expecting false here!
alert(background.getStorage("track-mode").resetFlag == "success");
//(3)It outputs false here. I'm expecting true here!
alert(background.getStorage("track-mode").resetFlag !== "success");
}
})
Please take a look at this code and please tell me if you find out what's
causing this problem.
Thanks!

cant make the body background appear in middle with no-repeat

cant make the body background appear in middle with no-repeat

i am trying to make a background for my page, i want it to appear in
middle but for some reason it shows on the left no matter what i do. any
suggestion?
body { font-family:Tahoma, Geneva, sans-serif; font-size:12px;
color:#696969; text-align:center; min-width:320px;
background:url(../images/background.jpg) center no-repeat;
position:relative; -webkit-text-size-adjust: none; }
i have created a seperate file and it showed in middle with the following
code:
<style>
body{
background:url('background.jpg') center no-repeat;
}
</style>
why doesnt it work on my original page?

Saturday, 14 September 2013

Remove all elements after current one in a div

Remove all elements after current one in a div

I am converting a flowchart into a list of selections using jquery, here
is my function -
$(document).ready(function() {
$('div#containerDiv').on('change', '.chainedSelection',function() {
var selectedVal = $(this).val();
if(parseInt(selectedVal) >= 0 && parseInt(selectedVal) <= 9){
$(this).nextAll().remove();
$("div#containerDiv").append(generateOutputText(selectedVal));
}else if(selectedVal != "-1"){
$(this).nextAll().remove();
$("div#containerDiv").append(generateText(selectedVal));
}
});
});
This list keeps on increasing until the selected value is a numeric and
once the value is numeric in the last selection list, it gives the
selected value as output. Everything working fine if user goes in one
direction only but if user changes value of previously selected item the
select lists are removed with $(this).nextAll().remove(); but rest of the
tags are still present.
So basically I want to remove everything current select element prior to
firing the event on change I want to clear everything after the current
select list.
Fiddle
Thanks

Debug a WPF window or Windows Form without running your application?

Debug a WPF window or Windows Form without running your application?

I'm new to WPF and have a question which quite same with the article:
"Walkthrough: Debug a WPF window or Windows Form without running your
application".
The link:
http://blogs.msdn.com/b/habibh/archive/2009/07/17/walkthrough-debug-a-wpf-window-or-windows-form-without-running-your-application-video.aspx
I will take the picture as an example:
http://blogs.msdn.com/blogfiles/habibh/WindowsLiveWriter/DebugaWPFwindoworWindowsFormwithoutrunni_FD38/image_3.png
From the picture, the project have 4 WPF windows such as:
App.xaml
Create...so on.xaml
MainWindows.xaml
ViewChart... so on.xaml
When every time in VS 2010, I click on the starting debugging (F5) or
start without debugging(Ctrl + F5) will always run the MainWindows.xaml.
What the reason coz this? Is this because of in the App.xaml that we
declare StartupUri="MainWindow.xaml".
Can I run the particular WPF windows such number 4. ViewChart... so
on.xaml instead of the whole application(*Such as the MainWindows.xaml)?

How to pass multiple parameter to controller

How to pass multiple parameter to controller

im traying to change th href of my link to make it take two parametrs to
another function by JS. This should happen when i klick on an element.
Here my Js funktion that not working will
function Changehref(idProdukt, idOperation) {
document.getElementById("deleteIcon").href = "Order/DeleteItem?id=" +
idProdukt + "&operationId=" + idOperation;
}
this is my function im my Controller Order
public ActionResult DeleteItem(long idProduct, long idOperation)
{
var reg = new ProductRegistry();
reg.DeleteProductionOrderOperation(SQLConnection,
idProduct,idOperation);
return View("Details");
}
How to navigate to DeleteItem and send the parameters

Tabbed Menu Doesn't work Properly

Tabbed Menu Doesn't work Properly

I am using a menu called Zozo Tabs.
I am using the same script throughout the website. However, I tried to add
a tab menu to the middle of the page, which we can call main part of the
page.
You can reach to my website from here
The code that I added to the website is
<div id="basic-usage">
<div id="tabbed-nav" class="z-slide normal hover large
z-icons-dark z-shadows z-bordered z-multiline z-tabs
horizontal top top-left white"><ul class="z-tabs-nav
z-tabs-mobile z-state-closed" style="display:
none;"><li><a href="#" class="z-link"
style="text-align: left;"><i
class="z-icon-menu"></i><span
class="z-title">Purchase<span>Get Zozo Tabs
Now!</span></span><span
class="z-arrow"></span></a></li></ul><ul
class="z-tabs-nav z-tabs-desktop z-hide-menu">
<li class="z-tab z-first" data-link="tab1"><a
class="z-link">Overview<span>New Features in
Zozo Tab</span></a></li>
<li class="z-tab" data-link="tab2"><a
class="z-link">Subscribe<span>New Releases and
Updates</span></a></li>
<li class="z-tab" data-link="tab3"><a
class="z-link">Templates<span>More than 12
Templates</span></a></li>
<li class="z-tab" data-link="tab4"><a
class="z-link">Documentation<span>Step-by-step
Guide</span></a></li>
<li class="z-tab z-last z-active"
data-link="tab5"><a
class="z-link">Purchase<span>Get Zozo Tabs
Now!</span></a></li>
</ul>
<div class="z-container" style="">
<div class="z-content" style="display: none;
position: absolute; left: -1224px;"><div
class="z-content-inner">
<h4>Overview</h4>
<p><strong>Slick Design</strong> and
Limitless Customization</p>
</div></div>
<div class="z-content" style="display: none;
position: absolute; left: -1224px;"><div
class="z-content-inner">
<h4>Some of it's key features</h4>
<ul class="icons">
<li>10 unique skins in 6 sizes</li>
<li>10 flexible ways to position</li>
<li>Autoplay support &amp; SEO
friendly </li>
<li>Horizontal &amp; vertical
tabs</li>
<li>Nested tabs</li>
<li>Multiple instances </li>
<li>Free updates &amp; support </li>
</ul>
</div></div>
<div class="z-content" style="display: none;
position: absolute; left: 1224px;"><div
class="z-content-inner">
<h4>10 Preset themes</h4>
<ul class="icons">
<li>White</li>
<li>Crystal</li>
<li>Silver</li>
<li>Gray</li>
<li>Black</li>
<li>Orange</li>
<li>Red</li>
<li>Green</li>
<li>Blue</li>
<li>DeepBlue</li>
</ul>
</div></div>
<div class="z-content" style="position:
absolute; display: none; left: -1224px;"><div
class="z-content-inner">
<div id="tabbed-nav2" class="z-slide
underlined hover medium z-icons-dark
z-bordered z-tabs horizontal top
top-left red"><ul class="z-tabs-nav
z-tabs-mobile z-state-closed"
style="display: none;"><li><a href="#"
class="z-link" style="text-align:
left;"><i
class="z-icon-menu"></i><span
class="z-title">Methods</span><span
class="z-arrow"></span></a></li></ul><ul
class="z-tabs-nav z-tabs-desktop
z-hide-menu">
<li class="z-tab z-first"
data-link="tab1"><a
class="z-link">Getting
Started</a></li>
<li class="z-tab"
data-link="tab2"><a
class="z-link">Configuration</a></li>
<li class="z-tab"
data-link="tab3"><a
class="z-link">API</a></li>
<li class="z-tab z-active"
data-link="tab4"><a
class="z-link">Methods</a></li>
<li class="z-tab z-last"
data-link="tab5"><a
class="z-link">Events</a></li>
</ul>
<div class="z-container" style="">
<div class="z-content"
style="display: none;"><div
class="z-content-inner">
<h4>Getting Started</h4>
<p>The following
default options are
provided by the
plugin. They can be
overridden and
customized by passing
options object to the
initialization of the
pluqin and by using
HTML5 data attributes
on the container
element.</p>
</div></div>
<div class="z-content"
style="display: none;"><div
class="z-content-inner">
<h4>Configuration</h4>
<p>Zozo Tabs comes
with complete API.
Check it out at
zozoui.com</p>
</div></div>
<div class="z-content"
style="display: none;"><div
class="z-content-inner">
<h4>API</h4>
<p>Zozo Tabs comes
with complete API.
Check it out at
zozoui.com</p>
</div></div>
<div class="z-content
z-active" style="display:
block; position: relative;
left: 0px; top: 0px;"><div
class="z-content-inner">
<h4>Methods</h4>
<p>Zozo Tabs comes
with complete API.
Check it out at
zozoui.com</p>
</div></div>
<div class="z-content"
style="position: absolute;
display: none; left: 0px; top:
336px;"><div
class="z-content-inner">
<h4>Events</h4>
<p>Zozo Tabs comes
with complete API.
Check it out at
zozoui.com</p>
<h4>Some of it's key
features</h4>
<ul class="icons">
<li>10 unique
skins in 6
sizes</li>
<li>10 flexible
ways to
position</li>
<li>Autoplay
support &amp; SEO
friendly </li>
<li>Horizontal
&amp; vertical
tabs</li>
<li>Nested tabs</li>
<li>Multiple
instances </li>
<li>Free updates
&amp; support
</li>
</ul>
</div></div>
</div></div>
</div></div>
<div class="z-content z-active"
style="display: block; position: relative;
left: 0px;"><div class="z-content-inner">
<h4>Purchase</h4>
<p><a
href="http://codecanyon.net/item/zozo-tabs/3327836?ref=ZozoUI">Get
Zozo Tabs from CodeCanyon.net</a></p>
</div></div>
</div></div>
</div>
Now it looks like this. It doesn't slide when I click to an item in the
tab panel.