İÇERİK


Yazılım Geliştirici
İÇERİK
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Random rastgele = new Random();
int sayi = rastgele.Next(100);
int sayac = 1;
while (true)
{
Console.WriteLine("Tahmin girin: ");
int tahmin = Convert.ToInt32(Console.ReadLine());
if (tahmin > sayi)
{
Console.WriteLine("Tahminin büyük");
}
else if (tahmin < sayi)
{
Console.WriteLine("Tahmin küçük");
}
else
{
Console.WriteLine("Tebrikler, {0} tahminde bildin.", sayac);
break;
}
sayac++;
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
while (true)
{
byte not;
Console.Write("Not Girin: ");
string notal = Console.ReadLine();
if (byte.TryParse(notal, out not))
{
if ((not >= 0) && (not <= 100))
{
if (not >= 90)
{
Console.WriteLine("Not: A1");
}
else if ((not >= 80) && (not <= 89))
{
Console.WriteLine("Not: A2");
}
else if ((not >= 75) && (not <= 79))
{
Console.WriteLine("Not: B1");
}
else if ((not >= 70) && (not <= 74))
{
Console.WriteLine("Not: B2");
}
else if ((not >= 65) && (not <= 69))
{
Console.WriteLine("Not: C1");
}
else if ((not >= 60) && (not <= 64))
{
Console.WriteLine("Not: C2");
}
else if ((not >= 55) && (not <= 59))
{
Console.WriteLine("Not: D1");
}
else if ((not >= 50) && (not <= 54))
{
Console.WriteLine("Not: D2");
}
else if ((not >= 40) && (not <= 49))
{
Console.WriteLine("Not: E");
}
else if ((not >= 0) && (not <= 39))
{
Console.WriteLine("Not: F1");
}
}
else
{
Console.WriteLine("\nNotlar 0-100 aralığında olmalıdır.\nTekrar girin: ");
continue;
}
Console.WriteLine("\nDevam etmek istiyor musunuz? (E/H)");
string devam = Console.ReadLine();
if ((devam == "E") || (devam == "e"))
{
Console.Write("\n");
continue;
}
else
{
break;
}
}
else
{
Console.WriteLine("Notlar 0-100 aralığında olmalıdır.\n");
}
}
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace odev1
{
class Program
{
static void Main(string[] args)
{
int a, b;
string a1, a2;
Console.Write("İlk sayıyı girin: ");
a1 = Console.ReadLine();
while (true)
{
if (int.TryParse(a1, out a))
{
break;
}
else
{
Console.Write("İlk sayı için geçerli değer girilmedi. Tekrar girin: ");
a1 = Console.ReadLine();
}
}
Console.Write("İkinci sayıyı girin: ");
a2 = Console.ReadLine();
while (true)
{
if (int.TryParse(a2, out b))
{
break;
}
else
{
Console.Write("İkinci sayı için geçerli değer girilmedi. Tekrar girin: ");
a2 = Console.ReadLine();
}
}
Console.WriteLine("\nİlk sayı: " + a);
Console.WriteLine("İkinci sayı: " + b);
Console.WriteLine("Toplamı: " + (a + b));
}
}
}
C# ile kullanıcıdan yarıçapı isteyip dairenin alan ve çevresini hesaplatma formülü
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace deneme
{
class Program
{
static void Main(string[] args)
{
// PI'yi sabitle
const double PI = 3.14;
double yaricapi, alan, cevre;
Console.Write("Dairenin yarı çapını giriniz:");
// kullanıcıdan yarıçapı iste
yaricapi = Convert.ToDouble(Console.ReadLine());
// alanı hesapla
alan = PI * yaricapi * yaricapi;
// çevreyi hesapla
cevre = 2 * PI * yaricapi;
// sonuçları ekrana yazdır
Console.WriteLine("Alan: " + alan);
Console.WriteLine("Çevre: " + cevre);
}
}
}
Bu hatayı aldığınız php dosyasının içine girip session_start(); kodunu buluyoruz ve hemen başına session_save_path(“/tmp”); ekliyoruz ve bir de bakmışsınız sorununuz çözülmüş 🙂
mysqlcheck – -all-databases -r #repair
mysqlcheck – -all-databases -a #analyze
mysqlcheck – -all-databases -o #optimize
bu kodları terminalde (putty üzerinden ssh’de) sırasıyla uyguladığınız zaman (buradan kopyala yapıştır yapınca sırasıyla işleme sokar) sunucunuzdaki çözülebilmeye yüzü olan tüm veritabanlarını işleme sokar ve tamamen patlamadıysa eğer veritabanınızı onarma işlemine sokar, bol şanslar.
Sunucunuza erişmesini istemediklerinize ip bloğu koymak için kullandığımız veya özellikle erişmek istediklerinizi (dışarıdan kendiniz) beyaz listeye alma gibi işlemleri terminale bağlantıktan sonra iptables aracılığıyla yapıyoruz.
Kısaca;
// bloklanmış IP'leri listelemek için; iptables -L INPUT -v -n // bloklanmış IP'yi silmek (bloğu kaldırmak) için; iptables -D INPUT -s x.x.x.x -j DROP // IP adreslerini beyaz listeye eklemek (güvenilir kılmak) için; // INPUT: girişlere, OUTPUT: çıkışlara iptables -A INPUT -s x.x.x.x -j ACCEPT iptables -A OUTPUT -s x.x.x.x -j ACCEPT
#include
void ciftArttir(int dizi[], int boyut)
{
int i;
for (i = 0; i < boyut; i++)
{
if (dizi[i] % 2 == 0)
{
dizi[i]++;
}
}
}
int main()
{
int i,sayi[6] = { 1,2,3,4,5,6 };
ciftArttir(sayi, 6);
for (i = 0; i < 6; i++)
{
printf("%d\n", sayi[i]);
}
return 0;
}
ekran çıktısı
1
3
3
5
5
7
olacaktır.
HTML Kodu
<select name="selectadi" id="selectkutuID" onchange="degergoster()">
<option value="deger1">Değer 1</option>
<option value="deger2">Değer 2</option>
<option value="deger3">Değer 3</option>
</select>
JavaScript Kodu
<script>
function degergoster() {
var selectkutu = document.getElementById('selectkutuID');
var selectkutu_value = selectkutu.options[selectkutu.selectedIndex].value;
var selectkutu_text = selectkutu.options[selectkutu.selectedIndex].text;
alert(selectkutu_value+' '+selectkutu_text);
}
</script>