Skip to content

Instantly share code, notes, and snippets.

@hasayvaz
hasayvaz / mysql.java
Last active December 14, 2015 10:08
connect to remote MySQL database with java
import java.sql.*;
public class Mysql {
public static void main(String[] args) {
System.out.println("MySQL connect example.");
Connection conn = null;
String url = "jdbc:mysql://localhost/";
String dbname = "telrehberi";
String driver = "com.mysql.jdbc.Driver";
String username = "telrehberi";
@hasayvaz
hasayvaz / mysql.py
Last active December 14, 2015 09:08
connect to remote MySQL database with pyhon
#!/usr/bin/python
# -*- coding: utf-8 -*-
import MySQLdb as may
#veritabanina baglaniyoruz
db = may.connect(host="localhost", user="telrehberi", passwd="123", db="telrehberi")
#c
@hasayvaz
hasayvaz / mysql.py
Last active December 14, 2015 07:58
#!/usr/bin/python
# -*- coding: utf-8 -*-
import MySQLdb
db = MySQLdb.Connection(host="localhost", user="abcd", passwd="123", db="telrehberi")
cur = db.cursor()
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="LibrarySetting" type="LibraryConfigUtilities.ConfigurationSectionHandler, LibraryConfigUtilities" />
</configSections>
<!-- Description,
Culture : string, valid to construct a CultureInfo object
Currency : string, ISO code of currency makes sense.
DailyPenaltyFee : Decimal, will be used in penalty fee calculation.
PenaltyAppliesAfter : int, number of days that the penalty fee will occur after.
using System;
using System.Collections.Generic;
using System.Text;
using LibraryConfigUtilities;
namespace LibraryBusiness
{
/* Description,
* settingList member holds configuration parameters stored in the App.config file,
* please explore the properties and methods in the Country class to get a better understanding.
@hasayvaz
hasayvaz / guncelleme.txt
Created July 15, 2012 20:32
19/x güncelleme metni
Depo güncelleniyor...
Uzak depo git@github.com:hasayvaz/x
Üst depo git://github.com/00010011/x
Yerel depo uzak depo ile eşzamanlanıyor...
error: unknown option `no-edit'
usage: git fetch [<options>] [<repository> [<refspec>...]]
or: git fetch [<options>] <group>
or: git fetch --multiple [<options>] [(<repository> | <group>)...]
or: git fetch --all [<options>]
@hasayvaz
hasayvaz / switch-case
Created May 18, 2012 00:20 — forked from raziyeaydin/switch_case.c
programlama
#include<stdio.h>
int main(void)
{
float ok_2;;
int ok_1, ok_3, ok_4, sayi = 2413;
ok_1 = sayi/1000;
ok_2 = (int)(sayi/100) % 10;
ok_3 = (sayi/10)%10;
ok_4 = (sayi%10);
@hasayvaz
hasayvaz / matris.c
Created April 11, 2012 18:08
iki matrisin çarpımı
#include <stdio.h>
#include <stdlib.h> // calloc ve free fonksiyonlari icin gerekli kutuphane
#define BOYUT 5 // Carpimi bulunacak kare matrislerin boyutu
int i, j; // Global değiskenler. Hem fonksiyonlarda hem mainde ortak kullanildigindan global yapildi.
int **yap(int **h)
{
for (i = 0;i < BOYUT;i++)
for (j = 0;j < BOYUT;j++) {
@hasayvaz
hasayvaz / yontemler.c
Created April 10, 2012 12:52
sayısal çözümleme ödevi-secant, newton, bisection ve regular falsi yöntemi kullanarak denklem kökü bulma.
#include<stdio.h>
#include<math.h>
#define BOYUT 50
#define TUREV_K (double)0.0000001
double f(double x)
{
return 3 * x * x + 12 * x + 7;
//return x * x * x - 5 * x * x - 2 * x + 10;
}
@hasayvaz
hasayvaz / regexp.php
Created January 3, 2012 11:10
regular expressions with php - tez çalışması2
#!/usr/bin/php
<?php
$ayrisacak = "Tablet
Pfizer
Asetilsalisilikasit