How to sort a given string "ORACLE" in ascending order in oracle?
String="ORACLE"
Out Put Like "ACELOR"
How to write Query? or Pl/Sql Program?
Sunday, 15 September 2013
Saturday, 14 September 2013
Connect to Office 365 from objective-c
Connect to Office 365 from objective-c
Is it possible to connect to the Office 365 service and manage users via
objective-c ? Has anyone had any success with this before?
Is it possible to connect to the Office 365 service and manage users via
objective-c ? Has anyone had any success with this before?
MouseEnter ContextMenu.StaysOpen doesn't respond
MouseEnter ContextMenu.StaysOpen doesn't respond
I've build a WPF application that contains a button, which activates a
drop-down sub-menu. My intent for the button behavior was to make it so
when it is moused-over, the sub-menu appears and you can access it.
Likewise, when the mouse goes off it, the sub-menu disappears. Pretty
basic function.
I'm tried using the MouseEnter xaml and this is where my problem occurs. I
tell the contextmenu to stay open using ContextMenu.IsOpen = true , then
call ContextMenu.StaysOpen = false in the MouseLeave to close it.
private void AdminButton_MouseEnter(object sender, MouseEventArgs e)
{
(sender as Button).ContextMenu.IsEnabled = true;
(sender as Button).ContextMenu.PlacementTarget = (sender as Button);
(sender as Button).ContextMenu.Placement =
System.Windows.Controls.Primitives.PlacementMode.Bottom;
(sender as Button).ContextMenu.IsOpen = true;
(sender as Button).ContextMenu.StaysOpen = false;
}
private void AdminButton_MouseLeave(object sender, MouseEventArgs e)
{
(sender as Button).ContextMenu.StaysOpen = false;
}
The result is that once I mouse over the button, it stays active and the
submenu exists until I click elsewhere on the screen. I'm pretty confused
by this behavior, shouldn't the ContextMenu.StaysOpen = false close the
submenu?
I've already tried to use both MouseEnter/MouseLeave and the most common
behavior is that the second the cursor comes off the button to access the
submenu, the submenu disappears.
I figure if I can't make these commands work, there must be some way to
suspend the MouseLeave duration so the user can get to the submenu before
it closes???
not many examples on the web concerning this action for a button or
textblock, so any help would be great.
I've build a WPF application that contains a button, which activates a
drop-down sub-menu. My intent for the button behavior was to make it so
when it is moused-over, the sub-menu appears and you can access it.
Likewise, when the mouse goes off it, the sub-menu disappears. Pretty
basic function.
I'm tried using the MouseEnter xaml and this is where my problem occurs. I
tell the contextmenu to stay open using ContextMenu.IsOpen = true , then
call ContextMenu.StaysOpen = false in the MouseLeave to close it.
private void AdminButton_MouseEnter(object sender, MouseEventArgs e)
{
(sender as Button).ContextMenu.IsEnabled = true;
(sender as Button).ContextMenu.PlacementTarget = (sender as Button);
(sender as Button).ContextMenu.Placement =
System.Windows.Controls.Primitives.PlacementMode.Bottom;
(sender as Button).ContextMenu.IsOpen = true;
(sender as Button).ContextMenu.StaysOpen = false;
}
private void AdminButton_MouseLeave(object sender, MouseEventArgs e)
{
(sender as Button).ContextMenu.StaysOpen = false;
}
The result is that once I mouse over the button, it stays active and the
submenu exists until I click elsewhere on the screen. I'm pretty confused
by this behavior, shouldn't the ContextMenu.StaysOpen = false close the
submenu?
I've already tried to use both MouseEnter/MouseLeave and the most common
behavior is that the second the cursor comes off the button to access the
submenu, the submenu disappears.
I figure if I can't make these commands work, there must be some way to
suspend the MouseLeave duration so the user can get to the submenu before
it closes???
not many examples on the web concerning this action for a button or
textblock, so any help would be great.
SSRS passing parameters to a web service call
SSRS passing parameters to a web service call
I'm calling a function on an XML web service, and that service requires a
boolean value. But I am at a loss as to how to send a value. It looks like
I'll need a parameter, but it's not having any effect. I've got a
parameter that needs to be put into the report, calling it Boolean at the
moment for simplicity.
<Parameters>
<Parameter Name="Boolean"/>
</Parameters>
This isn't having any effect on the result, it's always being treated as a
function with the default value of false.
I'm calling a function on an XML web service, and that service requires a
boolean value. But I am at a loss as to how to send a value. It looks like
I'll need a parameter, but it's not having any effect. I've got a
parameter that needs to be put into the report, calling it Boolean at the
moment for simplicity.
<Parameters>
<Parameter Name="Boolean"/>
</Parameters>
This isn't having any effect on the result, it's always being treated as a
function with the default value of false.
Exception from writeln function if the input size is big
Exception from writeln function if the input size is big
I am reading the amplitudes of a audio file in D. From string I am
converting the into float[] Than I am writing it like :
auto amplitudeByTime = file2string("data8.txt");//file2string returns
a float[] with size I determine.
writeln(amplitudeByTime);
Everything is ok if the size of float[] is 1660(or less) but when it to
1661(or more) writeln throws an exception like:
std.stdio.StdioException@std\stdio.d(2431): Bad file descriptor
----------------
0x0040EA7B
0x00411F62
0x0040FD80
0x0040FDBB
0x0040F9B9
0x0040B774
0x75EDD2E9 in BaseThreadInitThunk
0x77BF1603 in RtlInitializeExceptionChain
0x77BF15D6 in RtlInitializeExceptionChain
----------------
Do you have any idea about what might be problem?
I am reading the amplitudes of a audio file in D. From string I am
converting the into float[] Than I am writing it like :
auto amplitudeByTime = file2string("data8.txt");//file2string returns
a float[] with size I determine.
writeln(amplitudeByTime);
Everything is ok if the size of float[] is 1660(or less) but when it to
1661(or more) writeln throws an exception like:
std.stdio.StdioException@std\stdio.d(2431): Bad file descriptor
----------------
0x0040EA7B
0x00411F62
0x0040FD80
0x0040FDBB
0x0040F9B9
0x0040B774
0x75EDD2E9 in BaseThreadInitThunk
0x77BF1603 in RtlInitializeExceptionChain
0x77BF15D6 in RtlInitializeExceptionChain
----------------
Do you have any idea about what might be problem?
Magento - set currency when creating order programatically?
Magento - set currency when creating order programatically?
I have a dev magento with multi-currency enabled (GBP, EUR , USD). I am
trying to create a sales order against my dev magento in Euro - however
the order keeps creating in GBP (my base currency).
Any idea what I am doing wrong? Here's my code so far:
<?php
// Init Magento In Admin Store Context
require_once '/home/www-data/public_html/app/Mage.php';
$app = Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
// Function To Generate Magento Sales Order
function CreateOrder($orderData = array())
{
// Validate Order Data
if (!sizeof($orderData)) {
exit('Invalid Order Data');
}
$orderData = (object)$orderData;
if (!sizeof($orderData->BasketData)) {
exit('Sales Order Basket Cannot Be Empty');
}
// Anticipate Error
try
{
// Start New Sales Order Quote
$quote = Mage::getModel('sales/quote')
->setStoreId($orderData->StoreId);
// Set Sales Order Quote Currency
$quote->setCurrency($orderData->Currency);
// Load Sales Order Customer
$customer = Mage::getModel('customer/customer')
->setWebsiteId($orderData->CustomerWebsiteId)
->load($orderData->CustomerId);
// Assign Customer To Sales Order Quote
$quote->assignCustomer($customer);
// Configure Notification
$quote->setSendCconfirmation($orderData->SendConfirmation ? '1' :
'0');
// Add Products To Sales Order Quote
foreach ($orderData->BasketData as $orderLine)
{
// Add Product To Sales Order Quote
$quote->addProduct(
Mage::getModel('catalog/product')->load($orderLine['ProductId']),
new Varien_Object(array(
'price' => floatval($orderLine['Price']),
'qty' => intval($orderLine['Qty'])
))
);
}
// Set Sales Order Billing Address
$billingAddress = $quote->getBillingAddress()->addData(array(
'firstname' => $orderData->BillingAddress['Firstname'],
'lastname' => $orderData->BillingAddress['Lastname'],
'company' => $orderData->BillingAddress['Company'],
'street' =>
array($orderData->BillingAddress['AddressLine1'],
$orderData->BillingAddress['AddressLine2']),
'region_id' => 0,
'region' => $orderData->BillingAddress['Region'],
'city' => $orderData->BillingAddress['City'],
'postcode' => $orderData->BillingAddress['Postcode'],
'country_id' =>
getCountryId($orderData->BillingAddress['Country']),
'telephone' => $orderData->BillingAddress['Telephone']
));
// Set Sales Order Shipping Address
$shippingAddress = $quote->getShippingAddress()->addData(array(
'firstname' => $orderData->ShippingAddress['Firstname'],
'lastname' => $orderData->ShippingAddress['Lastname'],
'company' => $orderData->ShippingAddress['Company'],
'street' =>
array($orderData->ShippingAddress['AddressLine1'],
$orderData->ShippingAddress['AddressLine2']),
'region_id' => 0,
'region' => $orderData->ShippingAddress['Region'],
'city' => $orderData->ShippingAddress['City'],
'postcode' => $orderData->ShippingAddress['Postcode'],
'country_id' =>
getCountryId($orderData->ShippingAddress['Country']),
'telephone' => $orderData->ShippingAddress['Telephone']
));
// Collect Rates and Set Shipping & Payment Method
$shippingAddress->setCollectShippingRates(true)
->collectShippingRates()
->setShippingMethod($orderData->ShippingMethod)
->setPaymentMethod($orderData->PaymentMethod);
// Set Sales Order Payment
$quote->getPayment()->importData(array('method' =>
$orderData->PaymentMethod));
// Collect Totals & Save Quote
$quote->collectTotals()->save();
// Create Order From Quote
$service = Mage::getModel('sales/service_quote', $quote);
$service->submitAll();
$increment_id = $service->getOrder()->getIncrementId();
// Resource Clean-Up
$quote = $customer = $service = null;
// Finished
return $increment_id;
}
catch (Exception $e)
{
// Error
exit($e->getMessage());
}
}
// HELPER FUNCTION
function getCountryId($countryName) {
$countryId = '';
$countryCollection =
Mage::getModel('directory/country')->getCollection();
foreach ($countryCollection as $country) {
if ($countryName == $country->getName()) {
$countryId = $country->getCountryId();
break;
}
}
$countryCollection = null;
return $countryId;
}
// TEST Order Create Function
echo CreateOrder(array(
'Currency' => 'EUR', // Euro
'StoreId' => 3, // Trade Store View
'CustomerWebsiteId' => 2, // Trade Website
'CustomerId' => 5, // Latheesan K.
'SendConfirmation' => false,
'BasketData' => array
(
array('ProductId' => 3, 'Price' => 13.00, 'Qty' => 1), // VCF001
array('ProductId' => 6, 'Price' => 1.00, 'Qty' => 1), // VCF002
array('ProductId' => 8, 'Price' => 14.99, 'Qty' => 1), // VCF003
),
'BillingAddress' => array
(
'Firstname' => 'Latheesan',
'Lastname' => 'Kanes',
'Company' => 'Intelli B.I. Ltd',
'AddressLine1' => 'Unit 1, Eastman Road',
'AddressLine2' => 'Acton',
'Region' => '',
'City' => 'London',
'Postcode' => 'W3 7QS',
'Country' => 'United Kingdom',
'Telephone' => '0208 428 2832',
),
'ShippingAddress' => array
(
'Firstname' => 'Latheesan',
'Lastname' => 'Kanes',
'Company' => 'Intelli B.I. Ltd',
'AddressLine1' => 'Unit 1, Eastman Road',
'AddressLine2' => 'Acton',
'Region' => '',
'City' => 'London',
'Postcode' => 'W3 7QS',
'Country' => 'United Kingdom',
'Telephone' => '0208 428 2832',
),
'ShippingMethod' => 'flatrate_flatrate',
'PaymentMethod' => 'checkmo'
));
?>
Also, this line isn't turning on email notification on order create:
// Configure Notification
$quote->setSendCconfirmation($orderData->SendConfirmation ? '1' : '0');
How do you enable email notification?
Regards, Latheesan
I have a dev magento with multi-currency enabled (GBP, EUR , USD). I am
trying to create a sales order against my dev magento in Euro - however
the order keeps creating in GBP (my base currency).
Any idea what I am doing wrong? Here's my code so far:
<?php
// Init Magento In Admin Store Context
require_once '/home/www-data/public_html/app/Mage.php';
$app = Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
// Function To Generate Magento Sales Order
function CreateOrder($orderData = array())
{
// Validate Order Data
if (!sizeof($orderData)) {
exit('Invalid Order Data');
}
$orderData = (object)$orderData;
if (!sizeof($orderData->BasketData)) {
exit('Sales Order Basket Cannot Be Empty');
}
// Anticipate Error
try
{
// Start New Sales Order Quote
$quote = Mage::getModel('sales/quote')
->setStoreId($orderData->StoreId);
// Set Sales Order Quote Currency
$quote->setCurrency($orderData->Currency);
// Load Sales Order Customer
$customer = Mage::getModel('customer/customer')
->setWebsiteId($orderData->CustomerWebsiteId)
->load($orderData->CustomerId);
// Assign Customer To Sales Order Quote
$quote->assignCustomer($customer);
// Configure Notification
$quote->setSendCconfirmation($orderData->SendConfirmation ? '1' :
'0');
// Add Products To Sales Order Quote
foreach ($orderData->BasketData as $orderLine)
{
// Add Product To Sales Order Quote
$quote->addProduct(
Mage::getModel('catalog/product')->load($orderLine['ProductId']),
new Varien_Object(array(
'price' => floatval($orderLine['Price']),
'qty' => intval($orderLine['Qty'])
))
);
}
// Set Sales Order Billing Address
$billingAddress = $quote->getBillingAddress()->addData(array(
'firstname' => $orderData->BillingAddress['Firstname'],
'lastname' => $orderData->BillingAddress['Lastname'],
'company' => $orderData->BillingAddress['Company'],
'street' =>
array($orderData->BillingAddress['AddressLine1'],
$orderData->BillingAddress['AddressLine2']),
'region_id' => 0,
'region' => $orderData->BillingAddress['Region'],
'city' => $orderData->BillingAddress['City'],
'postcode' => $orderData->BillingAddress['Postcode'],
'country_id' =>
getCountryId($orderData->BillingAddress['Country']),
'telephone' => $orderData->BillingAddress['Telephone']
));
// Set Sales Order Shipping Address
$shippingAddress = $quote->getShippingAddress()->addData(array(
'firstname' => $orderData->ShippingAddress['Firstname'],
'lastname' => $orderData->ShippingAddress['Lastname'],
'company' => $orderData->ShippingAddress['Company'],
'street' =>
array($orderData->ShippingAddress['AddressLine1'],
$orderData->ShippingAddress['AddressLine2']),
'region_id' => 0,
'region' => $orderData->ShippingAddress['Region'],
'city' => $orderData->ShippingAddress['City'],
'postcode' => $orderData->ShippingAddress['Postcode'],
'country_id' =>
getCountryId($orderData->ShippingAddress['Country']),
'telephone' => $orderData->ShippingAddress['Telephone']
));
// Collect Rates and Set Shipping & Payment Method
$shippingAddress->setCollectShippingRates(true)
->collectShippingRates()
->setShippingMethod($orderData->ShippingMethod)
->setPaymentMethod($orderData->PaymentMethod);
// Set Sales Order Payment
$quote->getPayment()->importData(array('method' =>
$orderData->PaymentMethod));
// Collect Totals & Save Quote
$quote->collectTotals()->save();
// Create Order From Quote
$service = Mage::getModel('sales/service_quote', $quote);
$service->submitAll();
$increment_id = $service->getOrder()->getIncrementId();
// Resource Clean-Up
$quote = $customer = $service = null;
// Finished
return $increment_id;
}
catch (Exception $e)
{
// Error
exit($e->getMessage());
}
}
// HELPER FUNCTION
function getCountryId($countryName) {
$countryId = '';
$countryCollection =
Mage::getModel('directory/country')->getCollection();
foreach ($countryCollection as $country) {
if ($countryName == $country->getName()) {
$countryId = $country->getCountryId();
break;
}
}
$countryCollection = null;
return $countryId;
}
// TEST Order Create Function
echo CreateOrder(array(
'Currency' => 'EUR', // Euro
'StoreId' => 3, // Trade Store View
'CustomerWebsiteId' => 2, // Trade Website
'CustomerId' => 5, // Latheesan K.
'SendConfirmation' => false,
'BasketData' => array
(
array('ProductId' => 3, 'Price' => 13.00, 'Qty' => 1), // VCF001
array('ProductId' => 6, 'Price' => 1.00, 'Qty' => 1), // VCF002
array('ProductId' => 8, 'Price' => 14.99, 'Qty' => 1), // VCF003
),
'BillingAddress' => array
(
'Firstname' => 'Latheesan',
'Lastname' => 'Kanes',
'Company' => 'Intelli B.I. Ltd',
'AddressLine1' => 'Unit 1, Eastman Road',
'AddressLine2' => 'Acton',
'Region' => '',
'City' => 'London',
'Postcode' => 'W3 7QS',
'Country' => 'United Kingdom',
'Telephone' => '0208 428 2832',
),
'ShippingAddress' => array
(
'Firstname' => 'Latheesan',
'Lastname' => 'Kanes',
'Company' => 'Intelli B.I. Ltd',
'AddressLine1' => 'Unit 1, Eastman Road',
'AddressLine2' => 'Acton',
'Region' => '',
'City' => 'London',
'Postcode' => 'W3 7QS',
'Country' => 'United Kingdom',
'Telephone' => '0208 428 2832',
),
'ShippingMethod' => 'flatrate_flatrate',
'PaymentMethod' => 'checkmo'
));
?>
Also, this line isn't turning on email notification on order create:
// Configure Notification
$quote->setSendCconfirmation($orderData->SendConfirmation ? '1' : '0');
How do you enable email notification?
Regards, Latheesan
Break mysql row examination with primary key
Break mysql row examination with primary key
id int(primary key , unique)
status enum('enable','disable')
round tinyint(1) (index)
core tinyint(1) (index)
timestamp int(10) (index)
I got a query in a table about 1,800,000 rows.
there's a query like
SELECT * FROM tblmatch WHERE status = 'disable' and round=0 AND core = 3
AND time_stamp < UNIX_TIMESTAMP() ORDER BY time_stamp ASC LIMIT 0,10
Row examination of the query is about 1,680,000 rows
So, i added a id > 1600000 statement to the query , so it looks like
SELECT * FROM tblmatch WHERE id > 1600000 AND status = 'disable' and
round=0 AND time_stamp < UNIX_TIMESTAMP() ORDER BY time_stamp ASC LIMIT
0,10
yet row examinations is the same.
is there anyway to break row examination?
id int(primary key , unique)
status enum('enable','disable')
round tinyint(1) (index)
core tinyint(1) (index)
timestamp int(10) (index)
I got a query in a table about 1,800,000 rows.
there's a query like
SELECT * FROM tblmatch WHERE status = 'disable' and round=0 AND core = 3
AND time_stamp < UNIX_TIMESTAMP() ORDER BY time_stamp ASC LIMIT 0,10
Row examination of the query is about 1,680,000 rows
So, i added a id > 1600000 statement to the query , so it looks like
SELECT * FROM tblmatch WHERE id > 1600000 AND status = 'disable' and
round=0 AND time_stamp < UNIX_TIMESTAMP() ORDER BY time_stamp ASC LIMIT
0,10
yet row examinations is the same.
is there anyway to break row examination?
Subscribe to:
Posts (Atom)