Tutorial by Examples: e

Dim Value As Variant Value = CDec(1.234) 'Set Value to the smallest possible Decimal value Value = CDec("0.0000000000000000000000000001") The Decimal data-type is only available as a sub-type of Variant, so you must declare any variable that needs to contain a Decimal as a Variant ...
A const Enum is the same as a normal Enum. Except that no Object is generated at compile time. Instead, the literal values are substituted where the const Enum is used. // Typescript: A const Enum can be defined like a normal Enum (with start value, specifig values, etc.) const enum NinjaActivity ...
Open the Visual Basic Editor ( see Opening the Visual Basic Editor ) Click Insert --> Module to add a new Module : Copy and Paste the following code in the new module : Sub hello() MsgBox "Hello World !" End Sub To obtain : Click on the green “play” arr...
sample on price increases: UPDATE ItemPrice SET Price = Price * CASE ItemId WHEN 1 THEN 1.05 WHEN 2 THEN 1.10 WHEN 3 THEN 1.15 ELSE 1.00 END
You may have noticed that many applications have double-back-click functionality to exit the app. In this example, we are overriding the default back button action using the onBackPressed() method override. This method will Toast a message for the single back-click action, and will close the app if...
Open Excel Open the Visual Basic Editor ( see Opening the Visual Basic Editor ) Add a new module by clicking Insert --> Module : Copy and Paste the following code in the new module : Public Function Hello() As String 'Note: the output of the function is simply the function's name ...
We can get facts (ansible_os_family, ansible_pkg_mgr) with Ad-Hoc command of setup module and filter. ansible_os_family: $ ansible all -m setup -a 'filter=ansible_os_family' ra.local | SUCCESS => { "ansible_facts": { "ansible_os_family": "Debi...
Paramorphisms model primitive recursion. At each iteration of the fold, the folding function receives the subtree for further processing. para :: Functor f => (f (Fix f, a) -> a) -> Fix f -> a para f = f . fmap (\x -> (x, para f x)) . unFix The Prelude's tails can be modelled as ...
Apomorphisms model primitive corecursion. At each iteration of the unfold, the unfolding function may return either a new seed or a whole subtree. apo :: Functor f => (a -> f (Either (Fix f) a)) -> a -> Fix f apo f = Fix . fmap (either id (apo f)) . f Note that apo and para are dual...
import Test.Tasty import Test.Tasty.SmallCheck as SC import Test.Tasty.QuickCheck as QC import Test.Tasty.HUnit main :: IO () main = defaultMain tests tests :: TestTree tests = testGroup "Tests" [smallCheckTests, quickCheckTests, unitTests] smallCheckTests :: TestTree smal...
Only the homepage works, all other pages return 404 Make sure mod_rewrite module has been installed in Apache and been enabled to load. See step 2 for info on how to do this here: https://www.digitalocean.com/community/tutorials/how-to-set-up-mod_rewrite-for-apache-on-ubuntu-14-04 Make sure the y...
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);
Mage::getBaseUrl();
$this->getSkinUrl('images/imagename.gif', array('_secure'=>true));
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
$this->getSkinUrl('images/imagename.jpg');
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);
Mage::helper('core/url')->getCurrentUrl();
Profiling string concatanation: In [1]: import string In [2]: %%timeit s=""; long_list=list(string.ascii_letters)*50 ....: for substring in long_list: ....: s+=substring ....: 1000 loops, best of 3: 570 us per loop In [3]: %%timeit long_list=list(string.ascii_letters)*50...

Page 451 of 1191