Skip to content

Instantly share code, notes, and snippets.

View insertion_sort_1_1.c
#include <stdio.h>
int main(){
int liste[] = {7, 5, 12, 1, 4, 3};
int laenge = 6;
int i, j, k, aktuellesElement;
for(i = 1; i < laenge; i++){
aktuellesElement = liste[i];
j = i;
while(j > 0 && liste[j - 1] > aktuellesElement){
View quick_sort_1_2.c
int teilen (int liste[], int links, int rechts)
{
int tauschwert;
int trenner = liste[rechts];
int i = links - 1;
for (int j = links; j <= rechts - 1; j++)
{
if (liste[j] < trenner)
{
View angular_1_4.ts
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-counter',
templateUrl: './counter.component.html',
styleUrls: ['./counter.component.scss']
})
export class CounterComponent implements OnInit {
View angular_1_3.html
<div class="counter__container">
<div class="counter__container-inner">
<h4>Counter</h4>
<div class="button-group">
<button (click)="decrement()">-</button>
<button (click)="clearCounter()">0</button>
<button (click)="increment()">+</button>
</div>
<h5>Counter: {{counter}}</h5>
</div>
View angular_1_2.scss
.counter__container {
background-color: #F0F0F0;
min-width: 100px;
margin-bottom: 20px;
.counter__container-inner {
padding: 20px;
text-align: center;
.button-group {
View angular_1_1.html
<div class="counter__container">
<div class="counter__container-inner">
<h4>Counter</h4>
<div class="button-group">
<button>-</button>
<button>0</button>
<button>+</button>
</div>
<h5>Counter: </h5>
</div>
View PHP_en_14_5_3.php
<?php
$sql = "SELECT co_date FROM os_complaints WHERE co_id = 1;";
try
{
$dbh = new PDO ("mysql:dbname=onlineshopDB; host=localhost", "user1", "abc");
$return = $dbh->query($sql);
$result = $return->fetchAll(PDO::FETCH_ASSOC);
print "Complaint date:". $result[0]['r_datum'] ."<br>\n";
$error = $dbh->errorInfo();
View PHP_en_15_2_3.php
try
{
$dbh = new PDO ("mysql:dbname=onlineshopDB; host=localhost", "user1", "abc");
$newcustomer->setCustomerNumber($dbh);
$dbh = null;
}
catch(PDOException $e)
{
View PHP_en_15_4_2.php
<?php
$sql ="SELECT c_title, c_description, c_headline, c_content FROM os_content WHERE c_id = 3;";
try
{
$dbh = new PDO ("mysql:dbname=onlineshopDB; host=localhost", "user1", "abc");
$return = $dbh->query($sql);
$result = $return->fetchAll(PDO::FETCH_ASSOC);
$meta_title = $result[0]['c_title'];
View PHP_en_15_4_1.php
<?php
$sql ="SELECT c_title, c_description, c_headline, c_content FROM os_content WHERE c_id = 2;";
try
{
$dbh = new PDO ("mysql:dbname=onlineshopDB; host=localhost", "user1", "abc");
$return = $dbh->query($sql);
$result = $return->fetchAll(PDO::FETCH_ASSOC);
$meta_title = $result[0]['c_title'];