Blog Of Sem: June 2017

Wordpress Yit woocommerce Back to top turkce yap

/wp-content/themes/regency/theme/functions-template.php

Bul;
echo '<div id="back-top"><a href="#top"><i class="fa fa-chevron-up"></i>' . __('Back to top', 'yit') . '</a></div>';


Deiştir;
echo '<div id="back-top"><a href="#top"><i class="fa fa-chevron-up"></i>' . __('Yukarı Git', 'yit') . '</a></div>';

wordpress woocommerce yit framework search for türkçe yapma

Bunu bul ve deieştir: /wp-content/themes/regency/theme/templates/searchform/post.php

<?php
/*
 * This file belongs to the YIT Framework.
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-3.0.txt
 */
?>

<div class="searchform">
    <form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>">
        <div>
            <label class="screen-reader-text" for="s"><?php _e( 'Ara:', 'yit' ) ?></label>
            <div class="search-wrapper"><input  type="text" value="" name="s" id="s"  /></div>
            <input  type="submit" class="button" id="searchsubmit" value="<?php _e( 'Ara', 'yit' ) ?>" />
            <?php
            $post_types =  apply_filters( 'yit_searchform_post_types', array( 'post' ) );

            foreach( $post_types as $post_type ) : ?>
                <input type="hidden" name="post_type[]" value="<?php echo $post_type ?>" />
            <?php endforeach ?>
        </div>
    </form>
</div>

vs 2013 c# Devexpress gridview sağ tıklayarak excel dosyası olarak kaydet

Forma 1 adet contextMenuStrip1 ve 1 adet saveFileDialog1 at gridControl1de ki dataları excele kaydetmek için;


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using System.Data.OleDb;
using DevExpress.XtraGrid.Columns;
using DevExpress.XtraGrid.Views.Grid;


contextMenuStrip1  tıkla Excele kaydet item yarat ve çift tıkla ve yaz;

            //excele kaydet
            string filename;
            saveFileDialog1.Filter = "xlsx files (*.xlsx)|*.xlsx";
            saveFileDialog1.FilterIndex = 2;
            saveFileDialog1.RestoreDirectory = true;
            saveFileDialog1.ShowDialog();
            filename = saveFileDialog1.FileName;
            if (filename == "") filename = ""; else gridView1.ExportToXlsx(filename);

Daha sonra gridcontrola tıkla ve contextmenustripini contextMenuStrip1 olarak seç

