<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Muhammet Tan</title>
    <description>The latest articles on DEV Community by Muhammet Tan (@muhammettan28).</description>
    <link>https://dev.to/muhammettan28</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F735472%2F4e4aad52-aa60-4f8b-906a-4da4cbf9c541.jpeg</url>
      <title>DEV Community: Muhammet Tan</title>
      <link>https://dev.to/muhammettan28</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/muhammettan28"/>
    <language>en</language>
    <item>
      <title>Book Review 1-Super Study Guide: Transformers &amp; Large Language Models</title>
      <dc:creator>Muhammet Tan</dc:creator>
      <pubDate>Mon, 24 Mar 2025 09:02:30 +0000</pubDate>
      <link>https://dev.to/muhammettan28/book-review-1-super-study-guide-transformers-large-language-models-629</link>
      <guid>https://dev.to/muhammettan28/book-review-1-super-study-guide-transformers-large-language-models-629</guid>
      <description>&lt;p&gt;I guess no one among us is unaware of how much hype Large Language Models (LLMs) have generated nowadays. In a field where thousands of people are simultaneously discussing, developing, and conducting trainings, staying oblivious to the topic isn’t an option for individuals like myself who prefer not to be left behind. Especially if, like me, you’re a bit anxious, missing out on a development in the field of artificial intelligence can lead to dozens of questions swirling in your mind: “Have I fallen too far behind in the world of AI, or have my competitors surged ahead?” So, what’s the solution? Due to individual differences in learning styles and progress, I find it beneficial to at least keep up with the latest developments and learn using the most logical and reasonable method available to me: current books.&lt;/p&gt;

&lt;p&gt;For me, reading a book feels like the opportunity to absorb years of accumulated knowledge from an author’s mind in just a few days. That, to me, translates back as decades of accumulated knowledge from various sources. At least, that’s my take. We mentioned books; why not videos? As I mentioned, this is entirely due to individual differences. While watching an educational video, I feel like I’m undergoing Chinese water torture, constantly fast-forwarding to get it over with, hoping it’ll cover whatever it’s supposed to. This only leads to me not understanding anything. For someone else, this process could be entirely different; as I said, at least for me, it’s like this.&lt;/p&gt;

&lt;p&gt;Moreover, I unfortunately can’t take seriously the creators who go to great lengths to make the cover image of educational videos more attention-grabbing, all in the name of getting more likes, while simultaneously seeing videos that completely contradict their content, such as “RAG is dying,” “Transformer is dying?,” “PHP is dying.”&lt;/p&gt;

&lt;p&gt;I’ve dragged on the introduction for too long. I’m a software developer, working as a full-stack developer in the ERP industry. Alongside my backend and frontend work, I research artificial intelligence as much as possible to add smart scenarios and solutions to the ERP industry. Additionally, I’m in the thesis phase of my master’s degree and aim to strengthen my academic side further by pursuing a Phd. Perhaps this academic curiosity is directing me towards books and articles rather than videos, but I’m not sure.&lt;/p&gt;

&lt;p&gt;Without further ado, as I mentioned at the beginning of the topic, for those curious about how Large Language Models (LLMs) work and what goes on behind the scenes, there are hundreds of blog posts, educational documents, and videos available online. In this blog post of mine, I want to talk about the Super Study Guide: Transformers &amp;amp; Large Language Models book written by Afshine Amidi and Shervine Amidi, which I finished reading yesterday. Since I’ve just finished the book, I find it useful to relay its contents while they’re fresh in my mind, without delving into technical details.&lt;/p&gt;

&lt;p&gt;First and foremost, when quickly flipping through the book’s pages (I’m talking about scrolling down the schrool:)), it was initially odd not to see any code examples. Instead of code, the book offers almost a visual feast, filled with clear and explanatory sentences supporting visuals, rather than lengthy texts or unnecessary details. Looking at the book’s sections, we see that it consists of 5 different parts. In the first part, it covers the fundamentals of deep learning such as performance evaluation metrics, bias, variance, optimizers. The second part extensively covers the concept of Embedding, discussing approaches like RNN, LSTM used before the transformer structure, and their respective disadvantages. The third part delves into the transformer architecture that forms the basic logic of LLMs in great detail, explaining not only the attention mechanism but also the encoder-decoder structure with wonderful visuals. Especially for those trying to understand the attention mechanism, it’s definitely beneficial to read this part a few times if the concepts of Query, Key, Value, and the mathematical operations creating a more efficient method than RNN and LSTM do not clearly form concrete things in their heads.&lt;/p&gt;

