test udf functions
This file contains hidden or 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> | |
#include <unordered_map> | |
using namespace std; | |
int main(){ | |
unordered_map<int, int> h; | |
for(long i=0;; i++) | |
{ | |
try{ | |
h[i]=i; |
This file contains hidden or 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 <string.h> | |
#include <algorithm> | |
#include <cstring> | |
#include <iostream> | |
#include <string> | |
#include <unordered_map> | |
#include <utility> | |
#include <vector> |
This file contains hidden or 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
CREATE TABLE Students | |
(sid CHAR(20), | |
name CHAR(20) NOT NULL, | |
login CHAR(10), | |
age INTEGER, | |
gpa REAL Default 0, | |
Constraint pk Primary Key (sid), | |
Constraint u1 Unique (login), | |
Constraint gpaMax check (gpa <= 4.0) ); |
This file contains hidden or 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> | |
#include <unordered_map> | |
#include <string> | |
#include <algorithm> | |
using namespace std; | |
static unordered_map<string, int> lookup; | |
// Function to find the length of the longest common subsequence of |
This file contains hidden or 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
PG_FUNCTION_INFO_V1(addTen); | |
Datum addTen(PG_FUNCTION_ARGS) { | |
int32 i; | |
FuncCallContext *funcctx; | |
int call_cntr; | |
int max_calls; | |
// Code executed only on first call of the function | |
if (SRF_IS_FIRSTCALL()) { | |
MemoryContext oldcontext; |
This file contains hidden or 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
-- correct but not for mysql | |
SELECT s.sid,s.lname, s.fname | |
FROM course c, student s, enrolled e | |
where c.cid=e.cid and e.sid=s.sid and c.`name`='network' | |
Intersect ( | |
SELECT s.sid,s.lname, s.fname | |
FROM course c, student s, enrolled e | |
where c.cid=e.cid and e.sid=s.sid and c.`name`='database'); | |
-- version 1 |
This file contains hidden or 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
/* | |
* Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions | |
* are met: | |
* | |
* - Redistributions of source code must retain the above copyright | |
* notice, this list of conditions and the following disclaimer. | |
* |
This file contains hidden or 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> | |
#include <unistd.h> | |
int main() { | |
pid_t ChildID; | |
ChildID = fork(); // check for Fork | |
if (ChildID >= 0) // fork sucess | |
{ | |
if (ChildID == 0) // Code Of Child which the value will be 0 in | |
// case of Child code | |
{ |
This file contains hidden or 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.IOException; | |
import java.io.PrintWriter; | |
import java.net.ServerSocket; | |
import java.net.Socket; | |
import java.util.Date; | |
public class Server { | |
public static void main(String[] args) throws IOException { | |
//Wait on port | |
try (ServerSocket listener = new ServerSocket(1090)) { |
NewerOlder