Archive | GNU/Linux

Uruk GNU/Linux 2.0 “Xfce” çıktı

2.0 final sürümü 5 Aralık 2017’de  çıkarılan Linux-libre çekirdeğiyle gelen ve Trisquel GNU/Linux çekirdeğine dayanan Uruk GNU/Linux‘un 2.0 “Xfce” versiyonu çıktı. %100 özgür bir dağıtım olmak ereğiyle yola çıkan dağıtım, varsayılan masaüstü ortamı olarak final sürümde kullandığı Compiz ile birlikte verdiği Mate 1.12.1 yerine, Xfce masaüstü ortamıyla geliyor bu kez. Kullanıcı dostu grafik arayüzleri sunan dağıtım; hızlı, basit ve güçlü bir dağıtım ortaya koyma arzusu ile kolay özelleştirilebilir bir sistemi kullanıma sokuyor. Henüz resmi duyurusu yapılmamış olan sistem; 4.9.66 linux-libre üzerine yapılandırılmış bulunuyor ve gcc 7, Abrowser 57 gibi güncel paketler içeriyor.

Continue Reading →


Uruk GNU/Linux 2.0 “Xfce”edinmek için aşağıdaki linkten yararlanabilirsiniz.

0

Fatdog64 Linux 720 duyuruldu

Beta sürümü 1 Aralık 2017‘de duyurulan başlangıçta Puppy Linux’un bir türevi olarak oluşturulan, daha sonra Puppy Linux tarzını koruyarak bağımsız bir GNU/Linux dağıtımı haline gelen Fatdog64 Linux’un 720 final sürümü, FatDog64 Linux ekibi tarafından duyuruldu. 64 bit bilgisayarları desteklemeye odaklanan sistemin yeni sürümünü duyurmaktan mutluluk duyduklarını söyleyen geliştirme ekibi, sürümün, Fatdog64 710 ile aynı temel üzerine inşa edildiğini belirtti. Sürümdeki iyileştirmelerin çoğunun SFR’den geldiği belirtilirken, beta ve önceki sürümlerde geri bildirim, öneri, tavsiye, hata raporları, hata düzeltmeleri şeklinde her türlü katkıyı yapanlara teşekkür edildiği ifade edildi. Fatdog64 Linux 720 hakkında ayrıntılı bilgi edinmek için sürüm duyurusunu ve sürüm notlarını inceleyebilirsiniz.

Continue Reading →

Fatdog64 Linux 720 edinmek için aşağıdaki linklerden yararlanabilirsiniz.

0

Develop iOS Apps Using Swift

In the previous post, we talked about iOS language basics and we saw how easy it is to work with Swift language. In this post, we will learn how to work with Xcode and how to develop iOS apps using Swift. Today we will start with a hello world app, so let’s get started. Open Xcode and create a new Xcode project then click single view application.

Continue Reading →

Exploring Xcode

Open Xcode and create a new Xcode project then click single view application

Now type your application name and click next then save your application

Now Xcode will open, you will see a list of files on the left as follows:

  • AppDelegate.swift
  • ViewController.swift
  • Main.storyboard
  • Assets.xcassets
  • LaunchScreen.storyboard
  • Info.plist

The column that contains these files is called navigator.

The center pane of Xcode is called editor where you edit and start coding.

Any file on the left, when you click it, it will open in the center editor area.

Click on the Main.storyboard file, a rectangle in the middle with the title view controller appeared.

On the right hand, there is a column which is attribute inspector.

At the right bottom, there is the object library panel where you drag your components that will be shown to the user as we will see later.

As you can see, on the left, there is a hierarchical list of all components for your selected file which is the view controller in our case, this panel is the document outline panel.

Add Objects to the View Controller

From the objects library panel, search for UIImageView control.

Now drag the UIImageView from the bottom border so it fits the entire corners of the view controller.

I’m going to use two images to show you how to use UIImageView. Click on the Assets.xcassets in the navigator on the left, then drag the images to the document outline.

Click again on the Main.storyboard and select the UIImageView and click the attribute inspector.