&lt;p&gt;When examining the structure and narration of the book, I found it difficult to distinguish between the 4th and 5th sections in practice, as both discuss the structure and applications of LLMs. I must admit my ignorance here — I wasn’t aware that after the pretraining and fine-tuning phases, there was also a preference tuning phase. This section provides insights into how a model is further refined after fine-tuning through feedback labeled as correct or incorrect.&lt;/p&gt;

&lt;p&gt;Additionally, this part covers PEFT (Parameter-Efficient Fine-Tuning) techniques such as LoRA, QLoRA, and Adapters, which allow us to train and fine-tune LLMs even on personal computers. Moreover, it discusses Retrieval-Augmented Generation (RAG), which enables models to gather information from external data sources rather than relying solely on their training data. The book also touches on practical topics frequently needed in real-world projects, such as model compression and reducing model size.&lt;/p&gt;

&lt;p&gt;To summarize, this book thoroughly explains methods and technologies from the ground up, ensuring that readers don’t feel lost when grasping new concepts. As I mentioned, since it doesn’t delve too deeply into mathematical and theoretical details, I didn’t find it overwhelming. However, I do think it’s beneficial to take notes while reading and research certain concepts in more depth.&lt;/p&gt;

&lt;p&gt;Additionally, it would have been great if the book had included a section on agent structures in LLMs and practical usage examples (I know, I’m asking for a lot!).&lt;/p&gt;

&lt;p&gt;I highly recommend this book to anyone curious about artificial intelligence, especially those working with natural language processing. Of course, having some fundamental knowledge of deep learning wouldn’t hurt either.&lt;/p&gt;

&lt;p&gt;In my next post, I will be reviewing Building LLMs for Production by Louis-François Bouchard and Louie Peters, which I have just started reading.&lt;/p&gt;

&lt;p&gt;Thank you for taking the time to read!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Most used Pandas features — DataFrame [PART II]</title>
      <dc:creator>Muhammet Tan</dc:creator>
      <pubDate>Tue, 21 Nov 2023 13:23:21 +0000</pubDate>
      <link>https://dev.to/muhammettan28/most-frequently-used-pandas-functions-dataframe-part-ii-4bo6</link>
      <guid>https://dev.to/muhammettan28/most-frequently-used-pandas-functions-dataframe-part-ii-4bo6</guid>
      <description>&lt;p&gt;Hello, today I will talk about the pandas library. Pandas DataFrame can be initialize like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pandas.DataFrame(data, index, columns)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#data     -&amp;gt; it can be our list, dict,python obj etc.
#index    -&amp;gt; it is not compulsory, byb default start from 0
#columns  -&amp;gt; its optional parameter, we can specify the columns names
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;df=pd.DataFrame(["Paris", "Berlin", "Roma", "Ankara"])
print(df)

Output: 
        0
0   Paris
1  Berlin
2    Roma
3  Ankara
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you see in above code index and column title generated by default.Of course we can specify these values.Let’s learn how to create a Pandas Dataframe from dictionary with user defined column names and indexes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pandas as pd
import numpy as np

dict = {'capitals':["Paris", "Berlin", "Roma", "Ankara"],
        'population':[15, 12, 18, 9]}


row_label=["a","b","c","d"]

df = pd.DataFrame(dict,index=row_label)

print(df)

Output:
  capitals  population
a    Paris          15
b   Berlin          12
c     Roma          18
d   Ankara           9
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can also create dataframe from Series. Using concat() methot allows us to merge different series to make a new dataframe object.This proccess is very customizable via passing parameters.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pandas as pd
import numpy as np

person = pd.Series(["Jack","Linda"])
fees = pd.Series([20000,25000])
department = pd.Series(['Acccountant','Manager'])


df=pd.concat([person,fees,department],axis=1,
             keys= ['Person', 'Salary', 'Department'])

Output:
  Person  Salary   Department
0   Jack   20000  Acccountant
1  Linda   25000      Manager
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  axis=1 to specify merge series as columns instead of rows
&lt;/h1&gt;

&lt;h1&gt;
  
  
  with key parameter we added column labels
&lt;/h1&gt;

&lt;p&gt;Of course we could get the same result by doing this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;person = pd.Series(["Jack","Linda"])
fees = pd.Series([20000,25000])
department = pd.Series(['Acccountant','Manager'])

