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
| using Newtonsoft.Json; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.IO; | |
| namespace JsonEsimerkki | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) |
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
| # Require https://github.com/PyGithub/PyGithub | |
| from github import Github | |
| from github.NamedUser import NamedUser | |
| # Global variables to change when script is executed. | |
| # List of github users to invite. Separated with commas. | |
| github_usernames_to_invite = "username1,username2,username3" |
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
| -- Sinun esimerkki | |
| select title, description, rental_duration, rental_rate, length, rating, name as genre | |
| from film | |
| left join film_category on film.film_id = film_category.film_id | |
| left join category on category.category_id = film_category.category_id | |
| order by title; | |
| -- Sinun esimerkki ALIAS käyttäen | |
| select taulu1.film_id, title, description, rental_duration, rental_rate, length, rating, name as genre | |
| from film taulu1 |
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
| // Jos HTML lomake lähetetään seuraavaalla tavalla POST tyyppisenä niin | |
| // sen mukana tulee type="image" vuoksi pari ylimääräistä tietoa. | |
| // Koska tässä kentän nimi on "submit" niin lomakkeen mukana tulee kentät | |
| // submit.x ja submit.y | |
| // Kentät muodostuvat sen vuoksi, että input-elemnetin tyyppinä on "image". | |
| <input type="image" name="submit" src="https://payment.checkout.fi/static/img/danskebank_140x75.png" title="Danske Bank" alt="Submit" class="provider-button hover01 col-xs-6" /> | |
| // Edellisen tilanteen voi korjata esimerkiksi muuttamalla hieman lomakkeen |
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
| #!/bin/bash | |
| # Script will create new user account for Wordpress sites created with | |
| # wp.sh script. | |
| # ======================= | |
| # Define global variables | |
| # ======================= | |
| CURRENT_DIR=$(pwd) |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Data.SqlClient; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using MySql.Data.MySqlClient; | |
| namespace ConsoleApp1 | |
| { |
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
| #!/bin/bash | |
| # Script to install multiple Wordpress instances into single web server. | |
| # | |
| # TODO: If using bitnami lamp stack, disable pagespeed module because can confuse students when js/css files are cached. | |
| # https://docs.bitnami.com/bch/apps/wordpress/administration/use-pagespeed/ | |
| # | |
| # REQUIREMENTS | |
| # | |
| # LAMP environment installed. Script is tested with Bitnami LAMP stack. |
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
| // Luodaan Person niminen luokka. | |
| class Person | |
| { | |
| // Luokalla on kaksi ominaisuutta (property). | |
| // Nimi ja ikä. | |
| public string Name { get; set; } | |
| public int Age { get; set; } |
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
| using System; | |
| using System.Globalization; | |
| namespace Ajankasittelya | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| Console.WriteLine("DateTime -esimerkkejä\n\n"); |
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
| // Sinun esimerkkisi muutamilla huomioilla. Alla sitten | |
| // toinen esimerkki lisävinkeillä. | |
| public static int Laske(string value) { | |
| // Tässä tarkistat tyhjän syötteen, se on oikein. | |
| if (value == "") return 0; | |
| // Alustat sum -muuttujan nollaksi ennen foreach | |
| // toistolauseketta ja sekin oikein. | |
| var sum = 0; | |
| // Foreach yhteydessä käytät Split metodia joka pilkkoo | |
| // annetun merkkijonon näillä haluamallasi erottimilla. |
NewerOlder