C Programming Tutorial auto double int struct break else long switch case enum register typedef char extern return union continue for signed void do if static while default goto sizeof volatile const float short unsigned
Author Archives: dathoang
/*———- C Scanf Sample Program ——-*/ main() { int number; printf(“Enter an integer number\n”); scanf(“%d”, &number;); if( number <100 ){ printf(“Your number is smaller than 100\n\n”); } else { printf(“Your number is greater than 100\n\n””); } } Output Enter an integer number 90 Your number is smaller than 100 Enter an integer number 155 Your […]
Get the selected checkbox value from the group of checkbox list in Javascript. I wrote one function to return the selected checkbox value in Javascript. <script type=’text/javascript> // Java Script function to return the selected checkbox value function Checkbox_Selection_Value_From_Group (){ fileid= $(\”input[name=’filegroup[]’]:checked\”).map(function() { return this.value; }).get(); if(fileid==”){ alert(‘Select Minimum One Check Box’); return false; }else{ […]
This is the sample post of randomize array concept in javascript; In the below example i will show you to randomize an array using its position in java script. var _arrayOne=[1,2,3,4,5,6,7]; var _arrayTwo=[27,26,24,23,29,28,25]; var _randArrayOne=[]; var _randArrayTwo=[]; function random(){ document.write(“Before Randomize”); document.write(‘\n’); document.write(_arrayOne); document.write(‘\n’); document.write(_arrayTwo); document.write(‘\n’); for(var i=0; i < 7; i++) { var _random […]
ASSIGN REDIRECT URL REDIECT TO GO BACK WINDOW NAVIGATION WINDOW LOCATION REPLACE I added the code to redirect the page using javascript ASSIGN REDIRECT URL <script language=”javascript” type=”text/javascript”> window.location.href=REDIRECTURL; //or window.location=REDIRECTURL; </script> REDIECT TO GO BACK <script language=”javascript”> alert(“Go Back”); window.history.back(-1); </script> WINDOW NAVIGATION <script language=”javascript”> window.navigate(REDIRECTURL); </script> WINDOW LOCATION REPLACE <script language=”javascript”> window.location.replace(REDIRECTURL); </script>
Get Url(domain) parameter using jquery function. In below code, I wrote one function called getUrlVars(). Using this function you can get requesting parameter value. If parameter not found., It will return undefined response It was working for me good. var ID= getUrlVars()[“id”]; if(ID==undefined){ ID=”; } function getUrlVars() { var vars = {}; var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, […]
In this post, We will learn How to create a collection in MongoDB. MongoDB is stored in the format of documents and Documents are stored in the collection. Collections are stored in the database. Collections is a group of MongoDB documents like a table. MONGO DATABASE > COLLECTIONS > DOCUMENTS We can create collections in […]
This post will help you to create and learn about a database in MongoDB. In the mongo shell, using `use DATABASE_NAME` command, We can create a MongoDB. `use ` command will do the below actions. 1) will create a new database If a database does not exist 2) will switch to the database If the […]
MongoDB stores the documents as BSON documents. BSON means, it is encoded binary format of JSON. BSON is providing the many data types to store the javascript objects into mongo collection. MongoDB supports the all type of BSON data types. You can get the list of BSON data types Which is supported by mongo db. […]
In this post, We will learn How to delete a collection from MongoDB. MongoDB shell command `db.collection.drop()` is used to drop the specified collection from the selected DB. Also, It will remove all the documents and indexes associated with the dropped collection. Syntax: db.collection_name.drop() Drop Query Response: It will return `true` when successfully drops a […]