This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!flask/bin/python | |
from migrate.versioning import * | |
from config import SQLALCHEMY_DATABASE_URI | |
from config import SQLALCHEMY_MIGRATE_REPO | |
from app import db | |
import os.path | |
db.create_all() | |
if not os.path.exists(SQLALCHEMY_MIGRATE_REPO): | |
api.create(SQLALCHEMY_MIGRATE_REPO, 'database repository') | |
api.version_control(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.* | |
class Client_Server_Communication | |
{ | |
private static String msg = ""; | |
private static Socket socket; | |
private static ServerSocket sever; | |
static DataInputStream in; | |
static DataOutputStream out; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
public class DataStructures { | |
//declared an array of | |
Object[] orderedList = {20,45,51,78,84,91,98}; | |
int[] elems = {10,15,77,92,200}; | |
List<Integer> list = new ArrayList<Integer>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
import org.apache.commons.lang3.ArrayUtils; | |
/* | |
NB You shall need the org.apache.commons library installed on your system. | |
Get it from here or run this http://github.com/olupotd/installApache.sh script | |
like this if you are using Linux. | |
wget -c http://mirror.ucu.ac.ug/apache//commons/lang/binaries/commons-lang3-3.1-bin.tar.gz && tar -zxvf commons-lang3-3.1-bin.tar.gz | |
Go to your project properties and add it to them or just paste the jar files in your libs files in the Java Folder. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
int numb[20]; | |
int i (0), j (0), temp; | |
int main(int argc, char* argv[]) | |
{ | |
while(i < sizeof(numb)){ | |
numb[i] = i+2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int numb[8]; | |
int i, j, temp; | |
int main(int argc, char* argv[]) | |
{ | |
//populate the array | |
while(i < sizeof(numb)){ | |
numb[i] = i+2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int array[100], n, c, d, position, swap; | |
printf("Enter number of elements\n"); | |
scanf("%d", &n); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here's the algorithm for this type of sort. please implement it also | |
so that you can learn. Thanks. | |
function insertionSort(array A) | |
for i from 1 to length[A]-1 do | |
value := A[i] | |
j := i-1 | |
while j >= 0 and A[j] > value do | |
A[j+1] := A[j] | |
j := j-1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int c, first, last, middle, n, search, array[100]; | |
printf("Enter number of elements\n"); | |
scanf("%d",&n); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class Listing { | |
LinkedList ll = new LinkedList(); | |
Listing() | |
{ | |
//adding an item to the list | |
l.add(3); | |
l.add(2); |
OlderNewer