df=pd.concat({"Person":person,"Salary":fees,"Department":department},axis=1)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can create DataFrame using zip() function.Different list can be merged by this method like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;person = ["Jack","Linda"]
fees = [20000,25000]
department = ['Acccountant','Manager']

tuples_list = list(zip(person, fees, department))
df = pd.DataFrame(tuples_list, columns = ['Person', 'Salary', 'Department'])

print(df)
Output:
  Person  Salary   Department
0   Jack   20000  Acccountant
1  Linda   25000      Manager
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Most used Pandas features (At least I use often:) ) [PART I]</title>
      <dc:creator>Muhammet Tan</dc:creator>
      <pubDate>Tue, 21 Nov 2023 11:54:43 +0000</pubDate>
      <link>https://dev.to/muhammettan28/most-frequently-used-pandas-functions-at-least-i-use-often-part-i-2l85</link>
      <guid>https://dev.to/muhammettan28/most-frequently-used-pandas-functions-at-least-i-use-often-part-i-2l85</guid>
      <description>&lt;p&gt;We can create Pandas series from array,list,dict or a dataframe.&lt;/p&gt;

&lt;p&gt;“In simple words Pandas Series is a one-dimensional labeled array that holds any data type (integers, strings, floating-point numbers, None, Python objects, etc.). The axis labels are collectively referred to as the index”&lt;/p&gt;