Select from the dropdown the image that you need to set as a background for the UIImageView

Then set the content mode for the UIImageView to be Aspect Fill.

Now you can see the image appears perfectly on the UIImageView.

We need to add another UIImageView to put our logo in the center of the screen. Drag another UIImageView from the object library and set the image from the attribute inspector the same way.

UIButton Control

Drag a UIButton from the object library and place it at the top of the view controller.

Change the button attributes from the attribute inspector, you can change the text of the button and the color.

Now let’s run the app to see it in action. Click on the run button on the top of Xcode and wait until the build process completes.

The iPhone simulator will open up and your program should run inside that simulator without problems.

Besides the run button, there is a list of simulators that are shipped with Xcode, you can choose any one of them to run your program.

In my case, I’ve selected iPhone 7 simulator.

Very good!! Your app runs successfully and if you click on the button nothing happens because we didn’t write any code yet for that button.

To close your program, click on the square button

Handling Events

To wire UI elements like a button or image to a code file, you should use @IBOutlet, and to perform actions when a certain UI element is interacted with, you should use @IBAction function.

Click on the assistant editor on the right corner which has interlocking circles icon.

Now we need create @IBOutlets for each image and one @IBAction for the UIButton.

To create an @IBOutlet for the image, right click on the image and drag the mouse to ViewController.swift and exactly above the viewDidLoad() function.

A popup will appear to ask you about the outlet name you want to create. Type the name you want and click connect.

Repeat the same steps for the logo image view.

For the button, right click and drag the button to ViewController.swift and release the mouse blew didReceiveMemoryWarning() function.

When the mouse is released, a popup will appear to ask you about the event type and the name of the action.

Choose the connection type as an action and type the action name and click connect.

As you see, the created action looks like a function. Actually, it’s a function that can be triggered when the button is pressed.

Basic Coding

Let’s do a very basic coding. When the user clicks the button the images disappear.

Go to the button @IBAction and type the following:

backgroundIV.isHidden = true

logoIV.isHidden = true

Run the app and wait for the build process to finish and when the program shows up click on the button and see what will happen.

Wow!! The images disappeared. That’s your first iOS action. Congratulations!

It’s not that good but its working.

I hope you find the post interesting. Keep coming back.

Thank you.

likegeeks.com

0

4MLinux 23.1.1

Bir bakım (bir sistem kurtarma live CD’si gibi), multimedya, (inetd daemon kullanarak) bir miniserver gibi temel unsurlara odaklanan ve bazı küçük GNU/Linux oyunları sağlayan 4MLinux’un birkaç yeni özellik ile birlikte gelen kararlı sürümü 23.1.1 duyuruldu. Bazı yeni şaşırtıcı özelliklerinden dolayı büyük bir nokta olarak imlenen sürüm, 1GB’ın üzerinde bir boyutta bir live CD olarak sunuluyor. Audacious, Chrome, VLC, GNOME Office gibi çeşitli popüler programlarla birlikte geliyor. AMD, Intel ve NVIDIA ekran kartları için tam 3D desteğinin varsayılan olarak etkin olduğu belirtilen ve eski bilgisayarların dostu olan sistemin, 128 MB RAM’e sahip makinelerde bile kurulumu mümkün kıldığı ifade ediliyor. 4MLinux 23.1.1 hakkında ayrıntılı bilgi edinmek üzere sürüm duyurusunu inceleyebilirsiniz.

Continue Reading →

4MLinux 23.1.1 edinmek için aşağıdaki linkten yararlanabilirsiniz.

0

ROSA FRESH LXQT R10 duyuruldu

