Tutorial by Examples

Given a Symbol: s = :something The simplest way to convert it to a String is by using the Symbol#to_s method: s.to_s # => "something" Another way to do it is by using the Symbol#id2name method which is an alias for the Symbol#to_s method. But it's a method that is unique to the...
UIAlertView and UIActionSheet are Deprecated in iOS 8 and Later. So Apple introduced a new controller for AlertView and ActionSheet called UIAlertController , changing the preferredStyle, you can switch between AlertView and ActionSheet. There is no delegate method for it because all button events a...
NSDictionary *inventory = @{ @"Mercedes-Benz SLK250" : @(13), @"BMW M3 Coupe" : @(self.BMWM3CoupeInventory.count), @"Last Updated" : @"Jul 21, 2016", @"Next Update" : self.nextInventoryUpdateString };
NSDictionary *inventory = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:13], @"Mercedes-Benz SLK250", [NSNumber numberWithInt:22], @"Mercedes-Benz E350", [NSNumber numberWithInt:19], @"BMW M3 Coupe", [NSNumber numberWithInt:16],...
To combine an NSArray of NSString into a new NSString: NSArray *yourWords = @[@"Objective-C", @"is", @"just", @"awesome"]; NSString *sentence = [yourWords componentsJoinedByString:@" "]; // Sentence is now: @"Objective-C is just awesome&quo...
There are a variety of ways to download and use D3. Direct Script Download Download and extract d3.zip Copy the resulting folder to where you will keep your project's dependencies Reference d3.js (for development) or d3.min.js (for production) in your HTML: <script type="text/javascri...
If a code module does not contain Option Explicit at the top of the module, then the compiler will automatically (that is, "implicitly") create variables for you when you use them. They will default to variable type Variant. Public Sub ExampleDeclaration() someVariable = 10 ...
Scope A variable can be declared (in increasing visibility level): At procedure level, using the Dim keyword in any procedure; a local variable. At module level, using the Private keyword in any type of module; a private field. At instance level, using the Friend keyword in any type of class m...
If you have a value that never changes in your application, you can define a named constant and use it in place of a literal value. You can use Const only at module or procedure level. This means the declaration context for a variable must be a class, structure, module, procedure, or block, and can...
The Dim statement should be reserved for local variables. At module-level, prefer explicit access modifiers: Private for private fields, which can only be accessed within the module they're declared in. Public for public fields and global variables, which can be accessed by any calling code. Fr...
Type Hints are heavily discouraged. They exist and are documented here for historical and backward-compatibility reasons. You should use the As [DataType] syntax instead. Public Sub ExampleDeclaration() Dim someInteger% '% Equivalent to "As Integer" Dim someLong& ...
You can open the VB editor in any of the Microsoft Office applications by pressing Alt+F11 or going to the Developer tab and clicking on the "Visual Basic" button. If you don't see the Developer tab in the Ribbon, check if this is enabled. By default the Developer tab is disabled. To enab...
To begin using WebDriver you will need to obtain the relevant Driver from the Selenium site: Selenium HQ Downloads. From here you need to download the driver relevant to the browser(s) and/or platform(s) you are trying to run WebDriver on, e.g. if you were testing in Chrome the Selenium site will di...
Rails provides several ways to organize your routes. Scope by URL: scope 'admin' do get 'dashboard', to: 'administration#dashboard' resources 'employees' end This generates the following routes get '/admin/dashboard', to: 'administration#dashboard' post '/admin/empl...
The Vim on your machine—if there is one—is very likely to be a "small" build that lacks useful features like clipboard support, syntax highlighting or even the ability to use plugins. This is not a problem if all you need is a quick way to edit config files but you will soon hit a number ...
Example for reading file data_file.csv such as: File: index,header1,header2,header3 1,str_data,12,1.4 3,str_data,22,42.33 4,str_data,2,3.44 2,str_data,43,43.34 7, str_data, 25, 23.32 Code: pd.read_csv('data_file.csv') Output: index header1 header2 header3 0 1 str_dat...
There are several ways to go about installing matplotlib, some of which will depend on the system you are using. If you are lucky, you will be able to use a package manager to easily install the matplotlib module and its dependencies. Windows On Windows machines you can try to use the pip package ...
XML is a syntax, which means a simple text editor is enough to get started. However, having an XML-specific editor that shows you when and where your document is not well-formed is almost indispensable for productivity. Such editors may also allow you to validate XML documents against an XML Schema...
To install the cordova command-line tool, follow these steps: Download and install Node.js. On installation you should be able to invoke node and npm on your command line. To see if Node is installed, open your CLI (command line interface). For Windows it's the Windows Command Prompt, for ...
On most GNU+Linux operating systems, PostgreSQL can easily be installed using the operating system package manager. Red Hat family Respositories can be found here: https://yum.postgresql.org/repopackages.php Download the repository to local machine with the command yum -y install https://downloa...

Page 111 of 1336