&lt;p&gt;If you come from a object oriented programming language, you may be familiar with term of constructor.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Pandas Series Constructor Syntax looks like this
Pandas.series(data,index,dtype,copy)`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#data: The data contains ndarray, list, constants.
#Index: The index must be unique and hashable. np.arrange(n) if no index is passed.
#dtype: dtype is also a data type.
#copy: It is used to copy the data. The data contains ndarray, 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;list, constants.&lt;br&gt;
If you found above code messy, it is not important.Let’s start with basic implementations.&lt;/p&gt;

&lt;p&gt;Creating a empty Pandas Series:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;newserie= pd.Series() 
Output: Series([], dtype: float64)p
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see above if you create a empty pandas series, default datatype will be float and the index of the series starts from 0.&lt;/p&gt;

&lt;p&gt;Basic Example Code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# import pandas as pd
import pandas as pd

# import numpy as np
import numpy as np

# simple array
data = np.array(['g', 'e', 'e', 'k', 's'])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# providing an index
ser = pd.Series(data, index=[10, 11, 12, 13, 14])#we specify the indexes,
print(ser)

Output:
10    g
11    e
12    e
13    k
14    s
dtype: object
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creating a series from Numpy Array:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pandas as pd 
import numpy as np
data = np.array(['python','php','java'])
series = pd.Series(data)
print (series)
Output:
0    python
1    php
2    java
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creating a series from lists (with indexes):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;calories = pd.Series([320, 450, 140, 56], [“apple”, “banana”, “melon”, “bread”])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After creation we will see indexes in our first column, in the same way our&lt;br&gt;
data will be in the second column.&lt;/p&gt;

&lt;p&gt;Second example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;second_list=['C','T']
example =pd.Series(second_list)
output:
0  A 
1  T 
dtype: object
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we dont define index numbers,  index numbers will be generated automatically.&lt;/p&gt;

&lt;p&gt;Creating a serie from Dictionary&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;grades_dictionary={'A':100,'B':80,'C':70,'D':60}
grades=pd.Series(grades_dictionary)
print(grades)
Output:
A    100
B    80
C    70
D    60
dtype: object
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creating a Pandas series from List Comprehensions&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;seri = pd.Series(range(1,15,5), index=[i for i in ‘abc’])
print(seri)Output:
a     1
b     6
c    11
dtype: int64
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  first paramter of range is start value
&lt;/h1&gt;

&lt;h1&gt;
  
  
  second parameter of range is final value
&lt;/h1&gt;

&lt;h1&gt;
  
  
  last parameter of range is increase amount
&lt;/h1&gt;

&lt;h1&gt;
  
  
  from 1 to 15 =&amp;gt; 1 (1)+ 5 (6) + 5 (11)...
&lt;/h1&gt;

&lt;p&gt;Conditional Operations in Series&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;populations =pd.Series([1350, 1200, 350, 150], ["China", "India", "USA", "Russia"], name="Populations")
populations[populations&amp;gt; 500]
Output:
China       1350 
India       1200
Name: Populations, dtype: int64
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can also use logical operators like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;populations[(populations &amp;gt; 200) &amp;amp; (populations &amp;lt; 1000)]
Output:
USA    350
Name: Populations, dtype: int64
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Arithmetic operations in Pandas Series&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;data = pd.Series([1, 2, 3, 4], index=['a', 'b', 'c', 'd'])
data1 = pd.Series([5, 6, 7, 8], index=['d', 'a', 'f', 'g'])
data.add(data1)

Output :
a    7.0
b    NaN
c    NaN
d    9.0
f    NaN
g    NaN
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see above some results shown as Nan value.Because of that sequance of indexes are not same. For example in first serie (data), first index is ‘a’, but second index starts with index of ‘d’.&lt;/p&gt;

&lt;p&gt;We can fill different indexes as we want. In order to do that we should add second parameter to add() method like this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;data.add(data1, fill_value=0)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Value of second parameter of add meethod is not mandatory.I use 0 value but you can enter value as you want 1,2,3, etc…&lt;/p&gt;

&lt;p&gt;Datatype Conversions in Pandas&lt;/p&gt;

&lt;p&gt;If you check out official pandas documentation, you will see this sentence: “Whether object dtypes should be converted to the best possible types.”&lt;/p&gt;

&lt;p&gt;For example :&lt;/p&gt;

&lt;p&gt;When you initialize a pandas series like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;serie1= pd.Series([9, 6, 3])
print(serie1)
Output:
0    9
1    6
2    3
dtype: int64 int64
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Even though we didn’t define datatype of serie explicitly, output dataype has became int64. Well, if you are asked to specify the datatype or convert it other ones?&lt;/p&gt;

&lt;p&gt;We can use astype() function to get rid of it.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;serie1= pd.Series([9, 6, 3])
floatserie= serie1.astype(float)
Output:
0    9.0
1    6.0
2    3.0
dtype: float64 float64  #we can see that output datatype is float64
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;*Additional Information&lt;br&gt;
We can easily convert Pandas Series to Python Lists with toList()&lt;/p&gt;

&lt;p&gt;Like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;py_list= serie1.tolist()
Output: 
[9.0, 6.0, 3.0]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://sparkbyexamples.com/python-pandas-tutorial-for-beginners/"&gt;https://sparkbyexamples.com/python-pandas-tutorial-for-beginners/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://pandas.pydata.org/docs/reference/api/pandas.Series.convert_dtypes.html"&gt;https://pandas.pydata.org/docs/reference/api/pandas.Series.convert_dtypes.html&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Colly Framework ile Go dilinde Web Scraping nasıl yapılır?</title>
      <dc:creator>Muhammet Tan</dc:creator>
      <pubDate>Sun, 21 Nov 2021 16:32:22 +0000</pubDate>
      <link>https://dev.to/muhammettan28/colly-framework-ile-go-dilinde-web-scraping-nasil-yapilir-23bc</link>
      <guid>https://dev.to/muhammettan28/colly-framework-ile-go-dilinde-web-scraping-nasil-yapilir-23bc</guid>
      <description>&lt;p&gt;Öncelikle go resmi dökümantasyonunda olduğu gibi bir proje oluşturuyoruz.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g9skm2lz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ryap216p9z7ufbeb8ct.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g9skm2lz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ryap216p9z7ufbeb8ct.png" alt="Image description" width="694" height="127"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;favori kod editörümüzü açıyoruz ve main.go dosyamızı oluşturuyoruz.İster VS Code terminalinde istersek işletim sisteminin terminalinde projenin olduğu dizinde &lt;br&gt;
go get -u github.com/gocolly/colly/...&lt;br&gt;
komutu ile colly framework yüklemesini başlatıyoruz.Kurulum esnasında sorun yaşarsanız,&lt;br&gt;
&lt;a href="http://go-colly.org/"&gt;http://go-colly.org/&lt;/a&gt; ve &lt;a href="https://github.com/gocolly/colly"&gt;https://github.com/gocolly/colly&lt;/a&gt; adreslerini inceleyebilirsiniz.&lt;/p&gt;

&lt;p&gt;Bizim yapacağımız uygulamada tek bir amacımız var bu da TFF sitesinden Süper Lig puan durumunu çekmek.Bunu yapmak için temel düzeyde olsa html taglarını tanıyor olmanızı bekliyoruz.Eğer daha önce css kullanırken selector yazdıysanız bu iş size çocuk oyuncağı gelecektir.&lt;br&gt;
Öyleyse kodlarımızı yazmaya başlayalım.&lt;/p&gt;

&lt;p&gt;c := colly.NewCollector(&lt;br&gt;
        colly.AllowedDomains(),&lt;br&gt;
    )&lt;br&gt;
komutu ile yeni bir Collector oluşturalım.Bu uygulamada bize bir adet collector yettiği için ekstra ekleme yapmayacağım fakat size kendi projenizde lazım olursa, herhangi bir struct tipinden örnek oluşturur gibi c2,c3,c4 şeklinde collector oluşturabilirsiniz.&lt;/p&gt;

&lt;p&gt;Colly Framework kullanırken mutlaka Callback'ler ile karşılaşacaksınız.Android lifecycle konusuna benzettiğim bu yapıyı en iyi anlatan kısım ise yine kendi resmi dökümantasyonu&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--w2FZzADQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gz892reryesuwsuov732.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--w2FZzADQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gz892reryesuwsuov732.png" alt="Image description" width="800" height="471"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Dwg1LWIG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yr51rqrh0no43wugtops.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Dwg1LWIG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yr51rqrh0no43wugtops.png" alt="Image description" width="800" height="488"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Callbackler konusuna şimdilik, yazıyı kısa ve anlaşılır tutmak için detaylı şekilde girmiyorum.Hevesimizi kaçırmadan hemen Tff resmi sitesinde puan durumu ve fikstür bilgisi yer alan sayfaya gidelim(Bu yazı yazılırken link: &lt;a href="https://www.tff.org/default.aspx?pageID=198"&gt;https://www.tff.org/default.aspx?pageID=198&lt;/a&gt;). Sayfayı açtıktan sonra geliştirici seçeneklerini açalım.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fQKC3iqK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g0v56vkutyoolmzugw34.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fQKC3iqK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g0v56vkutyoolmzugw34.png" alt="Image description" width="218" height="235"&gt;&lt;/a&gt;&lt;br&gt;
En sol üstte bulunan işarete tıklayıp sayfa üzerinde puan durumunun olduğu kısma tıklarsanız, ihtiyacımız olan alanın bir table yapısı içinde olduğu kolaylıkla anlaşılıyor.&lt;br&gt;
Selector yazıp verileri alma işlemini table ın hemen üzerinde bulunan div i kullanıp yapacağız.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iblDjnp2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t8kvan0m28d4pi5ej8fv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iblDjnp2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t8kvan0m28d4pi5ej8fv.png" alt="Image description" width="551" height="447"&gt;&lt;/a&gt;&lt;br&gt;
Burada div in id sini hemen kopyalayıp, örneğini oluşturduğumuz collector'ü kullanmaya başlıyoruz.&lt;br&gt;
c.OnHTML Callback ' içine aşağıdaki kodları yazıyoruz.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IWnrwa-7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3rzt6fzuem1woadvwebe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IWnrwa-7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3rzt6fzuem1woadvwebe.png" alt="Image description" width="800" height="253"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Aşağıdaki kısma dikkat ediniz.&lt;br&gt;
c.OnHTML("#ctl00_MPane_m_198_10561_ctnr_m_198_10561_Panel1&amp;gt;table&amp;gt;tbody&amp;gt;tr".... Normalde burayı tek bir td olsaydı tr&amp;gt;td&amp;gt;a şeklinde uzatabilirdim fakat, her tr nin içinde birçok td olduğu için bütün td leri teker teker gezmemiz gerekiyor.Bunun için selektörü "...&amp;gt;tr" de bitiririp, tr den sonra gelen td ler için ayrı bir forEach dönerek table da bulunan istatistikleri de yazmayı amaçladık.&lt;/p&gt;

&lt;p&gt;Son olarak &lt;br&gt;
c.Visit("&lt;a href="https://www.tff.org/default.aspx?pageID=198%22"&gt;https://www.tff.org/default.aspx?pageID=198"&lt;/a&gt;)&lt;br&gt;
kodunu ekleyerek uygulamamızın istediğimiz linki ziyaret edip verileri çekmesini bekliyoruz.&lt;br&gt;
Çıktı :&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--b5OnieSk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iub4xz8eecmhkuo0qn9i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--b5OnieSk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iub4xz8eecmhkuo0qn9i.png" alt="Image description" width="621" height="401"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Eğer isterseniz console a yazdırdığımız bu verileri .csv dosyasına da kaydedebiliriz. Bu kodları tam bütün halinde paylaşıyorum.&lt;br&gt;
Esen kalın... &lt;br&gt;
package main&lt;/p&gt;

&lt;p&gt;import (&lt;br&gt;
    "encoding/csv"&lt;br&gt;
    "fmt"&lt;br&gt;
    "github.com/gocolly/colly"&lt;br&gt;
    "log"&lt;br&gt;
    "os"&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;func main() {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fName:="data.csv"
file,err:=os.Create(fName)
if err!=nil {
    log.Fatalf("Failed to c reate file: %q",err)
    return
}

defer file.Close()
writer:=csv.NewWriter(file)
defer writer.Flush()


// Instantiate default collector
c := colly.NewCollector(

    colly.AllowedDomains(),
)

// On every a element which has href attribute call callback
c.OnHTML("#ctl00_MPane_m_198_10561_ctnr_m_198_10561_Panel1&amp;gt;table&amp;gt;tbody&amp;gt;tr", func(e *colly.HTMLElement) {
    var liste_stats []string
    var takim string
    var statistics string
    e.ForEach("td", func(_ int, elem *colly.HTMLElement) {
        takim = elem.ChildText("a")
        statistics= elem.ChildText("span")
        liste_stats=append(liste_stats,takim )
        liste_stats=append(liste_stats, statistics)
    })
        fmt.Println(liste_stats)
        writer.Write(liste_stats)
        c.Visit(e.Request.AbsoluteURL(takim))
})


// Before making a request print "Visiting ..."
c.OnRequest(func(r *colly.Request) {
        fmt.Println("Visiting", r.URL.String())
})


c.Visit("https://www.tff.org/default.aspx?pageID=198")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

</description>
    </item>
    <item>
      <title>GOLANG- MSSQL CRUD OPERATIONS</title>
      <dc:creator>Muhammet Tan</dc:creator>
      <pubDate>Sat, 20 Nov 2021 13:55:47 +0000</pubDate>
      <link>https://dev.to/muhammettan28/golang-mssql-crud-operations-3an8</link>
      <guid>https://dev.to/muhammettan28/golang-mssql-crud-operations-3an8</guid>
      <description>&lt;p&gt;In this tutorial, you will learn basic crud operations in golang.&lt;/p&gt;

&lt;p&gt;Project structre looks like this.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyaue5nhctwupffex419f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyaue5nhctwupffex419f.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sql table design looks like this&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fus700wc4rsznk9mk4z0b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fus700wc4rsznk9mk4z0b.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After the creating pages and table, you need to download sql-golang framework with this github link&lt;br&gt;
 github.com/denisenkom/go-mssqldb&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnz2dw0rn3f97d9nt1vek.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnz2dw0rn3f97d9nt1vek.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you see we have three different go code pages.&lt;br&gt;
in main.go , we call just one function(CheckDbConn())  to  keep our aplication simple and clean.In golang main function entry point of the application we develop. Calling just one function is sufficient right now.&lt;/p&gt;

&lt;p&gt;In db.go&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F94lxms3erud1zo7cfoh8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F94lxms3erud1zo7cfoh8.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
We need to fill this area to establish connection between our application and sql database.If you get connection error, you had better check sql username, password,sql port number.&lt;/p&gt;

&lt;p&gt;Full code &lt;br&gt;
db.go&lt;/p&gt;

&lt;p&gt;package main&lt;/p&gt;

&lt;p&gt;import (&lt;br&gt;
    "database/sql"&lt;br&gt;
    f "fmt"&lt;br&gt;
    "log"&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;_ "github.com/denisenkom/go-mssqldb"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;)&lt;/p&gt;

&lt;p&gt;var (&lt;br&gt;
    Server   = "localhost"&lt;br&gt;
    Port     = 1433&lt;br&gt;
    User     = "sa"&lt;br&gt;
    Password = 1453&lt;br&gt;
    Db       = "Products"&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;func CheckDbConn() {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var err error

ConnString := f.Sprintf("server=%s;user id=%s;password=%d;port=%d;database=%s;",
    Server, User, Password, Port, Db)

conn, err := sql.Open("sqlserver", ConnString)
if err != nil {
    log.Fatal("Open connection failed:", err.Error())
}
f.Printf("Connected!\n")
defer conn.Close()
option := 0
f.Println("0.GET \n1.INSERT \n2.UPDATE \n3.DELETE")
f.Scanln(&amp;amp;option)
switch option {
case 0:
    GetProducts(conn)
case 1:
     result,_:= CreateProduct(conn)

    f.Println(result)
case 2:
    UpdateProduct(conn)
case 3:
    DeleteProduct(conn)
default:
    f.Println("Invalid operation request")
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;db.handler.go&lt;/p&gt;

&lt;p&gt;package main&lt;/p&gt;

&lt;p&gt;import (&lt;br&gt;
    "database/sql"&lt;br&gt;
    f "fmt"&lt;br&gt;
    "strings"&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;func GetProducts(db *sql.DB) (int, error) {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;getProduct_sql := "select * from Products"

rows, err := db.Query(getProduct_sql)
if err != nil {
    f.Println("Error reading records: ", err.Error())
}
defer rows.Close()

count := 0
for rows.Next() {
    var name string
    var price float64
    var id int
    err := rows.Scan(&amp;amp;id, &amp;amp;name, &amp;amp;price)
    if err != nil {
        f.Println("Error reading rows: " + err.Error())
        return -1, err
    }
    f.Printf("ID: %d, Name: %s, Price: %f\n", id, name, price)
    count++
}
return count, nil
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;func CreateProduct(db *sql.DB)(int64,error){&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var name string
f.Print("Please enter your product name: ")
f.Scanln(&amp;amp;name)

var price float64
f.Print("Please enter your product's price: ")
f.Scanln(&amp;amp;price)

insertProduct_sql := f.Sprintf("INSERT INTO Products (name,price) VALUES ('%s' , %f ); select ID = convert(bigint, SCOPE_IDENTITY()) ",strings.Title(strings.ToLower(name)),price)


rows,err:=db.Query(insertProduct_sql)
if err !=nil{
    f.Println("Error occured while inserting a record", err.Error())
    return -1,err
}


defer rows.Close()
var lastInsertId1 int64
for rows.Next() {
    rows.Scan(&amp;amp;lastInsertId1)

}


return lastInsertId1,err
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;func  InfoMsG(db *sql.DB,id int64)  {&lt;br&gt;
    infoQuery:=f.Sprintf("Select name from Products where id=%d",id)&lt;br&gt;
    rows,err := db.Query(infoQuery)&lt;br&gt;
    if err !=nil{&lt;br&gt;
        f.Println("Error occured while giving info: ", err.Error())&lt;br&gt;
    }&lt;br&gt;
    defer rows.Close()&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for rows.Next(){
    var name string
    var id =id
    err:=rows.Scan(&amp;amp;name)
    if err !=nil {
        f.Println("Error reading end process product id with, " , id, err)
    }else{
        f.Printf(name + " product has been created " )
    }



}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;func UpdateProduct(db *sql.DB)  {&lt;br&gt;
    f.Print("Please enter product id which you want to change: ")&lt;br&gt;
    var id int&lt;br&gt;
    f.Scanln(&amp;amp;id)&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;f.Print("Please enter new product name ")
var name string
f.Scanln(&amp;amp;name)

f.Print("Please enter new product'price ")
var price float64
f.Scanln(&amp;amp;price)

update_query := f.Sprintf("UPDATE Products set name='%s', price=%f where id=%d",name,price,id)

_, err := db.Exec(update_query)
if err != nil {
    f.Println("Failed: " + err.Error())
}
f.Println("Product informations updated successfully")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;func DeleteProduct(db *sql.DB){&lt;br&gt;
    f.Print("Please enter product id which you want to delete: ")&lt;br&gt;
    var id int&lt;br&gt;
    f.Scanln(&amp;amp;id)&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;delete_query:=f.Sprintf("DELETE FROM Products where id=%d",id)
_, err := db.Exec(delete_query)
if err != nil {
    f.Println("Failed: " + err.Error())
}
f.Println("Product deleted successfully")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;main.go &lt;br&gt;
package main&lt;/p&gt;

&lt;p&gt;func main() {&lt;br&gt;
    CheckDbConn()&lt;br&gt;
}&lt;/p&gt;

</description>
      <category>go</category>
      <category>sql</category>
      <category>crud</category>
    </item>
  </channel>
</rss>