KDE 4 veya Plasma 5 Masaüstü masaüstü ortamlarıyla kullanıma sunulan R10 sürümü 6 Aralık 2017‘de duyurulan, Linux tabanlı çözümler geliştiren bir Rus şirketi olan ROSA tarafından geliştirilen ve Mandriva Linux’tan çatallanmış bir dağıtım olan ROSA’nın LXQT masaüstü ortamıyla kullanıma sunulan FRESH LXQT R10 sürümü, Vladimir Potapov tarafından duyuruldu. Sistem kitaplıklarının ve yazılım paketlerinin en son sürümlerine güncellendiği belirtilen sistemin ana sürümle aynı özelliklere sahip olduğu ve fakat LXQT masaüstü ortamıyla farklı bir versiyon olarak kullanıma sunulduğu ifade ediliyor. Varsayılan olarak 4.9.60 LTS Linux çekirdeği üzerine yapılandırılmış bulunan sistemde, 4.13 gibi diğer çekirdekler ise özel depolardan edinilebiliyor. ROSA FRESH LXQT R10 hakkında ayrıntılı bilgi edinmek için sürüm duyurusunu inceleyebilirsiniz.

Continue Reading →

ROSA FRESH LXQT R10 edinmek için aşağıdaki linkten yararlanabilirsiniz.

0

Learn How to Import, Create, Install, Upgrade, Alias and Reload Python Modules

Python is shipped with a lot of modules, we can say that there are python modules for almost everything you need. You need to work with robots, or some hardware in a spaceship, you will find a Python module for that. In this post, we will talk about Python modules and how to create, install, upgrade, reload and use them. The Python module allows you to organize your Python code and makes it easier to maintain later. Inside a module, you can define functions, classes, and variables. You can send your module to your friends and share it with others so they can use it.

Continue Reading →

Standard Library Modules

Python shipped with a large collection of modules. There are more than 200 modules for common programming tasks.

These modules called the standard library, you can find them in most installations on all platforms.

These modules can be used by importing them using the import statement as we’ve seen in the previous post Python programming basics.

How import statement works

Some newcomers might think that the import statement works like the include directive in C language or require in PHP, but that far from the truth because the other languages all it does is just grabbing the file content.

In Python, the situation is little different. There are three steps performed the first time a program imports a given file.

  1. Find the module’s file.
  2. Compile it to bytecode if needed.
  3. Build the objects from the bytecode.

You type the imported file without the extension and without its full directory path.

Then Python compiles it to bytecode. If the source file is modified, the bytecode file (.pyc file) regenerated automatically.

You deploy your Python programs as just bytecode files and avoid sending the source and Python will load the bytecode files.

The final step of the import operation is to execute the generated bytecode.

Python Search for a Module

As we said earlier, you just type the name of the module without extension or complete path and Python will take care of the rest.

So where Python does the search for the modules?

  1. The home directory of your program.
  2. PATH environment variable directories.
  3. Standard library directories.
  4. Any .pth files.
  5. The site-packages home of your third-party extensions.

The combination of these items becomes sys.path list.

Actually, sys.path is the path where Python searches for modules.

You can get your path like this:

import sys

print(sys.path)

You can add new custom paths to search for modules using sys.path.append or
sys.path.insert

When you type import mymodule, Python will load any of the followings:

  • Source code file named mymodule.py.
  • Bytecode file named mymodule.pyc.
  • Optimized bytecode file named mymodule.pyo.
  • A directory named mymodule, for package imports.
  • Compiled extension module like mymodule.so on Linux, or mymodule.dll on Windows.
  • Compiled module which is written in C.
  • ZIP file which is automatically extracted.
  • Jython files which are Python for Java.
  • .NET component, written in the IronPython version of Python

If you have two different files like mymodule.py and mymodule.dll, Python will load the first file found in the search path during the left-to- right search of sys.path. But what if python found both files in the same directory?

Any one of them can be loaded first, so stay away from falling in this situation.

Creating a Python Module

To create a Python module, nothing special is required, just open your editor and type your code and save your file with .py extension.

All defined functions of the module become its attributes.

For example, if you define a function like the following inside your module:

def myfunc:

print("welcome")

You can call the function myfunc from that imported module inside your code.

Keep in mind that when creating a module, the module name becomes a variable (without the extension) inside your Python program, so you can’t name a module if.py. Always avoid Python reserved keywords.

Installing Python Modules from Source

The module includes a special file named setup.py that handles the details.

You can install Python modules from the source like this:

