PageRenderTime 56ms CodeModel.GetById 27ms RepoModel.GetById 1ms app.codeStats 0ms

/Programadores/DBCola/Final_Coding/insert_info_repo.php

https://github.com/iptomar/codematch_11-12
PHP | 255 lines | 227 code | 9 blank | 19 comment | 2 complexity | b8b27a30f853b34d84c7bd9d31213aa1 MD5 | raw file
  1. <?php
  2. require_once('../phpcassa/connection.php');
  3. require_once('../phpcassa/columnfamily.php');
  4. include_once('../phpcassa/uuid.php');
  5. $conn = new Connection('DBCola');
  6. //select databases
  7. $column_hello= new ColumnFamily($conn,'helloworld');
  8. $lang='C#';
  9. $helloo='<%@ Page Language="C#" %><br>
  10. <% Response.write("Hello World!"); %>';
  11. $lang= array( 1 =>'Asp(C#)',2=>'BATCH',3=>'C',4=>'ActionScript',5=>'ADA',6=>'AspectJ',7=>'Assembly',8=>'autoIt',9=>'awk',10=>'bash',11=>'C++',12=>'C#',13=>'Caml',
  12. 14=>'CUDA',15=>'CSS',16=>'COBOL',17=>'D',18=>'DIFF',19=>'Erlang',20=>'Fortran',21=>'Groovy',22=>'Haskell',23=>'HTML',24=>'InnoSetup',25=>'Java'
  13. ,26=>'JavaScript',27=>'JSP',28=>'KiXtart',29=>'LISP',30=>'Lua',31=>'Matlab',32=>'NSIS',33=>'Objective-C',34=>'Pascal',35=>'Perl',36=>'Php',37=>'Portugol'
  14. ,38=>'Postscript',39=>'PowerShell',40=>'Python',41=>'R',42=>'RC',43=>'Ruby',44=>'Scheme',45=>'Smaltalk',46=>'SQL',47=>'TCL',48=>'LaTeX'
  15. ,49=>'VB/VBS',50=>'Verilog',51=>'VHDL',52=>'XML',53=>'YAML');
  16. $converted_array = array_map("strtoupper", $lang);
  17. $helloo= array( 1 =>'<%@ Page Language="C#" %><br><% Response.write("Hello World!");%>',2=>'@echo Hello World!',3=>'#include <stdio.h><br>main()<br>{<br>printf ("Hello World!\n");<br>}',4=>'trace ("Hello World!")',5=>'with Ada.Text_IO; <br>
  18. procedure helloWorld is<br>
  19. begin<br>
  20. Ada.Text_IO.Put_Line("Hello World!"); <br>
  21. Ada.Text_IO.New_Line; <br>
  22. end helloWorld;
  23. ',6=>'public aspect HelloFromAspectJ {<br>
  24. pointcut mainMethod() : execution(public static void main(String[]));<br>
  25. after() returning : mainMethod() {<br>
  26. System.out.println("Hello World!"); <br>
  27. }<br>
  28. }<br>
  29. ',7=>'variable: <br>
  30. .message db "Hello World!$" <br>
  31. code: <br>
  32. mov ah, 9<br>
  33. mov dx, offset .message<br>
  34. int 0x21<br>
  35. ret<br>
  36. ',8=>'MsgBox(0, "Tutorial", "Hello World!") <br>',9=>'BEGIN { print "Hello World!" }<br>',10=>'#!/bin/bash <br>
  37. echo Hello World! <br>
  38. ',11=>'#include <iostream><br>
  39. using namespace std; <br>
  40. int main()<br>
  41. {<br>
  42. cout << "Hello World!" << endl; <br>
  43. return 0; <br>
  44. }<br>
  45. ',12=>'using System; <br>
  46. namespace HelloWordApplication<br>
  47. {<br>
  48. class HelloWorldApp<br>
  49. {<br>
  50. public static void Main()<br>
  51. {<br>
  52. Console.WriteLine("Hello World!"); <br>
  53. }<br>
  54. }<br>
  55. }<br>
  56. ',13=>'print_string "Hello world!\n";<br>',14=>"#include <cuda.h><br>
  57. #include <stdio.h><br>
  58. __global__ void helloWorld(char*);<br>
  59. // Host function<br>
  60. int<br>
  61. main(int argc, char** argv) <br>
  62. {<br>
  63. int i; <br>
  64. // desired output<br>
  65. char str[] = 'Hello World!'; <br>
  66. // mangle contents of output<br>
  67. // the null character is left intact for simplicity<br>
  68. for(i = 0; i < 12; i++)<br>
  69. str[i] -= i; <br>
  70. // allocate memory on the device<br>
  71. char *d_str; <br>
  72. size_t size = sizeof(str); <br>
  73. cudaMalloc((void**)&d_str, size); <br>
  74. // copy the string to the device<br>
  75. cudaMemcpy(d_str, str, size, cudaMemcpyHostToDevice); <br>
  76. // set the grid and block sizes<br>
  77. dim3 dimGrid(2); // one block per word<br>
  78. dim3 dimBlock(6); // one thread per character<br>
  79. // invoke the kernel<br>
  80. helloWorld<<< dimGrid, dimBlock >>>(d_str); <br>
  81. // retrieve the results from the device<br>
  82. cudaMemcpy(str, d_str, size, cudaMemcpyDeviceToHost); <br>
  83. // free up the allocated memory on the device<br>
  84. cudaFree(d_str); <br>
  85. // everyone's favorite part<br>
  86. printf('%s\n', str); <br>
  87. return 0; <br>
  88. }<br>
  89. // Device kernel<br>
  90. __global__ void<br>
  91. helloWorld(char* str) <br>
  92. {<br>
  93. // determine where in the thread grid we are<br>
  94. int idx = blockIdx.x * blockDim.x + threadIdx.x; <br>
  95. // unmangle output<br>
  96. str[idx] += idx; <br>
  97. }<br>
  98. ",15=>'<html><br>
  99. <head><br>
  100. <style type="text/css"><br>
  101. #id1 {<br>
  102. font-size : 2em; <br>
  103. color : red; <br>
  104. }<br>
  105. .class1 { color : blue; }<br>
  106. </style><br>
  107. </head><br>
  108. <body><br>
  109. <div class="class1"><span id="id1"></span><br>
  110. Hello World! <br>
  111. </div><br>
  112. </body><br>
  113. </html><br>
  114. ',16=>'IDENTIFICATION DIVISION. <br>
  115. PROGRAM-ID. HELLO-WORLD. <br>
  116. ENVIRONMENT DIVISION. <br>
  117. DATA DIVISION. <br>
  118. PROCEDURE DIVISION<br>.
  119. DISPLAY "Hello World!". <br>
  120. STOP RUN. <br>
  121. ',17=>'import std.c.stdio<br>;
  122. void main()<br>
  123. {<br>
  124. printf("Hello World!\n");<br>
  125. }<br>
  126. ',18=>"echo 'Hello World!'<br>",19=>'module(hello). <br>
  127. export([hello_world/0]). <br>
  128. hello_world() -> io:fwrite("hello, world\n").<br>
  129. ',20=>"HELLO<br>
  130. WRITE(*,10) <br>
  131. 10 FORMAT('Hello World!') <br>
  132. STOP<br>
  133. END<br>
  134. ",21=>'println "hello, world"<br>
  135. for (arg in this.args ) {<br>
  136. println "Argument:" + arg; <br>
  137. }<br>
  138. /* a block comment, commenting out an alternative to above: <br>
  139. this.args.each{ arg -> println "hello, ${arg}"}<br>
  140. */<br>
  141. ',22=>'main = putStrLn "Hello World!" <br>',23=>'<HTML><br>
  142. <!-- Hello World in HTML --><br>
  143. <HEAD><br>
  144. <TITLE>Hello World!</TITLE><br>
  145. </HEAD><br>
  146. <BODY><br>
  147. Hello World! <br>
  148. </BODY><br>
  149. </HTML><br>
  150. ',24=>'echo Hello World! <br>',25=>'public class Hello {<br>
  151. public static void main(String[] args) {<br>
  152. System.out.println("Hello World!"); <br>
  153. }<br>
  154. }<br>
  155. ',26=>'document.write("Hello World!"); <br>',27=>'<html><br>
  156. <head><title>Hello World JSP Page.</title></head><br>
  157. <body><br>
  158. <font size="10"><%="Hello World!" %></font><br>
  159. </body><br>
  160. </html><br>
  161. ',28=>'Kix code here<br>
  162. "Hello World!" <br>
  163. ',29=>"(print 'Hello World!') <br>",30=>"print'Hello World!' <br>",31=>"<<hello_world.m>>=fprintf('Hello world!\n'); <br>",32=>"outfile 'hello world.exe'<br>
  164. section<br>
  165. messageBox MB_OK 'Hello World!' <br>
  166. sectionEnd<br>
  167. ",33=>"#import <stdio.h><br>
  168. int main( int argc, const char *argv[] ) {<br>
  169. printf( 'hello world\n' ); <br>
  170. return 0; <br>
  171. }<br>
  172. ",34=>"program OlaMundo(output); <br>
  173. begin<br>
  174. WriteLn('Hello World!'); <br>
  175. end. <br>
  176. ",35=>"print 'Hello World!'; <br>",36=>'<?php<br>
  177. echo Hello World!"; <br>
  178. ?> <br>
  179. ',37=>"algoritmo OlaMundo<br>
  180. inicio<br>
  181. escreva('Hello World!') <br>
  182. fim<br>
  183. ",38=>'<<HelloWorld.ps>>=<br>
  184. %!PS<br>
  185. % set up font: <br>
  186. /mainfont /Helvetica findfont 32 scalefont def mainfont setfont<br>
  187. % Move point to specific location<br>
  188. 225 450 moveto<br>
  189. % Print text on page<br>
  190. (Hello World!) show<br>
  191. % Show results by printing or other method showpage<br>
  192. ',39=>"strString = 'Hello World!' <br>
  193. write-host strString<br>
  194. ",40=>"print('Hello World!') <br>",41=>"at('Hello World!\n')<br>",42=>"StringWriter writer = new StringWriter();<br>
  195. Sequence wf = new Sequence<br>
  196. {<br>
  197. Activities = {<br>
  198. new WriteLine {Text = 'Hello', TextWriter = writer},<br>
  199. new WriteLine {Text = 'World', TextWriter = writer}<br>
  200. }<br>
  201. };<br>
  202. WorkflowInvoker.Invoke(wf); <br>
  203. ",43=>"def show_me<br>
  204. puts 'Hello World'<br>
  205. end<br>",
  206. 44=>"(display 'Hello World!') <br>
  207. (newline) <br>
  208. ",45=>"Transcript show: 'Hello World!'. <br>",46=>"SELECT 'Hello World!' <br>",47=>"puts 'Hello World!' <br>",48=>'\documentclass[12pt]{article}<br>
  209. \begin{document}<br>
  210. Hello World! <br>
  211. $Hello world!$ %math mode<br>
  212. \end{document}<br>
  213. ',49=>"Private Sub Form_Load()<br>
  214. Print 'Hello World!' <br>
  215. End Sub<br>
  216. ",50=>"module hello_world ; <br>
  217. initial begin<br>
  218. display ('Hello World!'); <br>
  219. #10 finish; <br>
  220. end<br>
  221. endmodule <br>
  222. ",51=>"entity hello_world is<br>
  223. end; <br>
  224. architecture hello_world of hello_world is<br>
  225. begin<br>
  226. stimulus : process<br>
  227. begin<br>
  228. assert false report 'Hello World!' <br>
  229. severity note; <br>
  230. wait; <br>
  231. end process stimulus; <br>
  232. end hello_world; <br>
  233. ",52=>"<?xml version='1.0' encoding='UTF-8'?><br>
  234. <text><br>
  235. <para> Hello World!</para><br>
  236. </text><br>
  237. ",53=>"print 'Hello World!' <br>");
  238. $counter = count($lang);
  239. for ($i = 1; $i <= $counter; $i++ ){
  240. $column_hello-> insert($converted_array[$i],array("code" => $helloo[$i]));
  241. //$column_hello->remove($lang[$i]);
  242. }
  243. $aux=$column_hello->get('RUBY');
  244. print_r($aux);
  245. //print_r($helloo);
  246. ?>