Tutorial by Examples: er

Create an application heroku create your-app-name Deploy to Heroku git push heroku master Open your application in a browser heroku open your-app-name List Heroku commands heroku commands General help heroku help Help for a specific command heroku help <command>
When implementing more than one interface that have methods of the same name that include default implementations, it is ambiguous to the compiler which implementation should be used. In the case of a conflict, the developer must override the conflicting method and provide a custom implementation. ...
x = np.arange(4) x #Out:array([0, 1, 2, 3]) scalar addition is element wise x+10 #Out: array([10, 11, 12, 13]) scalar multiplication is element wise x*2 #Out: array([0, 2, 4, 6]) array addition is element wise x+x #Out: array([0, 2, 4, 6]) array multiplication is element wise x...
Notation As of jQuery 3.0, only this form is recommended: jQuery(function($) { // Run when document is ready // $ (first argument) will be internal reference to jQuery // Never rely on $ being a reference to jQuery in the global namespace }); All other document-ready handlers are depr...
$(element).hide() // sets display: none $(element).show() // sets display to original value $(element).toggle() // toggles between the two $(element).is(':visible') // returns true or false $('element:visible') // matches all elements that are visible $...
If an object is defined with static, thread, or automatic storage duration, and it has a character type, either: char, unsigned char, or signed char, it may not be accessed by a non-character type. In the below example a char array is reinterpreted as the type int, and the behavior is undefined on e...
jQuery offers a variety of methods that can be used for DOM manipulation. The first is the .empty() method. Imagine the following markup: <div id="content"> <div>Some text</div> </div> By calling $('#content').empty();, the inner div would be removed. This...
JavaScript has four different equality comparison operations. SameValue It returns true if both operands belong to the same Type and are the same value. Note: the value of an object is a reference. You can use this comparison algorithm via Object.is (ECMAScript 6). Examples: Object.is(1, 1); ...
git fetch git reset --hard origin/master Beware: While commits discarded using reset --hard can be recovered using reflog and reset, uncommitted changes are deleted forever. Change origin and master to the remote and branch you want to forcibly pull to, respectively, if they are named different...
Server side: import socket serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) serversocket.bind(('localhost', 8089)) serversocket.listen(5) # become a server socket, maximum 5 connections while True: connection, address = serversocket.accept() buf = connection.recv(6...
EXPOSE <port> [<port>...] From Docker's documentation: The EXPOSE instruction informs Docker that the container listens on the specified network ports at runtime. EXPOSE does not make the ports of the container accessible to the host. To do that, you must use either the -p flag to ...
The notation 'thing is equal to (quote thing). The reader will do the expansion: > (read-from-string "'a") (QUOTE A) Quoting is used to prevent further evaluation. The quoted object evaluates to itself. > 'a A > (eval '+ 1 2) 3
docker exec -it <container id> /bin/bash It is common to log in an already running container to make some quick tests or see what the application is doing. Often it denotes bad container use practices due to logs and changed files should be placed in volumes. This example allows us log in the...
Eloquent also lets you query on defined relationships, as show below: User::whereHas('articles', function (Builder $query) { $query->where('published', '!=', true); })->get(); This requires that your relationship method name is articles in this case. The argument passed into the clos...
It is possible to mount a host directory to a specific path in your container using the -v or --volume command line option. The following example will mount /etc on the host to /mnt/etc in the container: (on linux) docker run -v "/etc:/mnt/etc" alpine cat /mnt/etc/passwd (on windows) do...
Usage: docker logs [OPTIONS] CONTAINER Fetch the logs of a container -f, --follow=false Follow log output --help=false Print usage --since= Show logs since timestamp -t, --timestamps=false Show timestamps --tail=all Number o...
Example Application-extending class for handling the reporting: @ReportsCrashes( formUri = "https://backend-of-your-choice.com/",//Non-password protected. customReportContent = { /* */ReportField.APP_VERSION_NAME, ReportField.PACKAGE_NAME,ReportField.ANDROID_VERSION, R...
This will show the user location on the map Objective-C [self.map setShowsUserLocation:YES]; Swift self.map?.showsUserLocation = true This will track the user location on the map, updating regions according Objective-C [self.map setUserTrackingMode:MKUserTrackingModeFollow]; Swift s...
Since C++14, the standard provides the class template template <class T, T... Ints> class integer_sequence; template <std::size_t... Ints> using index_sequence = std::integer_sequence<std::size_t, Ints...>; and a generating metafunction for it: template <class T, T N&g...
The array_intersect function will return an array of values that exist in all arrays that were passed to this function. $array_one = ['one', 'two', 'three']; $array_two = ['two', 'three', 'four']; $array_three = ['two', 'three']; $intersect = array_intersect($array_one, $array_two, $array_thre...

Page 52 of 417