Visual C# 2013 Windows 7 Programa taskabara kısayollar ekleme IKONLU


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.WindowsAPICodePack.Taskbar;
using Microsoft.WindowsAPICodePack.Shell;
using System.IO;
using System.Reflection;
using System.Diagnostics;



             private void Form1_Shown(object sender, EventArgs e)
        {
            //KISAYOLLAR DOSYA YOLLARI
            string VP = "D:\\Dosyalar\\semih\\visionpluskontrol32bit\\VisionPlusKontrol32bit\\VisionPlusKontrol32bit\\bin\\Debug\\VisionPlusKontrol32bit.exe";
            string OTOMASYON = "D:\\vs 2013 projeleri\\vp\\vpws\\vpws2\\EasyEkontor3g\\EasyEkontor3g\\bin\\Debug\\EasyEkontor3g.exe";
            string DOSTELWEB = "http://182.125.142.9/ws/";
            string DOSTELWEBICONIE = "C:\\Program Files\\Internet Explorer\\iexplore.exe";

            //SIK KULLANILANLAR DOSYA YOLLARI
            string COREL = "C:\\Program Files\\Corel\\CorelDRAW Graphics Suite X6\\Programs64\\CorelDRW.exe";
            string PHOTOSHOP = "D:\\Program Files\\Adobe\\Adobe Photoshop CC 2015\\Photoshop.exe";
            string DOSYALARVEBOYUTLAR = "D:\\Program Files (x86)\\WinDirStat\\windirstat.exe";
            string SEARCHEVERYTHING = "D:\\Program Files\\Everything\\Everything.exe";
            string SMSCASTER = "C:\\Program Files (x86)\\SMSCaster\\smscaster.exe";

            JumpList KISAYOLLAR = JumpList.CreateJumpList();
            KISAYOLLAR.ClearAllUserTasks();
            JumpListLink JLLVP = new JumpListLink(VP, "VP") { IconReference = new IconReference(VP, 0) };
            JumpListLink JLLOTOMASYON = new JumpListLink(OTOMASYON, "OTOMASYON") { IconReference = new IconReference(OTOMASYON, 0) };
            JumpListLink JLLDOSTELWEB = new JumpListLink(DOSTELWEB, "DOSTEL WEB") { IconReference = new IconReference(DOSTELWEBICONIE, 0) };
            JumpListCustomCategory kategori = new JumpListCustomCategory("KISAYOLLAR");
            kategori.AddJumpListItems(JLLVP);
            kategori.AddJumpListItems(JLLOTOMASYON);
            kategori.AddJumpListItems(JLLDOSTELWEB);
            KISAYOLLAR.AddCustomCategories(kategori);

            JumpListLink JLLCOREL = new JumpListLink(COREL, "COREL X6") { IconReference = new IconReference(COREL, 0) };
            JumpListLink JLLPHOTOSHOP = new JumpListLink(PHOTOSHOP, "PHOTOSHOP 2015") { IconReference = new IconReference(PHOTOSHOP, 0) };
            JumpListLink JLLDOSYALARVEBOYUTLAR = new JumpListLink(DOSYALARVEBOYUTLAR, "WINDIRSTAT DOSYA BOYUTLARI") { IconReference = new IconReference(DOSYALARVEBOYUTLAR, 0) };
            JumpListLink JLLSEARCHEVERYTHING = new JumpListLink(SEARCHEVERYTHING, "SEARCH EVERYTHING") { IconReference = new IconReference(SEARCHEVERYTHING, 0) };
            JumpListLink JLLSMSCASTER = new JumpListLink(SMSCASTER, "SMS CASTER") { IconReference = new IconReference(SMSCASTER, 0) };
            JumpListCustomCategory kategori2 = new JumpListCustomCategory("SIK KULLANILANLAR");
            kategori2.AddJumpListItems(JLLCOREL);
            kategori2.AddJumpListItems(JLLPHOTOSHOP);
            kategori2.AddJumpListItems(JLLDOSYALARVEBOYUTLAR);
            kategori2.AddJumpListItems(JLLSEARCHEVERYTHING);
            kategori2.AddJumpListItems(JLLSMSCASTER);
            KISAYOLLAR.AddCustomCategories(kategori2);
            KISAYOLLAR.Refresh();
        }

Python ile webden altın fiyatlarını çekme

import re , urllib
liste=["Kuyumcu Alis","Kuyumcu Satis"]
# size gerekli olan adres
website=urllib.urlopen("http://www.bigpara.com/altin/ceyrek-altin-fiyati")
htmltext=website.read()
# site icinde altin fiyatinin bulundugu alan
getinspect='<span class="value up">(.+?)</span>'
pattern=re.compile(getinspect)
price=re.findall(pattern,htmltext)
j=0
for i in price:
    print liste[j]+" fiyati: "+i
    j+=1


output: 
Kuyumcu Alis fiyati: 226,72
Kuyumcu Satis fiyati: 232,39

Python 27 beatifulsoap siteden tüm linkleri çek

önce cmd satırında pip.exeyi bul ve easy_install bs4
pip install lxml


from bs4 import BeautifulSoup
import urllib2

resp = urllib2.urlopen("http://www.gpsbasecamp.com/national-parks")
soup = BeautifulSoup(resp,  "lxml")

for link in soup.find_all('a', href=True):
    print link['href']



alternatif

from bs4 import BeautifulSoup
import urllib
import re

html_page = urllib.urlopen("http://arstechnica.com")
soup = BeautifulSoup(html_page, "lxml")
for link in soup.findAll('a', attrs={'href': re.compile("^http://")}):
    print link.get('href')

Python ms sql servere bağlan

sql server kütüphanesi yüklü deilse yükle pip install pyodbc

import pyodbc
cnxn = pyodbc.connect('DRIVER={SQL Server};SERVER=192.168.1.200;DATABASE=TIGER;UID=testu;PWD=testp')
cursor = cnxn.cursor()
cursor.execute("select * from LG_INVOICE")
rows = cursor.fetchall()
for row in rows:
    print row.DATE_


Python kütüphane ekleme

python 27 kurulduğu klasöre örnek c:\pyhton27\script cmd satırıyla git ve pip install pyodc örnek entere bas kurar.


not: cmdnin klasöre sağ tıkladığında aktif olmasını isdersen HKEY_CLASSES_ROOT\Directory\shell\cmd
den Extendedi sil ve artık klasörlere shifte basılı tutarak sağ tıklarsan okeydir...