In this tutorial, we will be discussing a program to understand how arrays are passed to functions.In the case of C/C++, the arrays are passed to a function in the form of a pointer which provides the address to the very first element of the array.Example Live Demo#include //passing array as a pointer void fun(int arr[]){ unsigned int n = sizeof(arr)/sizeof(arr[0]); printf("Array size inside fun() is %d", n); } int main(){ int arr[] = {1, 2, 3, 4, 5, 6, 7, 8}; unsigned int n = sizeof(arr)/sizeof(arr[0]); printf("Array size inside main() is %d", n); ... Read More
To workaround with display: none in an element in jQuery, use the hide() method. It will do the same work.ExampleYou can try to run the following code to learn how to add display:none in an HTML element −Live Demo $(document).ready(function(){ $("button").click(function(){ $("p").removeAttr("style").hide(); }); }); Heading 1 This is demo text. This will hide on button click. This is another text. This will hide on button click Hide
To toggle a div visibility in jQuery, use the toggle() method. It checks the div element for visibility i.e. the show() method if div is hidden. And hide() id the div element is visible. This eventually creates a toggle effect.The toggle( speed, [callback]) method toggles displaying each of the set of matched elements using a graceful animation and firing an optional callback after completion.Here is the description of all the parameters used by this method −speed − A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).callback − ... Read More
jQuery error() methodThe error() method triggers the event when an element encounters an error. This method deprecated in jQuery 1.8.ExampleYou can try to run the following code to learn how to work with error() method in jQuery −Live Demo $(document).ready(function(){ $("img").error(function(){ $("img").replaceWith("Image isn't loading"); }); $("button").click(function(){ $("img").error(); }); }); Error event jQuery ajaxError() methodThe ajaxError( callback ) method attaches a function to be executed whenever an AJAX request fails. This is an ... Read More
To use multiple js files, use the same getScript(), which is used to add a single js file. We’re having result.js file with the following code snippet −function CheckJS(){ alert("This is JavaScript - File1"); }We’re having result2.js file with the following code snippet −function CheckJS(){ alert("This is JavaScript – File2"); }ExampleHere's the code snippet to add multiple js files. Here, we will call the function in the above 2 js files − $(document).ready(function() { ... Read More
To detect the eventType in jQuery, use the event type property. You can try to run the following code to learn how to detect eventType in jQuery −ExampleLive Demo $(document).ready(function(){ $("p").on("mouseover mouseout",function(event){ $("div").html("Event Type: " + event.type); }); }); This has mouseover and mouseout event defined. Keep your cursor to see the event type below.
With the help of following queries, we can see the list of views stored in a particular database. We are using the database named ‘query’ here.mysql> SELECT TABLE_NAME FROM information_schema.`TABLES` WHERE TABLE_TYPE LIKE'view' AND TABLE_SCHEMA LIKE 'query'; +-----------------------------+ | TABLE_NAME | +-----------------------------+ | customer_view | | first_view | | info | | info_less | | view_detail ... Read More
The @JsonProperty annotation can be used to indicate the property name in JSON. This annotation can be used for a constructor or factory method. The @JsonCreator annotation is useful in situations where the @JsonSetter annotation cannot be used. For instance, immutable objects do not have any setter methods, so they need their initial values injected into the constructor.@JsonProperty - ConstructorExampleimport com.fasterxml.jackson.annotation.*; import java.io.IOException; import com.fasterxml.jackson.databind.*; public class JsonCreatorTest1 { public static void main(String[] args) throws IOException { ObjectMapper om = new ObjectMapper(); String jsonString = "{\"id\":\"101\", \"fullname\":\"Ravi Chandra\", \"location\":\"Pune\"}"; System.out.println("JSON: " + jsonString); ... Read More
In SAP HANA, you don’t have a concept of creating multiple databases in one container. To create a separate container for your database objects, you can create the schema in HANA db.To create a schema, you can use below SQL query −CREATE SCHEMA schema nameYou can also define as owner name while defining a schema.CREATE SCHEMA [OWNED BY ]If it is not defined, the system takes the current user as the owner of the schema.
In SAP HANA, geospatial data types are not defined as such and you need to use scalar values like a.ST_X().You can create a table like this −CREATE COLUMN TABLE MYSCHEMA.SpatialShapes_GEOMETRIES ( ShapeID integer, SHAPE1 ST_Point, SHAPE2 ST_GEOMETRY );SAP provides a complete guide to handle Geospatial data in applications. You can refer this link for more details:https://help.sap.com/doc/PRODUCTION/9db42d044f8e415180d4a4475873b50a/2.0.00/en-US/SAP_HANA_Spatial_Reference_en.pdf
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP