Tutorial by Examples: di

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...
Assuming python and python3 are both installed, it is possible to create a virtual environment for Python 3 even if python3 is not the default Python: virtualenv -p python3 foo or virtualenv --python=python3 foo or python3 -m venv foo or pyvenv foo Actually you can create virtual ...
NSArray *array = [NSArray arrayWithObjects:@"Nick", @"Ben", @"Adam", @"Melissa", nil]; NSPredicate *aPredicate = [NSPredicate predicateWithFormat:@"SELF beginswith[c] 'a'"]; NSArray *beginWithA = [array filteredArrayUsingPredicate:bPredicate]; ...
By default error message appears below textbox in <div class="help-block"></div> on keyUp or after pressing submit button if any validation constraints aren't met. Sometimes we want a message on submit only i.e. no validation at onKeyup event. Let's check yii2/widgets/ActiveF...
// decode NSString *string = [[NSString alloc] initWithData:utf8Data encoding:NSUTF8StringEncoding]; // encode NSData *utf8Data = [string dataUsingEncoding:NSUTF8StringEncoding]; Some supported encodings are: NSASCIIStringEncoding NSUTF8StringEnc...
The first step to start Xamarin development on an OS X machine, is to download and install Xamarin Studio Community version from the official website. A few fields need to be filled to download the installer as shown in the picture below. The Xamarin Unified installer takes care of identifying an...
Different flavors of application builds can contain different resources. To create a flavor-specific resource make a directory with the lower-case name of your flavor in the src directory and add your resources in the same way you would normally. For example, if you had a flavour Development and w...
Java 8 provides classes called IntSummaryStatistics, DoubleSummaryStatistics and LongSummaryStatistics which give a state object for collecting statistics such as count, min, max, sum, and average. Java SE 8 List<Integer> naturalNumbers = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); IntSu...
Xamarin.Forms is a cross-platform natively backed UI toolkit abstraction that allows developers to easily create user interfaces that can be shared across Android, iOS, Windows, and Windows Phone. The user interfaces are rendered using the native controls of the target platform, allowing Xamarin.For...
Just like all programming language, Matlab is designed to read and write in a large variety of formats. The native library supports a large number of Text,Image,Video,Audio,Data formats with more formats included in each version update - check here to see the full list of supported file formats and ...
A button can be disabled by Swift myButton.isEnabled = false Objective-C: myButton.enabled = NO; The button will become gray: If you don't want the button appearance to change when disabled set adjustsImageWhenDisabled to false / NO
Suppose you have defined the following Person class: public class Person { String name; int age; public Person (int age, String name) { this.age = age; this.name = name; } } If you instantiate a new Person object: Person person = new Person(25, &qu...
File f = new File(path); String content = new Scanner(f).useDelimiter("\\Z").next(); \Z is the EOF (End of File) Symbol. When set as delimiter the Scanner will read the fill until the EOF Flag is reached.
Directives are one of the most powerful features of angularjs. Custom angularjs directives are used to extend functionality of html by creating new html elements or custom attributes to provide certain behavior to an html tag. directive.js // Create the App module if you haven't created it yet va...
If the items in your RecyclerView load data from the network (commonly images) or carry out other processing, that can take a significant amount of time and you may end up with items on-screen but not fully loaded. To avoid this you can extend the existing LinearLayoutManager to preload a number of...
Download and install Visual Studio. Visual Studio can be downloaded from VisualStudio.com. The Community edition is suggested, first because it is free, and second because it involves all the general features and can be extended further. Open Visual Studio. Welcome. Go to File → New ...
Method overloading, also known as function overloading, is the ability of a class to have multiple methods with the same name, granted that they differ in either number or type of arguments. Compiler checks method signature for method overloading. Method signature consists of three things - Met...
Method overriding is the ability of subtypes to redefine (override) the behavior of their supertypes. In Java, this translates to subclasses overriding the methods defined in the super class. In Java, all non-primitive variables are actually references, which are akin to pointers to the location of...
XML is made of basic building blocks, which are: element text attributes comments processing instructions An element has angle brackets: <element/> <element>some content</element> An attribute appears in an opening element tag: <element attribute-name="...
Const ForReading = 1 Const ForWriting = 2 Const ForAppending = 8 Sub ReadTextFileExample() Dim fso As Object Set fso = CreateObject("Scripting.FileSystemObject") Dim sourceFile As Object Dim myFilePath As String Dim myFileText As String myFilePath = &...

Page 17 of 164