Archive | GNU/Linux

Clonezilla live 2.6.6-12 duyuruldu

Sabit disk klonlamak ve yedeklemek için tasarlanmış Debian GNU/Linux tabanlı Clonezilla‘nın Live versiyonunun yeni test sürümü 2.6.6-12 duyuruldu. Ancak bu duyuru, her zaman olduğu gibi değişiklikler sayfası üzerinden değil, osdn.net üzerinden yapıldı. Temel GNU/Linux işletim sistemi güncellenen 2.6.6-12 sürümüne ait ISO kalıpları, osdn.net üzerinden yayınlandı, böylelikle de duyurulmuş oldu. Steven Shiau, biraz önce gönderdiği e-postalarla sürümü duyurdu ve aşağıda verdiğimiz linkleri paylaştı. Bu arada,  Clonezilla’nın Türkçe dil desteği olmamasının kalıcı hasarlar yaratabileceğini düşünen Ömer Yıldız tarafından Türkçeye çevrilmeye başlandığını haber vermiştik. Artık yazılımın Türkçe versiyonlarını indirme şansına da sahip olduğunuzu unutmamalısınız. Ömer Yıldız’ın yaptıklarını burada bulabilirsiniz.

Continue Reading →

Clonezilla live 2.6.6-12 edinmek için aşağıdaki linklerden yararlanabilirsiniz.
0

20+ examples for flattening lists in Python

20+ examples for flattening lists in Python. Flattening lists means converting a multidimensional or nested list into a one-dimensional list. For example, the process of converting this [[1,2], [3,4]] list to [1,2,3,4] is called flattening. The process of flattening is very easy as we’ll see. You will learn how to flatten different shapes of lists with different techniques. So, let’s jump in. Let’s start with a simple example of converting [[0,1], [2,3]] into [0,1,2,3]. This type of flattening is called shallow flattening as it will only flatten lists of one level depth.

 

Continue Reading →

A list of lists

Let’s start with a simple example of converting [[0,1], [2,3]] into [0,1,2,3]. This type of flattening is called shallow flattening as it will only flatten lists of one level depth.

Using list comprehension

List comprehension is a way to create lists in one line of code. Let’s see how we can use list comprehension for flattening the lists.

flatten_list = [item for subl in l for item in subl]

Let’s break this line of code.

The first loop is “for subl in l” and the second nested loop is “ for item in subl ”.

Deep flattening

When we will try to flatten a list of varying depth like this [ [ 0, 1 ], [ [ 2 ] ][ 3, 4 ] ] list with shallow flattening, the output will be as follows:

But our goal is to convert [ [ 0, 1 ], [ [ 2 ] ], [ 3, 4 ] ] this list to this [ 0, 1, 2, 3, 4 ] list. This problem can be solved with deep flattening. In deep flattening, the process undergoes multiple levels of depths to create a flattened list.

There is a built-in function named deepflatten in the iteration_utilities library. You need to install this library using.

We have successfully achieved our target. Let’s take another example by changing the depth of the list.

Using recursion

To flatten a list recursively, we will call the function inside itself to run until the end:

Check whether the list length is equal to 1. If true, then check whether the type of the first index of the list is a “list”.if true, then call the function that flattens the list else, store the number in the result.

The function will be like this:

When we run this code against this [[0,1], [2], [3,4]] list, the results will be:

Flatten without recursion

To flatten a list without recursion, we will use a while loop until we pop all the elements from it. Take a look at the code, you will have a better understanding:

Flatten nested lists

To flatten a nested list, you can use deep flattening. For deep flattening lists within lists, use the given below code:

Also, you can use the recursive function as we did above.

A list of tuples

Flattening a list of tuples of a single depth is the same as flattening lists within lists. For shallow flattening of tuples, use the following code:

For deep flattening, a list of tuples with varying depth (nested), you can use the code given below:

Flatten 2d array

Let’s take a 2d array of 5×5 dimensions and convert it to a flattened list. Check the following code:

A list of NumPy arrays

There are three built-in functions defined in NumPy library that can convert the NumPy array into flattened lists.

numpy.ravel()

numpy.flatten()

numpy.reshape(-1)

numpy.ravel()

numpy.flatten()

numpy.reshape(-1)

The difference between these three functions is speed. The flatten function returns a copy every time it flattens the array. So, if you have a large data set, don’t use the flatten function; it’s the slower one.

Flatten JSON objects

For flattening JSON objects, there is a built-in function in the flatten_json library named flatten().

You first need to install it using pip:

pip install flatten_json

Then you can use this function in our code:

Flatten a list of objects

You can flatten a list of objects using a built-in function available in the itertools library with function name itertools.chain.from_iterable() Let’s see how to use this function:

The same operation can be achieved using list comprehension too:

Flatten a list of DataFrames

For flattening a list of DataFrames, the pandas library has a built-in function for flattening called df.concat() Let’s take a look at code:

Flatten & remove duplicates

