How Arrays Are Passed to Functions in C/C++

Ayush Gupta
Updated on 17-Feb-2020 10:09:38

190 Views

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

Add Display None in an HTML Element Using jQuery

David Meador
Updated on 17-Feb-2020 10:05:49

4K+ Views

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

Toggle DIV Visibility Using jQuery

David Meador
Updated on 17-Feb-2020 10:04:26

8K+ Views

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

Difference Between error and ajaxError Events in jQuery

David Meador
Updated on 17-Feb-2020 09:56:32

300 Views

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

Include Multiple JS Files Using jQuery getScript Method

David Meador
Updated on 17-Feb-2020 09:54:08

723 Views

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

Detect Event Type in jQuery

David Meador
Updated on 17-Feb-2020 09:48:11

197 Views

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.

List of Views in a MySQL Database

Chandu yadav
Updated on 17-Feb-2020 08:54:10

215 Views

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

Deserialize JSON String Using @JsonCreator Annotation in Java

raja
Updated on 17-Feb-2020 08:18:20

1K+ Views

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

Create Multiple Databases in SAP HANA System

Monica Mona
Updated on 17-Feb-2020 08:16:55

442 Views

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.

Use of SPATIAL Function in SAP HANA

Lakshmi Srinivas
Updated on 17-Feb-2020 08:11:42

289 Views

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

Advertisements