Tutorial by Examples: by

This guide assumes you already have Ruby installed. If you're using Ruby < 1.9 you'll have to manually install RubyGems as it won't be included natively. To install a ruby gem, enter the command: gem install [gemname] If you are working on a project with a list of gem dependencies, then the...
$orderid = 12345; $order = Mage::getModel('sales/order')->load($orderid); The above code is roughly analogous to the following SQL query. select * from sales_flat_order where entity_id=12345;
$incrementid = 100000000; $order = Mage::getModel('sales/order')->loadByIncrementId($incrementid); The above code is roughly analogous to the following SQL query. select * from sales_flat_order where increment_id=100000000; The increment_id is the customer facing order identifier, whereas...
Enter these commands in Android device Terminal su setprop service.adb.tcp.port 5555 stop adbd start adbd After this, you can use CMD and ADB to connect using the following command adb connect 192.168.0.101.5555 And you can disable it and return ADB to listening on USB with setprop servi...
0.18.0 Prior to 0.18.0 you can create ranges like this: > range = [1..5] [1,2,3,4,5] : List number > > negative = [-5..3] [-5,-4,-3,-2,-1,0,1,2,3] : List number 0.18.0 In 0.18.0 The [1..5] syntax has been removed. > range = List.range 1 5 [1,2,3,4,5] : List number > &g...
This query returns all cones with either a mint scoop or a vanilla scoop. minty_vanilla_cones = IceCream.objects.filter(scoops__contained_by=[MINT, VANILLA])
php artisan route:list --method=GET --method=POST This will include all routes that accept GET and POST methods simultaneously.
Oracle's CONNECT BY functionality provides many useful and nontrivial features that are not built-in when using SQL standard recursive CTEs. This example replicates these features (with a few additions for sake of completeness), using SQL Server syntax. It is most useful for Oracle developers findin...
Say we have an enum DayOfWeek: enum DayOfWeek { SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY; } An enum is compiled with a built-in static valueOf() method which can be used to lookup a constant by its name: String dayName = DayOfWeek.SUNDAY.name(); assert dayName.equal...
# Create a sample DF df = pd.DataFrame(np.random.randn(5, 3), columns=list('ABC')) # Show DF df A B C 0 -0.467542 0.469146 -0.861848 1 -0.823205 -0.167087 -0.759942 2 -1.508202 1.361894 -0.166701 3 0.394143 -0.287349 -0.978102 4 -0.160431 1.054736 -0.785250 ...
Python is a hybrid interpreter. When running a program, it first assembles it into bytecode which can then be run in the Python interpreter (also called a Python virtual machine). The dis module in the standard library can be used to make the Python bytecode human-readable by disassembling classes, ...
The iloc (short for integer location) method allows to select the rows of a dataframe based on their position index. This way one can slice dataframes just like one does with Python's list slicing. df = pd.DataFrame([[11, 22], [33, 44], [55, 66]], index=list("abc")) df # Out: # 0...
public void iterateAndFilter() throws IOException { Path dir = Paths.get("C:/foo/bar"); PathMatcher imageFileMatcher = FileSystems.getDefault().getPathMatcher( "regex:.*(?i:jpg|jpeg|png|gif|bmp|jpe|jfif)"); try (Direc...
If no ordering function is passed, std::sort will order the elements by calling operator< on pairs of elements, which must return a type contextually convertible to bool (or just bool). Basic types (integers, floats, pointers etc) have already build in comparison operators. We can overload this ...
Use this option if you don't need an Application subclass. This is the simplest option, but this way you can't provide your own Application subclass. If an Application subclass is needed, you will have to switch to one of the other options to do so. For this option, simply specify the fully-quali...
Use this option if your project requires an Application subclass. Specify this Application subclass using the android:name property in the manifest file inside the application tag. In the Application subclass, add the attachBaseContext() method override, and in that method call MultiDex.install():...
updateState by key can be used to create a stateful DStream based on upcoming data. It requires a function: object UpdateStateFunctions { def updateState(current: Seq[Double], previous: Option[StatCounter]) = { previous.map(s => s.merge(current)).orElse(Some(StatCounter(current))) } ...
Due to logical query processing order, alias can be used in order by. SELECT DisplayName, JoinDate as jd, Reputation as rep FROM Users ORDER BY jd, rep And can use relative order of the columns in the select statement .Consider the same example as above and instead of using alias use the relat...
NSArray *array = @[ @{ @"id": @"7CDF6D22-8D36-49C2-84FE-E31EECCECB71", @"title": @"Jackie Chan Strike Movie", @"url": @"http://abc.com/playback.m3u8&...
To fetch the latest version of an item in the current language: Sitecore.Context.Database.GetItem(new ID("{11111111-1111-1111-1111-111111111111}"));

Page 4 of 23