Skip to content

Instantly share code, notes, and snippets.

View mcanvar's full-sized avatar
🛵
Scootering in the wonderland.

Mevlüt Canvar mcanvar

🛵
Scootering in the wonderland.
View GitHub Profile
@mcanvar
mcanvar / YaSimpleFeed.php
Last active April 7, 2017 21:38
YaSimpleFeed yii extension fixed minor bugs: lines 57 and 87-90.
<?php
/**
* FileDoc:
* Widget for YaSimpleWidget.
* !!! ATTENTION !!! this widget only supports XML format
*
* Usage:
*
* 1. Copy ya-simple-feed directory into the extensions directory
*
<?php
$show_after_p = 2;
$content = apply_filters('the_content', $post->post_content);
if(substr_count($content, '<p>') > $show_after_p)
{
$contents = explode("</p>", $content);
$p_count = 1;
foreach($contents as $content)
{
echo $content;
@mcanvar
mcanvar / 002_create_sessions.php
Last active August 22, 2016 11:17 — forked from harris21/Migration Create Sessions
Create CodeIgniter Sessions Migration
<?php
/**
* Created by PhpStorm.
* User: [email protected]
* Date: 22.08.2016
* Time: 04:58
*/
class Migration_Create_Sessions extends CI_Migration {
@mcanvar
mcanvar / letterOccurences.c
Last active June 27, 2016 22:38
Functions that find letter occurences in character string.
/*
Paralel Programlama Bütünleme Soruları
Soru 1) Argüman olarak string alan ve ekrana her harfinin frekansını yazdıran C fonksiyonunu yazınız.
[email protected]
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@mcanvar
mcanvar / calculateTrapAreaOpenMP.c
Created June 7, 2016 11:27
Parallel programming final exam 3rd question. C parallel program that calculate trapezoidal area via OpenMP.
/*
Paralel Programlama Final Soruları
Soru 3) Argüman olarak n sayısını alan ve geriye trapezoidal alanı döndüren C programını OPENMP ile yazınız.
n in tek olduğu durumlar göz önüne alınmalıdır.
Compile: gcc -g -Wall -o calculateTrapAreaOpenMP calculateTrapAreaOpenMP.c -lm -lpthread
Run: ./calculateTrapAreaOpenMP <number of threads> <n>
[email protected]
*/
@mcanvar
mcanvar / calculateTrapArea.c
Last active June 11, 2016 07:29
Parallel programming final exam 3rd question. C function that calculate trapezoidal area.
/*
Paralel Programlama Final Soruları
Soru 3) Argüman olarak n sayısını alan ve geriye trapezoidal alanı döndüren C fonksiyonunu yazınız.
[email protected]
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <omp.h>
@mcanvar
mcanvar / calculatePiPthread.c
Last active June 11, 2016 07:28
Parallel programming final exam 2nd question. C parallel program that calcullate pi number via pthread library.
/*
Paralel Programlama Final Soruları
Soru 2) Argüman olarak n sayısını alan ve geriye pi sayısını döndüren C programını pthreads ile yazınız.
n in tek olduğu durumlar göz önüne alınmalıdır.
Compile: gcc -g -Wall -o calculatePiPthread calculatePiPthread.c -lm -lpthread
Run: ./calculatePiPthread <number of threads> <n>
[email protected]
*/
@mcanvar
mcanvar / calculatePi.c
Created June 7, 2016 01:18
Parallel programming final exam 1st question. C program that calcullate pi number in a basic way.
/*
Paralel Programlama Final Soruları
Soru 1) Argüman olarak n sayısını alan ve geriye pi sayısını döndüren C fonksiyonunu yazınız.
[email protected]
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
@mcanvar
mcanvar / str_words_count-function.php
Created April 10, 2016 11:41
PHP str_words_count Fonksiyonu
<!--
Author: Mevlüt Canvar
-->
<!DOCTYPE html>
<html>
<head>
<title>str_words_count</title>
<script type="text/javascript" src="http://localhost:35729/livereload.js"></script>
</head>
@mcanvar
mcanvar / php-strlen-function.php
Created April 9, 2016 17:16
PHP strlen Fonksiyonu
<!--
Author: Mevlüt Canvar
-->
<!DOCTYPE html>
<html>
<head>
<title>strlen</title>
<script type="text/javascript" src="http://localhost:35729/livereload.js"></script>
</head>