Repair MySQL Tables from the Command Line

Chandu yadav
Updated on 30-Jul-2019 22:30:23

334 Views

The repair of MySQL tables is only applicable to MyISAM engine type, not for InnoDB. Therefore, we need to change the Engine type to MyISAM. The following is an example. Creating a table mysql> create table RepairTableDemo -> ( -> id int, -> name varchar(100) -> ); Query OK, 0 rows affected (0.51 sec) To convert this table to engine type MyISAM, use ALTER. mysql> ALTER TABLE RepairTableDemo ENGINE = MyISAM; Query OK, 0 rows affected (1.14 sec) Records: 0 Duplicates: 0 Warnings: ... Read More

Print Multiples of N Without Using Any Loop in Python

karthikeya Boyini
Updated on 30-Jul-2019 22:30:23

273 Views

Given a number n, print m multiplies of n without using any loop. Here we use recursive function. Examples Input: n = 15 Output: 15 10 5 0 5 10 15 Algorithm Step 1: Given n. Step 2: If we are moving back toward the n and we have reached there, then we are done. Step 3: If we are moving toward 0 or negative. Step 4: If m is greater, then 5, recursive function with true flag else recursive function is false. Step 5: If m is not greater than 5 then flag is false. ... Read More

Restore MySQL Root User Full Privileges

Arjun Thakur
Updated on 30-Jul-2019 22:30:23

2K+ Views

We can restore the MySQL root user full privileges with the help of UPDATE command. Firstly, you need to stop mysqld and restart it with the --skip-grant-tables option. After that, connect to the mysqld server with only mysql (i.e. no -p option, and username may not be required). Issue the below given command in the mysql client to restore the MySQL root user with full privileges. mysql> UPDATE mysql.user SET Grant_priv = 'Y', Super_priv = 'Y' WHERE User = 'root'; Query OK, 0 rows affected (0.04 sec) Rows matched: 1 Changed: 0 Warnings: 0 Above, ... Read More

Detect Ctrl+Enter in Textarea using jQuery

Kristi Castro
Updated on 30-Jul-2019 22:30:23

66 Views

$(document).ready(function(){ $('#myinput').keydown(function(e) { var newkey = 'Key code = ' + e.which + ' ' + (e.ctrlKey ? 'Ctrl' : '') + ' ' + (e.shiftKey ? 'Shift' : '') + ' ' + (e.altKey ? 'Alt' : ''); $('#mykey').text(newkey); return false; }); });

Enqueue and Dequeue in Queue Class in C#

karthikeya Boyini
Updated on 30-Jul-2019 22:30:23

943 Views

Queue collection class is a concept in C# that is included in the System.Collection namespace. The elements are stored in a QUEUE in FIFO. The first element added will be the first to go out like a queue of people outside a movie hall to buy tickets. It has two methods. Enqueue() method to add values Dequeue() method to retrieve values Enqueue Add items in the queue. Queue q = new Queue(); q.Enqueue(“Two”); q.Enqueue(“One”); Dequeue Return items from the queue. Queue q = new Queue(); q.Enqueue(“Two”); q.Enqueue(“One”); // remove elements while (q.Count > 0) ... Read More

Check Internet Connection in Android

Chandu yadav
Updated on 30-Jul-2019 22:30:23

3K+ Views

This example demonstrate about how to check the state of internet connection through broadcast Receiver.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − To find the internet status we have to add network state permission to AndroidManifest.xml file as shown below.                                                                     Step ... Read More

Events vs Delegates in C#

Arjun Thakur
Updated on 30-Jul-2019 22:30:23

544 Views

C# events are used to resolve the hassles in Delegates. One an easily override Delegate properties and that can eventually lead to errors in the code. To avoid this, C# uses Events and defines wrappers around Delegates. Events in C# To use Event, you should define delegate first. Event is a type of Delegate and an example of event can be when a key is pressed. public delegate voide Demo(String val); public event Test TestEvent; An event can hold a delegate like this. this.TestEvent += new Demo (DemoData); ... Read More

Zip Function in Python to Change to a New Character Set

Samual Sam
Updated on 30-Jul-2019 22:30:23

155 Views

Given a 26 letter character set, here we are using a new character set. And another character set just like alphabet set (a, b, c........z), then our task is to make a relation between new character set and that alphabet set. Example New character set: qwertyuiopasdfghjklzxcvbnm Input: "wwmm" Output: bbzy Algorithm Step 1: Given a new character set and input the string to make a relation. Step 2: and the original character set also given below. Step 3: Create a dictionary, we use here map technique, we map the English character set and new given character set, ... Read More

Create Circular ImageView in Android

George John
Updated on 30-Jul-2019 22:30:23

1K+ Views

This example demonstrate about how to Create CircularImageView in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 −To make circler view, we should add CircularImageView library in gradle file as shown below.apply plugin: 'com.android.application' android {    compileSdkVersion 28    defaultConfig {       applicationId "com.example.andy.myapplication"       minSdkVersion 15       targetSdkVersion 28       versionCode 1       versionName "1.0"       testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"    }    buildTypes {       release ... Read More

Counters in C#

Ankith Reddy
Updated on 30-Jul-2019 22:30:23

2K+ Views

Counters in C# are performance counters that lets you know about your applications performance. When you will build an application, whether it is a web app, mobile app or even desktop app, you would definitely need to monitor the performance. For performance counters in C#, use the System.Diagnostics.PerformanceCounter class. Set the instance of the PerformanceCounter class and work with the following properties: CategoryName, CounterName, MachineName and ReadOnly. To get the performance categories. var counter = PerformanceCounterCategory.GetCategories(); Now SET performance counters for the category processor. var counter = PerformanceCounterCategory.GetCategories() .FirstOrDefault(category => category.CategoryName == "Processor");

Advertisements