First, we will flatten our list, then we will remove the duplicates.

For flattening the list, we will use our own flatten_without_rec() function, and then we will remove the duplicates.

Let us have a look at the code:

Flatten a dictionary into a list

You can flatten a dictionary to a list using a simple for loop:

Let us have a look at the code:

Using reduce

The reduce() function is defined in the functools library. You first need to import reduce from the functools.

Let’s take a look at the code:

We flattened lists with different shapes & types in different ways. I hope you find the tutorial useful. Keep coming back.

Thank you.

 

 

0

Scientific Linux 7.8 duyuruldu

Fermi National Accelerator Laboratory ve European Organization for Nuclear Research (CERN) tarafından ortaklaşa geliştirilerek Red Hat Enterprise Linux’tan yeniden derlenen Scientific Linux‘un, akademik ve bilimsel  ortamlarda kullanılmak üzere ekstra bilimsel uygulamalarla geliştirilen 7.8 sürümü duyuruldu. Ana akım değişiklikleri için Scientific Linux 7.8 sürüm notlarının gözden geçirilmesinin önemli olduğu söylenirken; 7x kullanıcılarının "yum clean all" komutunu çalıştırabileceği ifade edildi. Sistemin 7.8 depolarını kullanacak şekilde güncellendiği belirtilirken; kurulumdan sonra OpenAFS istemci hizmetlerinin afs.service systemd ünitesi aracılığıyla değiştirilebileceği ifade ediliyor. Kullanıcıların, küçük sürüm yükseltmelerinin bildirilmesi için desteğe sahip olan yeni sürüme terfi etmeleri öneriliyor. Scientific Linux 7.8 hakkında ayrıntılı bilgi edinmek üzere sürüm notları incelenebilir.

Continue Reading →

Scientific Linux 7.8 edinmek için aşağıdaki linklerden yararlanabilirsiniz.

0

FuryBSD 12.1-2020Q2 duyuruldu

Açık kaynak kodlu, FreeBSD tabanlı bir dağıtım olan FuryBSD‘nin 12.1-2020Q2 sürümü, Joe Maloney tarafından duyuruldu. En son FreeBSD paketleriyle birlikte FreeBSD 12.1-p3’ü temel alan sistem, Xorg 1.2.0‘a dayalı olarak geliyor. Çok sayıda hipervizör için geliştirilmiş destek sağlanan sürüm, KVM için de geliştirilmiş destek sunuyor. Artık Xorg 1.2.0 tarafından desteklenmeyen nvidia-driver-304’ün kaldırıldığı bildirilirken, XFCE için güç yöneticisinin eklendiği söyleniyor. Geçmişin kullanımı kolay diğer FreeBSD tabanlı projelerinin (PC-BSD ve TrueOS gibi) ruhunu canlandırmak için bir girişim olarak ortaya çıkan FuryBSD projesi, Xfce ve KDE Plasma masaüstü ortamlarını kullanıyor. BSD lisansı ile kullanıma sunulan FuryBSD, özgürce dağıtılabilir. Varsayılan olarak üç ayda bir sürümü yayınlanan dağıtım, sistem yönetimini gerçekleştiren ilk FreeBSD araçlarını (freebsd-update, pkg, bsdconfig, bsdinstall) içeriyor. FuryBSD 12.1-2020Q2 hakkında ayrıntılı bilgi edinmek için sürüm duyurusunu inceleyebilirsiniz.

Continue Reading →

FuryBSD 12.1-2020Q2 edinmek için aşağıdaki linkten yararlanabilirsiniz.

0

NixOS 20.03 duyuruldu

Hollanda kökenli, bağımsız biçimde geliştirilen; çekirdek içeren uygulamaları, sistem paketleri, yapılandırma dosyaları, tüm işletim sistemi Nix paket yöneticisi tarafından inşa edilen NixOS‘un “Markhor” kod adlı 20.03 sürümü duyuruldu. “Nix” adlı özel bir paket yöneticisiyle gelen sürüm, ok sayıda yeni ve yükseltilmiş pakete ek olarak, 5.4 Linux çekirdeği üzerine inşa edilmiş bulunuyor. Sistem; KDE Plasma 5.17.5 ve GNOME 3.34 masaüstü ortamlarıyla kullanıma sunuluyor ve KDE Applications 19.12.3, Pantheon 5.1.3, GCC 9.2.0, glibc 2.30, Mesa 19.3.3, OpenSSL 1.1.1d gibi çeşitli güncel yazılımlar içeriyor.  Yenilikçi özellikleri, güvenilir yükseltmeleri ve çok kullanıcılı paket yönetimiyle gelen sistemin işlevsel ve kullanışlı olduğu belirtiliyor. NixOS 20.03 hakkında ayrıntılı bilgi edinmek için sürüm notlarını inceleyebilirsiniz.

Continue Reading →

NixOS 20.03 edinmek için aşağıdaki linklerden yararlanabilirsiniz.

0