$ python setup.py install

This command will install the module within the site-packages folder which could be like this C:\Python27\lib\site-packages

Or like this

C:\Users\LikeGeeks\AppData\Local\Programs\Python\Python36-32\lib\site-packages

Install Python Modules Using pip

You can use pip utility to install modules and packages from the PyPI repository.

Most developers prefer installing modules using this method. The best thing about pip is that it handles dependency checking.

You can install Python modules using pip like this:

$ pip install numpy

Also, you can upgrade your installed modules using pip like this:

$ pip install --upgrade numpy

This command will update all the dependencies of the modules.

Importing Modules

After writing your awesome modules or installing them, now you need to reuse it anywhere in your code, or maybe send it to your friends so they can use it, or share it with others on the web. How to import modules in your code?

There are two ways to achieve that, the first way is to use import statement, and the second way is to use from statement. Both of them will find, compile and run.

The major difference is that import statement fetches the whole module, while from statement fetches the specified attributes from the modules.

import mymodule

from mymodule import myfunc

The import Statement

Because import statement loads all attributes from the module so if you want to use any attribute, you have to use the module name like this:

import mymodule

mymodule.myfunc()

The from Statement

As we said before, the from statement loads only the specified attributes.

Using the from statement makes it less typing because we don’t have to specify the whole module name when calling it.

from mymodule import myfunc

myfunc()

Actually, behind the scenes the from statement is an extension of the import statement, the entire file is also loaded, but you will be provided with all attributes directly from your code.

You can write the from statement like this:

from mymodule import *

The asterisk here means import everything at the top level from the module.

The Danger of Using from Statement

Some Python developers recommend using the import statement over using the from statement.

But is this true? Does the from statement not safe?

Well, if you use the from to import variables, it will overwrite any variable that has the same name if exist without notice.

This problem, of course, doesn’t happen with the import statement. Since you type the module name to get its attributes, so no collision happens.

You should take care when using the from statement. Consider the following situation

#module1

def myfunc:

print("Hello from module 1")

#module2

def myfunc:

print("Hello from module 2")

Now, let’s import the above modules and try to use them

#MyCode

from module1 import myfunc

from module2 import myfunc

myfunc()

The output here will be from module 2 since the function will be overwritten.

Actually, this is not a common thing to encounter, but anyway, there is a solution for that.

Using Aliases

To avoid the name collision happened in the above example, you can use aliases like this:

#MyCode

from module1 import myfunc as myfunc1

from module2 import myfunc as myfunc2

myfunc1()

myfunc2()

It’s like a renaming the imports. Sometimes developers use aliases to shorten the module names they are importing when the module name is bigger.

After using aliases, do you think that using the from statements is dangerous? For me, it’s not.

Import Module Scope

You know that we can’t access the module attributes unless we import it.

Consider the following situation

#module1

M = 10

def myfunc():

global M

M = 20

#module2

M = 50

import module1

module1.myfunc()

print(M,module1.M)

When you run module2, the module1.myfunc() changes the M variable in module1 not the M in module2.

The result will be 50 20.

That means the global scope for module1.myfunc is the file that enclosing it, not the file it runs from.

The import statements don’t promote the visibility of the attributes, and the imported file can’t see the attributes in the importing file.

Reloading Modules

If you try to re-import the module after importing it on the top of your code, Python will fetch the already loaded module again.

To reload a module, you can use the reload function that can achieve that.

Why do we need to reload the imported module?

The answer is so simple. This allows some parts of your program to be modified without restarting your program. You can imagine any situation that needs dynamic customization.

Python can only reload modules written in Python only. So compiled extensions (like the discussed previously) can’t be reloaded.

You MUST import the module first before you reload it. You can reload modules like this:

import module1

module1.myfunc()

from importlib import reload

reload(module1)

module1.myfunc()

You can change the code of module1 in your text editor and it will be reloaded.

Reloading modules is a very powerful feature in Python if it is used carefully.

I hope you find the post useful and interesting. Keep coming back.

Thank you.

likegeeks.com

0