Chapter 01: Sails as MVC Framework
We need a sandbox application in Sails framework in order to do some experiments. Let's call it contacts as it'll be a contact management system application.
The steps we're going to follow in order to create a Sails app are somewhat unusual. We're not going to use Sails CLI/Sails global package, instead will create a folder and install Sails as dependency.
mkdir contacts cd contacts npm init -y npm i -E sails
Let's create an app.js file and then write the following code.
const sails = require("sails") sails.lift();
We first required the sails package, and then called the .lift() method to start the server on the default 1337 port.
We can run the application using node app.js or let's add this as start script in the package.json. So that, we can use the npm start command for the sake of usual practice.
{
"name": "contacts",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node app.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"type": "commonjs",
"dependencies": {
"sails": "1.5.18"
}
}
Let's run the start command and wait for the ship to render in the terminal! Then you can visit http://localhost:1337 in the browser.
npm start ... some debug logs ... info: info: .-..-. info: info: Sails <| .-..-. info: v1.5.18 |\ info: /|.\ info: / || \ info: ,' |' \ info: .-'.-==|/_--' info: `--'-------' info: __---___--___---___--___---___--___ info: ____---___--___---___--___---___--___-__ info: info: Server lifted in `D:\Playground\contacts` info: To shut down Sails, press <CTRL> + C at any time. info: Read more at https://sailsjs.com/support.
Ah! We get the 404 - Not Found error in the browser. That is expected as we don't have code against the root route. I wish instead of 404 - Not Found error Sails should render something similar to Sinatra (hint: Sinatra render a page with code snippet to copy-paste) as guided learning journey. Next.js also provide the guided journey via console errors. Nice :)
---
Let's fix 404 - Not Found error. First, we need to define the root route. In Sails, routes are defined within config/routes.js file. We don't have config folder and routes.js file. Let's create both.
mkdir config touch config/routes.js
Open this file and write the following code.
module.exports.routes = {
'GET /': 'HomeController.index'
};
Eventually, we'll have lot more files in this config folder.
Note: If you're in the config folder, don't just write module.exports but a module.exports.[filename] such as module.exports.routes or module.exports.globals for the globals.js file.
routes is an object with key as HTTP verb + white space + path. The value should be a controller file + dot + function name within controller. If given route is visited, a function within controller file will going to be executed.
All the controllers in Sails are within api/controllers folder. We don't have api, controllers folders, and HomeController.js file. Let's create.
mkdir api mkdir api/controllers touch api/controllers/HomeController.js
Open this file and write the following code.
module.exports = {
index: (req, res, next) => {
res.send("hello, world");
}
};
If you know the Express then this code looks familiar to you! It is. Sails internally uses Express framework for all the base functionalities.
We now have the root route and the code to run against it. So with these changes, we are ready to run the app again. We should see hello, world text on the root route.
---Waterline is the database ORM built by the same team who built the Sails framework. Because of that, Waterline has seamless integration supports with Sails.
Waterlines supports few databases such as MySQL, PostgreSQL, MongoDB, in-memory database via adapters. For example, sails-disk package is in-memory database adapter. I'm going to use this one for the sandbox demos. You know what, I'm going use sails-hook-orm package as it has sails-disk package within it and more so that I don't have to write any configuration code.
npm i -E sails-hook-orm
We should have a contacts table in database. To work with contacts table, we need to create a Contact model. All the models in Sails are within api/models folders. We don't have models folder and Contact.js file. Let's create.
mkdir api/models touch api/models/Contact.js
Open this file and write the following code.
module.exports = {
tableName: 'contacts',
attributes: {
id: {
type: 'number',
autoIncrement: true
},
firstName: {
type: 'string',
required: true
},
lastName: {
type: 'string'
}
}
};
The code is self-explanatory. We're creating a contacts table with id, firstName, and lastName as columns with given attributes. For now, don't worry about the these attributes and their values.
We can have the Sails application without model/database support. But, If we want to use model/database support, we need to explicitly tell Sails that we're going to use database in our app. For that, we need to set models option to true in global options. The global options are defined within config/globals.js file. We don't have this globals.js file. Let's create it.
touch config/globals.js
Open this file and write the following code.
module.exports.globals = {
models: true
};
Theoretically, this should work. But, due to some internal awkward configuration, you'll get bunch of error if you try to run the app such as - _ / lodash needs to be false, or async needs to be false, or sails needs to be true and so on. To save you with trouble, add few more configurations in globals.js file.
module.exports.globals = {
models: true,
_: false,
async: false,
sails: true
};
Now if you run the app, it will not throw any error now. Go ahead and run the app. You should see following text in the console.
Excuse my interruption, but it looks like this app does not have a "migrate" setting configured yet. (perhaps this is the first time you're lifting it with models?) Tired of seeing this prompt? Edit config/models.js. In a production environment (NODE_ENV=production) Sails always uses migrate:'safe' to protect against inadvertent deletion of your data. But during development, you have a few different options: 1. FOR DEV: alter wipe/drop and try to re-insert ALL my data (recommended) 2. FOR TESTS: drop wipe/drop ALL my data every time I lift Sails 3. FOR STAGING: safe don't auto-migrate my data. I will do it myself Read more: sailsjs.com/docs/concepts/models-and-orm/model-settings#?migrate -------------------------------------------------------------------------------- What would you like Sails to do this time? ** NEVER CHOOSE "alter" or "drop" IF YOU ARE WORKING WITH PRODUCTION DATA ** prompt: ?:
Sails is now waiting for us to answer for the migration strategy. The possible answer we need to provide is 1, 2, or 3. Meaning of each is written in the console text. We can let's say enter 1 and press Enter to continue with our app. But, the problem is, each time you run the app, it'll ask this question again and again. To stop this, we need add our answer in config file.
The config file we need for this is config/models.js file. We don't have this globals.js file. Let's create it.
touch config/models.js
Open this file and write the following code.
module.exports.models = {
migrate: 'alter'
};
With the config saved in config/models.js file, it'll not ask again the same question! Run the application again and you should notice the following console log somewhere.
info: ·• Auto-migrating... (alter) info: Hold tight, this could take a moment. info: ✓ Auto-migration complete.
Perfect! contacts table is created in the database and you're ready to do the CRUD operations on this table using Contact. For example, open the HomeController.js file and add following lines within index function.
module.exports = {
index: async (req, res, next) => {
const contacts = await Contact.find();
console.log("contacts:", contacts);
res.send("hello, world");
}
};
I've converted the function to async function and then calling Contact.find() method. Re-run the application and you should see:
contacts: []
Meaning that database is configured correctly.
One last point before we move to views. We now have the .tmp/localDiskdb/contacts.db (and archive.db) file as we've decided to choose in-memory database.
Instead of returning plain hello, world text let's return hello, world as h1 header. To do so, we need to create a folder with name views and then we should have an EJS/template file within it e.g. home.ejs for root route.
We don't have views folder and home.ejs file. Let's create both.
mkdir views touch vies/home.ejs
Open this file and write the following code.
<h1>hello, world</h1>
Then we can adjust the index function in HomeController.js file to render this template instead of sending the plain hello, world text.
module.exports = {
index: async (req, res, next) => {
const contacts = await Contact.find();
console.log("contacts:", contacts);
res.render("home");
}
};
Re-run the app again! You should see hello, world as the header text!
I think we should stop here for the Chapter 01 as we touch base the MVC concepts in Sails. I would like to highlight that Sails provide MVC functionalities out of the box with just few lines of code and some uncommon adjustment.
If we can adjust these things we have nice framework!
GTK4: Chapter 01
Let's open the text-editor with blank window. Quickly save this blank program with name hello.c. C language has .c extension and hello is the name of the program that satisfies the purpose of code, going to written inside of it. After saving this blank program, I have syntax highlighting. Good!
Next, we are going to print hello, world text in terminal. So, we need to write this text within hello.c. Let me do that.
hello, world
But, this hello, world is string, right? In program, you write string inside of double or single quotes. Agree? But in C, you must write string inside of double quotes. So, let me quickly wrap this text with double quotes and make it string.
"hello, world"
Great! This string is not going to print in terminal on its own. We need to invoke a function on it to print and the function is printf(). This is how we use printf() function.
printf("hello, world")
C is one of those languages the required semicolon to complete the statement. In C, semicolon is not optional but required. And that way I need to write,
printf("hello, world");
Semicolon at the end. Great. But you know, compiled languages like C is different than interpreted language in terms of execution. In interpreted languages, the execution start from top and execute each statement or expression that comes in flow. But, in compiled language you need to tell the starting point - a point from where the compilation process starts. This is where the main() function comes in picture. Your program must contain one main() function and this is the function from where your program will going to compile.
In order to run our printf() statement, we need to put it inside of main() function this way.
main() {
printf("hello, world");
}
This indentation inside of function is not required. It is just for readability purpose.
You are going to use curly braces to define block like I did to define main() function block. Whatever statements we write inside of this curly braces, are considered part of the main() function.
After compilation of this main() function, it returns something. It returns an integer with 0 or greater than 0. Here, 0 means successful compilation and any other value than 0 mean something goes wrong with your program! Let's add the type signature before the main() function to indicate, what this main() is going to be written and also write return 0 explicitly.
int main() { printf("hello, world"); return 0; }
Yes, this return statement should be at the end of main() function.
In C, you don't get a single function by default and printf() is not an exception. You need to include a library in which this function is written. The library or header file is stdio.h and its standard header file that comes with C. You can include this file in our program like -
#include<stdio.h> int main() { printf("hello, world"); return 0; }
You need to write the include statement at the top of your program and the blank line after this include statement is optional. But, again it is strongly recommended.
Note: Although I said that you have to include the stdio.h header file in order to use the printf() function, it is not completely true. You can do a little trick and still run the program (of course, with a warning). One trick is to run the program using an older standard such as C90. The command is:
gcc -std=c90 hello.c -o hello && ./hello
Do this after completing the chapter.
That’s it! This is our hello, world program in C. It's time to execute this program.
Execution
We need a compiler to execute any C program. For this purpose, we are going to use GCC. This is the compiler that comes with most of the GNU/Linux system. A quick --version command will let you know that C is installed on your system or not.
$ gcc --version gcc (Debian 14.2.0-19) 14.2.0 Copyright (C) 2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
If you get similar output, then you have GCC on your system else you need to install. In my case, I've gcc so I can go further and execute this program. The execution of C program done in two steps —
- Compiles the program,
- Executes the compiled program.
To compile the program, this command is used.
$ gcc hello.c -o hello
This will compile your hello.c program and after successful completion it will generate output (-o) with name hello. You will get nothing if compilation happen successfully in terminal. In my case, I don't get anything, so that means my program execute successfully and has build hello. A quick ls will show you the same.
$ ls hello.c hello
In order to execute this hello executable, I need to write:
$ ./hello hello, world
And we get the output! But, this is a little clumsy. A \n after the hello, world string will help. Let's add that.
#include<stdio.h> int main() { printf("hello, world\n"); return 0; }
Let's compile and run the program again.
$ gcc hello.c -o hello && ./hello hello, world
Here, I've combines both commands into single one using && operator. You will going to use so many terminal commands in this book. So, be ready!
Note: Returning 0 is important because, if a non-zero value is returned, the OS considers that something went wrong while running the program. Based on that indication/status, the OS will not continue further operations.
Let's understand this by example: I want to print in the console that program ran successfully if the program runs successfully. I can easily add an echo statement with && like this:
$ gcc hello.c -o hello && ./hello && echo "program ran successfully"
If you run this command, you should see hello, world as the output, and program ran successfully on the next line.
Now, change the return value from 0 to, let's say, 1. Run the above command again. You will not see program ran successfully.
---
If you think that I've spent a whole chapter on a topic that I considered as an assumption (yup, I assume that you should know C) about you, then you're right — I've spent the whole chapter on it. But, the idea is to give a glimpse of how the book is written. We'll write the code one or a few lines at a time, with an explanation either before or later.
Because, I personally think that each line in our program should have a reason to have it in our program. If there is a reason, I need to explain the reason unless the framework is not managing the abstraction.
સંસ્કૃતમાં च પોસ્ટફિક્સ નોટેશનમાં લખાય છે
કોમ્પ્યુટર વિજ્ઞાનમાં અલગ અલગ નોટેશન આવે છે - પ્રિફીક્સ, ઇનફીક્સ, અને પોસ્ટફિક્સ.
3 + 4
અહીં + કારક(=operator) છે જયારે સંખ્યા 3 અને 4 સંકાર્ય છે. કારક સંખ્યાની વચ્ચે લખાય છે એટલે એને મધ્યપ્રત્યય(=ઇનફીક્સ/infix) નોટેશન કહેવાય છે. આ નોટેશન ઘણું પ્રચલિત છે એટલે તમને આ બધે જોવા મળશે. ખાસ કરીને ગણિતમાં.
જો કારકને સંખ્યાની શરૂઆતમાં લખવામાં આવે તો એને પૂર્વપ્રત્યય(=પ્રિફીક્સ/prefix) નોટેશન કહેવાય છે. જેમ કે,
+ 3 4
આમતો આ નોટેશન ખાસ પ્રચલિત નથી, પણ લિસ્પ(=lisp) પ્રોગ્રામિંગ ભાષામાં આ ખુબ જ વપરાય છે, સંપૂર્ણ ભાષા પૂર્વપ્રત્યય નોટેશનમાં છે અને એમાં કૌંસનો બહુ ઉપયોગ થાય છે - (+ 3 4).
અને છેલ્લે આવે છે, ઉત્તરપ્રત્યય(=પોસ્ટફીક્સ/postfix). જેમાં કારક છેલ્લે લખાય છે, અને સંખ્યા પહેલા લખાય છે. જેમ કે,
3 4 +
આ નોટેશન પ્રચલિત નથી. પણ સંસ્કૃતમાં જયારે બે શબ્દો વચ્ચે અને(=and) વાપરવાનું હોય ત્યારે च(=અને) શબ્દોના અંતમાં આવે છે.
જેમ કે, ગુજરાતીમાં આપણે લખીશું/બોલીશું:
રામ અને કૃષ્ણ.
જયારે એ સંસ્કૃતમાં આ લખાશે/બોલશે:
रामः कृष्णः च |
તમે કહેશો કે આ શું? આમાં તો બધું ભેગું કર્યું - ગુજરાતી, કોમ્પ્યુટર વિજ્ઞાન અને એની ભાષા, અને સંસ્કૃત.
તો આજ ફાયદો છે, એક કરતાં વધુ વિશે જાણવાનો. તમે ગમે ત્યારે જોઈએ એ પ્રમાણે મિશ્રણ કરી શકો છે, કેમ કે તમને આવડે છે!
From Intern to Software Architect
You start your journey as an intern or junior software engineer. At this level, you care about the syntax and language constructs such as defining variables or constants correctly, writing a function that might be reusable, or constructing conditions correctly. Let's call this level - 1.
As you start to become more familiar with the language and code, your focus shifts towards the program files. Now, you start to care about files instead of language constructs as you're comfortable with syntax and language constructs. You can now connect the files across a bug fix or a change that you need to make. You're now at level - 2.
As you become more experienced, you now start to care about a module - not just a set of files but a logically related set of files. Previously, it was a set of program files only. But now you start to see program files as a module. You know the connection between files and can reason about them. You reach level - 3.
Next, you continue your journey and start seeing multiple modules all together as an app. You are not seeing the language constructs, you're not seeing a set of files, you're not seeing a module, but a set of modules all together as a whole app. You're now caring about the whole app. When you review the PRs, you are adding the whole app context to the review before you approve and merge. You're now at level - 4.
As you gain more experience, you start to see a bigger picture than the app. You're now seeing things outside of the app such as services, proxies, DNS, security, firewalls, and many surrounding services. You now not only care about the app but about these services as well, which are required for your app to be alive. You now know the exact details about how a request comes into the app and goes out through all these services. You're now at level - 5.
Your journey continues and you start to connect with other teams who manage other apps that make up the whole product. You start to see a bigger picture than the app and services. You know how apps live together, how they communicate, how they are monitored, and much more. You're now at level - 6.
I'm going to stop here at level - 6 as I think this is where the role of a software architect becomes clear and in full view. I'm not saying that the level steps stop here. But this is where I want to stop for this article discussion.
In summary, you started with syntax and reached the level where you care more about app servers, proxies, communication, security, and so on.
---
Although I've used labels level 1 - 6, you can give a position you like against the levels based on the hierarchy you have seen in organizations. For example,
Level - 1 = Intern
Level - 2 = Jr. Software Engineer
Level - 3 = Software Engineer
Level - 4 = Sr. Software Engineer
Level - 5 = Principal Software Engineer
Level - 6 = Architect
Or you can combine some levels against the same position.
Level - 1, 2 = Jr. Software Engineer
Level - 3, 4 = Software Engineer
Level - 5 = Lead Software Engineer
Level - 6 = Architect
Or you can introduce more levels. For example,
Level - 3 can be divided into two parts as Software Engineer and Sr. Software Engineer, where you write software engineering with design patterns as an effective solution in the later position.
---
Now, let's take a top-down look.
At level - 6, the architecture is created so well that at level - 5 you don't have to worry about other apps. At level - 5, the app is set up very well so that at level - 4 you don't have to worry about surrounding services. At level - 4, the app is created and maintained very well so that at level - 3, you don't have to worry about other modules within the app. This continues at level - 2, where the code is crafted so well that you don't have to worry at level - 1 that your minor code change will throw a module error or bring down the app or crash the product!
Layers of abstraction are added so well that at the given level, only the necessary context is required. When you're at level - 6, you don't have to care about the code of the app or module because it is taken care of at levels - 3 and 4. Similarly, at level - 2, you don't have to worry about other parts of the product as they are taken care of at a higher level. You just have to worry about a set of files.
---
With the advancement of AI, the border between these levels has started to become blurred. Not between levels but between the whole range of levels. You, as level - 2, are expected to work on levels - 1 to 4, or level - 4 is required to work on levels - 3 to 6. Geniuses can jump between these levels, but lack the knowledge that only comes with experience.
અધૂરો ઘડો છલકાય ઘણો
આ કહેવતનો અર્થ છે - જેમ અડધો ભરેલો ઘડો હલનચલનથી વધારે છલકાય છે, તેમ અધૂરું જ્ઞાન ધરાવનાર વધારે બોલે છે, વધારે દેખાડો કરે છે. આને લગતી બીજી પણ એક કહેવત છે - ખાલી ચણો વાગે ઘણો. આ કહેવતનો પણ મતલબ સમાન છે.
ભર્તૃહરિ પણ નીતિશતકમાં આ મતલબની વાત કહે છે.
अज्ञः सुखमाराध्यः सुखतरमाराध्यते विशेषज्ञः।
ज्ञानलवदुर्विदग्धं ब्रह्मापि नरं न रञ्जयति॥
અજ્ઞાનીને સમજાવવો સરળ છે, જ્ઞાનીને સમજાવવો તો એનાથી પણ સરળ છે, પણ જેની પાસે અલ્પજ્ઞાન છે, જે અંધકારમાં ડૂબેલો છે, તેને સ્વયં બ્રહ્માજી પણ સમજાવી શકતા નથી.
अज्ञः = અજ્ઞાની
सुखमाराध्यः = सुखम् + आराध्यः = સુખપૂર્વક + પ્રસન્નતાથી
विशेषज्ञः = વિશેષજ્ઞ / જ્ઞાની
सुखतरमाराध्यते = सुखतरम् + आराध्यते = વધુ સુખપૂર્વક + પ્રસન્નતાથી
ज्ञानलवदुर्विदग्धं = ज्ञान + लव + दुर्विदग्धम् = જ્ઞાન + ઓછું / અંશ + ખરાબ રીતે દાજેલો / અહંકારથી ભરેલો
ब्रह्मापि = ब्रह्मा + अपि = બ્રહ્મા + પણ
नरं = નર
न = ના
रञ्जयति = પ્રસન્ન કરવું
તડપદી ભાષામાં કહેવાય છે ને, "આને હવે ભગવાન નીસે આવીને હમજાવશે તોય ઇ નઇ હમજે".
કલાકારની ફિલમ આવી
કલાકાર વિવાદોમાં સપડાયો,
લાગે છે કલાકારની ફિલમ આવી.
કલાકાર આંદોલનમાં જોડાયો,
લાગે છે કલાકારની ફિલમ આવી.
કલાકાર મંદિરમાં દેખાણો,
લાગે છે કલાકારની ફિલમ આવી.
કલાકારને ચિંતા જાગી,
લાગે છે કલાકારની ફિલમ આવી.
TIL: fetch() in Node is powered by undici
Undici means eleven in Italian. It is an HTTP/1.1 client. 1.1 -> 11 -> Eleven -> Undici.
fetch() that we use in Node is actually from undici library/package. As this library is written and maintain by Node team and part of Node runtime, we directly get fetch() function without installing it separately as external package.
But, if you want, you can still use it as project dependency using following command:
npm i undici
If following is the code we have:
const resp = await fetch("http://api.example.com/data");
Then we need to add fetch import statement as:
import { fetch } from "undici"; const resp = await fetch("http://api.example.com/data");
Yes, drop-in replacement!
Most of the time, we don't need this library unless we want to use latest and greatest feature of library that are yet not available within Node. But, doing so will add burden to manage the additional dependency. Plus, it will increase the bundle size as it is now a package used by our app than the runtime itself.
નામમાં શું રાખ્યું છે?
તારક મહેતાકા ઉલ્ટા ચશ્મામાં એક સીન છે, જેમાં જેઠાલાલ કહે છે, કે નુતને કીધું છે ને કે, "નામમાં શું રાખ્યું છે" તો બધા પુછે છે કે, આ "નુતન" કોણ? નુતન, વૈજ્ઞાનિક. પછી બધાને ખ્યાલ આવે છે, કે આતો ન્યૂટનની વાત કરે છે! ત્યાં પાછો પ્રશ્ન ઉભો થાય છે, કે "નામમાં શું રાખ્યું છે" એ વાક્ય ન્યૂટને થોડું કીધું હતું? એ તો શેક્સપીયર એ કીધું હતું. વાત સાચી છે, કે આ વાક્ય શેક્સપીયર એ કીધું હતું પણ જેઠાલાલનો જવાબ પણ રસપ્રદ છે, એ કહે છે - એ જ નામમાં શું રાખ્યું છે ન્યૂટન કે શેક્સપીયર!
"નામમાં શું રાખ્યું છે" આ વાત આટલા વર્ષો પેલા ઉચ્ચારણ પામી. તો પણ, આ નામની માયાજાળ ગઈ નથી. કોમ્પ્યુટર વિજ્ઞાનમાં એક અવતરણ(=quote) છે,
There are only two hard things in Computer Science: cache invalidation and naming things.
Phil Karlton
મતલબ કે, કમ્પ્યુટર સાયન્સમાં ફક્ત બે જ મુશ્કેલ બાબતો છે: કેશ ઇનવેલિડેશન અને નામકરણ.
એટલે ભલે "નામમાં શું રાખ્યું છે" એવું કહેવાય છે પણ કોમ્પ્યુટર વિજ્ઞાનવાળા પૂછો તો ખબર પડે કે, કેટલું અઘરું છે એ! બાકી તો ભાષાના નામ ખાલી "C" કે "D" કે "F" કોણ રાખે?! કોણ ભાષાનું નામ ઓક(=Oak) રાખે કે, મારી બારીની બહાર ઓકનું ઝાડ છે, એટલે મેં ભાષાનું નામ Oak રાખ્યું (જે પછી થી બદલાયને Java થયું).
TIL: You don't need dotenv in latest version of Node
Starting from Node v20.6.0, you don't need dotenv package to load the environment variables within process.env scope as Node now natively support loading the environment variables from default .env file or custom .env files such as .env.development or others.
There are two ways, you can use this feature.
1. Pass .env to the script as CLI flag: Consider the example where you've following two scripts in your package.json file.
"dev": "nodemon app.js", "start": "node app.js"
Then you can pass the .env file to the app.js script as value of --env-file CLI flag.
"dev": "nodemon --env-file=.env app.js", "start": "node --env-file=.env app.js"
Or you can pass different .env file based on the environment.
"dev": "nodemon --env-file=.env.development app.js", "start": "node --env-file=.env app.js"
2. Load within code using loadEnvFile(): Function loadEnvFile() is available within process module that we can import and optionally pass the .env file name to the function.
const process = require("process") // Loads the default .env file in current directoy. process.loadEnvFile() // OR pass a custom path process.loadEnvFile("./config/.env")
Now, you can use environment variables within process.env scope from the given environment file.
XWayland 26.1 RC1
ઓગસ્ટ 2026માં XWayland 26.1 RC1 ની જાહેરાત કરવામાં આવી. Wayland ની પ્રથમ આવૃત્તિ(=Version) આવી એને આજકાલ કરતાં લગભગ 14 વર્ષ (પ્રથમ આવૃત્તિ તારીખ - 22 October 2012) થઇ ગયા. Wayland માં હજુ પણ આપણે સંપૂર્ણ સ્થાનાંતર નથી કરી શક્યા. KDE અને GNOME જેવા મોટાં સોફ્ટવેર Wayland માં સ્થાનાંતર કરી ગયા પણ જે વર્ષોથી apps બનેલી છે X માં તેને ફરીથી લખવી Wayland માં, એ સરળ કામ નથી.
અહીં XWayland એક દુભાષિયા(=compatibility layer) તરીકે કામ કરે છે. X11 app ને લાગે છે કે તે સામાન્ય X server સાથે વાત કરી રહી છે; વાસ્તવમાં તે XWayland સાથે વાત કરે છે, અને XWayland બીજી બાજુ Wayland ની સાથે વાત કરે છે. એટલે KDE અને GNOME આ રીતે જૂની apps ને ટેકો(=support) આપે છે.
આ માત્ર જુના સોફ્ટવેરને ચલાવવાનો જુગાડ નથી, પણ ક્યારેક કોઈ વસ્તુ એક જ દિવસે નાશ પામતી નથી. દિવસો, મહિનાઓ, વર્ષો લાગે છે. ઘણીવાર આ પ્રકારે દુભાષિયાને લઈને કામ કરવું પડે છે, જેથી બધી aaps જે X માં બની છે, જે એની ઈકો-સિસ્ટમ છે, એ ધીરે ધીરે Waylandમાં સ્થાનાંતરિત થઇ શકે.
આ ઉપરથી બીજી એક વાત યાદ આવી - ઘણી વાર YouTube માં એવા વિડિઓ આવે છે, જેમાં વ્યકિત કહે છે, કે PHP is dead અથવા Java is dead અથવા Node is dead, મતલબ કે, હવે આ PHP કે Java કે Node કોઈ વાપરતું નથી, હવે એ ભાષા શીખવી નકામી છે, નોકરી નહિ મળે, હશે તો પણ જતી રહેશે, વગેરે વગેરે. પણ, હજુપણ લાખો નહિ પણ કરોડો apps આ ભાષાઓમાં છે, અને એ ક્યાંય જવાની નથી, જે એ બીજી કોઈ ભાષામાં ભવિષ્યમાં લખાશે તો પણ વર્ષો નીકળી જશે અને ત્યાં સુધી એ વપરાશમાં રહેશે. આતો વાત એવી છે, કે મેં એક YouTube માં વિડિઓ બનાવ્યો કે આ વિડિઓ જોવીને Node શીખો અને તમે એ વિડિઓ જોવીને Node શીખી ગયા. હવે મારે નવો વિડિઓ બનાવો છે તો હું કોઈ બીજી ભાષા પર બનાવીશ જેમકે Java. પણ, તમે Java શું કામ શીખશો? તમારે જરૂર શું છે શીખવાની? તમને Node આવડે છે અને એમાં તમારું કામ ચાલે છે. એટલે હું શું કરીશ કે પેલા તમને એમ કહીશ કે, Node હવે જૂની થઇ ગઈ, એ ધીમે ધીમે બાઝારમાંથી ગાયબ થઇ રહી છે - Node is dead. એક વાર ડરનો માહોલ થઇ ગયો એટલે તમે એ ડર માંથી છટકવા મને પૂછશો તો હું કહીશ કે Java શીખો અને તરત હું મારો આગળનો વિડિઓ પકડાવી દઈશ.
અંતે મુખ્ય વાત ઉપર પાછા આવીએ. કે, તરત જ સ્થાનાંતર શક્ય નથી - વિચારોનું પણ. ધીરે ધીરે બની શકે, ઘણીવાર વચલો માર્ગ પણ લેવો પડે તો ઘણી વાર થોડી બાંધ-છોડ પણ કરવી પડે અને પછી જ સંપૂર્ણ સ્થાનાંતર શક્ય છે.
ટ્યુરિંગ એવોર્ડ
નોબૅલ પ્રાઈઝ પાંચ જ વિષયોના સંશોધનમાં મળે છે. આ પાંચ વિષયો છે - ભૌતિક વિજ્ઞાન, રસાયણ વિજ્ઞાન, શરીર વિજ્ઞાન (અથવા દવા), સાહિત્ય, અને શાંતિ.
કોમ્પ્યુટરના સંશોધનમાં નોબૅલ પ્રાઈઝ મળતું નથી પણ એના બદલે એ જ કક્ષાની ખ્યાતિ ધરાવતું ટ્યુરિંગ પ્રાઈઝ એટલે કે ટ્યુરિંગ એવોર્ડ(=Turing Award) મળે છે. એલન ટ્યુરિંગ કે જે કોમ્પ્યુટર વિજ્ઞાનના પિતા તરીકે ઓળખાય છે, એમની યાદમાં આ અવોર્ડનું નામ રાખવામાં આવ્યું છે. એવોર્ડ જીતનારને એવોર્ડ ઉપરાંત $1 મિલિયન એટલે કે 10 લાખ ડોલર મળે છે અને જીવન પર્યાંત પ્રસિદ્ધિ ને આદર તો ખરો જ.
સૌ પ્રથમ આ એવોર્ડ એલન પર્લિસ(=Alan Perlis) આપવાંમાં આવ્યો હતો અને ત્યારબાદ કોઈ અસામાન્ય સંજોગોને બાદ કરતા લગભગ દર વર્ષે આપવામાં આવે છે.
સામુદાયિક ધ્યેયનો અભાવ
ઘણું લાંબા વખતથી આપણા બધાંનું મળીને એક જ એવું ઉદાત્ત જીવનધ્યેય આપણી દૃષ્ટિ સામે કશું જ રહ્યું નથી. બીજાં પ્રાણીઓ જેમ પોતપોતાની વ્યક્તિગત ઇચ્છાઓને કારણે છે છે અને પોતાની જરૂરિયાતો પૂરી કરવાના વ્યક્તિગત પ્રયત્નમાં આખી જિંદગી પસાર કરે છે, લગભગ તે જ સ્થિતિ આપણે મનુષ્ય હોવા છતાં આજે આપણી થયેલી છે. આપણું સમાજમાં દરેક યુગમાં વિદ્વાનો હતા, પંડિતો હતા, મહાન સંતપુરુષો હતા; ધનવાન, ઐશ્વર્યવાન પુરુષો હતા; એકથી એક ચડિયાતા એવા બળવાન, રણશુરા અને ધુરંધર યોદ્ધાઓ હતા; વિલક્ષણ બુદ્ધિશાળી મુત્સદ્દીઓ હતા; પરંતુ બધાંએ મળીને પોતાની શક્તિ અને બુદ્ધિથી પ્રાપ્ત કરવાનું કોઈ પણ સામુદાયિક ધ્યેય આપણી સામે ન હતું. જે ધ્યેયથી બધાંને ધન્યતા લાગે, બધાંને સરખી જ કૃતાર્થતા અને ગૌરવ લાગે અને જે બધાંના સહિયારા પરિશ્રમ અને ઐક્ય સિવાય, એકબીજા માટે એકબીજાને સંતોષપૂર્વક અને સાચા દિલથી કરવા પડતા સ્વાર્થત્યાગ સિવાય પ્રાપ્ત થવું શક્ય નથી એવું કોઈ પણ જીવનધ્યેય આપણી પાસે રહ્યું ન હતું. તેનાં અનિષ્ટ પરિણામો આપણે ભોગવતા આવ્યા છીએ, અને આજે પણ ભોગવીએ છીએ. હજી પણ આપણે બધાંના એકત્રિત સદ્ગુણો ને સ્વાર્થત્યાગથી પ્રાપ્ત થનારું ઉદાત્ત ધ્યેય આપણે સ્વીકાર્યું ન હોવાથી આપણા બધાંની શક્તિમાં કે કતું ત્વમાં એકરસતા આવી શકતી નથી. આપણું બધાંમાં એકતા નિર્માણ થઈ બધામાં એક જ પ્રાણ સંચરવા લાગતો નથી. આપણા સાધુચરિત અને પુરુષાર્થી આગેવાનો આપણને સ્વાર્થત્યાગને અને ઐક્યનો ઉપદેશ કરી રહ્યા છે તોપણ હજી તે આપણા ચિત્તમાં જડ ઘાલતો નથી.
~ વિવેક અને સાધના પુસ્તક માંથી, લેખક કેદારનાથ
TIL: Node doesn't have environments
We all are familiar with different types of environments where our application is run:
- Development
- Testing
- Staging
- Production
People in Node use NODE_ENV environment variable to set/get the environment. But, as mentioned on the official getting started guide,
There is no difference between development and production in Node.js
Libraries use of NODE_ENV is purely conventional.
But, if you want to use NODE_ENV then the only possible value it can have is production.
setting NODE_ENV to anything but production is considered an antipattern.
Refer the Node.js, the difference between development and production for the exact details.
Emacs Minipost Pt. 6
Do you remember that in last Minipost we did some modifications in main.c file and saved it again for the sake of practice? I wants you to open that directory/folder location in file manager.
Notice we're seeing two files - main.c file and another file that has same name but ends with ~ e.g. main.c~. This is how Emacs save the backup of your file in case something goes wrong.
If you want, we can disable this backup saving by configuring this option in Emacs config file. Open the Emacs config file and add following:
(setq make-backup-files nil)
Follow these steps:
- Press
ctrl-xctrl-fand open the Emacs config file (write the relative or absolute path). - Do the modification as suggested above. e.g. add
(setq make-backup-files nil)in config file. - Press
ctrl-xctrl-sto save the config changes. - Go to file manager and delete
main.c~file. - Press
ctrl-xctrl-fand open themain.cfile. - Remove that extra
printf()that we added previously. - Press
ctrl-xctrl-sto save the changes inmain.cfile. - Go to the file manager and see if we now have
main.c~file or not? - Confirm that we don't have. If that is the case, yay! If not then try closing and then re-opening the Emacs.
Summary: We disabled the backup saving functionalities and practice the whole save, open, save flow.
શોખ
તમને કોઈ વિષયનો શોખ છે. તમારો એ મનગમતો વિષય હોય એમાં તમે આનંદથી સમય પસાર કરો છો. ક્યારેક કંટાળો આવે ત્યારે એ તમારો શોખ કંટાળો દૂર કરે છે. ક્યારેક થાક લાગે છે ત્યારે એ તમારો શોખ થાક દૂર કરે છે. ક્યારેક તમે હતાશ થાવ ત્યારે એ તમારો શોખ હતાશા દૂર કરે છે. ક્યારેક તમારે તમારું મગજ એક જગ્યાએ થી બીજી જગ્યાએ વાળવું હોય / divert કરવું હોય ત્યારે એ એ તમારો શોખ તમને તાજગી આપે છે. પણ...
તમને એવો વિચાર આવ્યો અથવા કોઈકે તમારા મગજમાં એવો વિચાર રોપ્યો કે, આ શોખથી પૈસા કમાવી શકાય તો? અને તમે ગણતરી મંડી. થયું પછી!
તમારો શોખ હવે ખાલી આનંદ માટે નથી, પણ પૈસાની ગણતરી લાગી છે એના ઉપર. અને હવે તમારો શોખ તમને કંટાળો આપે છે. કારણ કે એ શોખને તમારે આવકના સાધન તરીકે પ્રસ્તુત કરવાનો છે. એ શોખથી તમને થાક લાગે છે. કારણ કે, તમારે સતત પ્રયત્નશીલ રહેવાનું છે, આવક ઉભી કરવા. એ શોખ તમને હતાશા તરફ લઇ જાય છે, કારણ કે, એમાંથી જરૂરી આવક ઉભી થતી નથી. તમે હવે તમારા વિચારો બીજી તરફ વાળી શકતા નથી. કારણ કે, તમારો શોખ જ તમારો મુખ્ય વિચાર થઇ ગયો છે. ક્યાં જશો હવે?
જરૂરથી આમાં અપવાદ હોય શકે છે, અને અપવાદો ઘણા છે. ભારત સરકાર તરફથી મળેલા પુરસ્કારોની યાદી તપાસશો તો તમને જરૂરથી ઘણા લોકો મળશે જેમનાં શોખ અને વ્યવસાય(જો એ લોકો પણ એ રીતે જોતા હોય તો!) એક જ હશે. પણ આવા વિરલા કેટલા? આ "રાસાયણિક" મિશ્રણ જોખમી નીવડી શકે છે, કૃપા કરીને જોઈતી તકેદારી લો.
AI હવે દરેક ડિજિટલ અનુભવનો ભાગ
આજે ટેક દુનિયામાં સૌથી મોટી ચર્ચા આર્ટિફિશિયલ ઇન્ટેલિજન્સ(AI)ની આસપાસ છે. તાજા અહેવાલો મુજબ Googleના Gemini એપ યુઝર્સની સંખ્યા 1 બિલિયન એટલે કે એક અબજ સુધી પહોંચી ગઈ છે. આ સમાચાર બતાવે છે કે AI હવે માત્ર ટ્રેન્ડ/હવા નથી, પરંતુ રોજિંદા જીવનનો મહત્વપૂર્ણ ભાગ બની રહ્યો છે. ડેવલપર્સ, વિદ્યાર્થીઓ અને વેપારીઓ માટે AI વધુ ઝડપી, સરળ અને ઉપયોગી બનતું જાય છે.
બીજી તરફ, કંપનીઓ હવે AI સાથે નવા પ્લેટફોર્મ અને પ્રોડક્ટ્સ પર પણ જોર આપી રહી છે. સ્ટાર્ટઅપ્સથી લઈને મોટા ટેક જાયન્ટ્સ સુધી, દરેક કંપની પોતાની સર્વિસમાં AI જોડીને સ્પર્ધામાં આગળ રહેવા માંગે છે. આથી આવનારા મહિનાઓમાં વધુ સ્માર્ટ એપ્સ, ઝડપી ઓટોમેશન અને નવા ડિજિટલ અનુભવ જોવા મળશે.
Emacs Minipost Pt. 5
Do you remember that in previous Minipost, we created a main.c file? In this Minipost, we're going to open it.
Open the Emacs and press ctrl-x ctrl-f. It asks you the path/file name that you want to open.
P.S. It supports auto-complete. So, just write few characters and press Tab. Emacs will auto-complete path/file name for you!
Type a path/file name and press Enter. Emacs will open the file!
Let's modifies the code and add one more printf().
#include <stdio.h> int main(int argc, char** argv) { printf("hello, world\n"); printf("how are you?\n"); return 0; }
We know how to save, right? ctrl-x ctrl-s. Press.
We now know how to create, open, and save the file in Emacs! Yay!
Summary: Now, you know how to open an existing file and save it with modified content.
આઠ દાયકાની આજાયબી
આપણે મનગમતી ફિલ્મ માટે દાયકાઓ સુધી બ્લેકમાં ટિકિટ ખરીદી છે અને હજુ આજેય દક્ષિણ ભારતમાં ખરીદીએ છીએ. બેવકૂફ અભિનેતા અને અભિનેત્રીઓ આપણા યુવક અને યુવતીઓના આદર્શ છે, રોલ મોડેલ છે. ઠોઠ લોકો પણ સ્ટાઈલિશ દેખાવા મથે છે. તેમને સારા દેખાવામાં રસ છે, સારા હોવામાં રસ નથી. આપણે એક સામાન્ય દાખલો મેળવવા માટે સરકારી કાર્યાલયમાં વધારાના પૈસા પણ આપીએ છીએ. આપણે ગમે તેટલું ભણેલા છીએ તો પણ ટ્રાફિક પોલીસની પકડમાંથી છટકવા માટે ખિસ્સામાંથી એકાદ નોટ સરકવા દઈએ છીએ. આપણે આગળ નીકળી જવા માટે ગમે ત્યારે આપણા વાહનો રોંગ સાઈડમાં કે ફૂટપાથ પર પણ ચડાવી દઈએ છીએ. બે નંબરના ભ્રષ્ટ આચરણથી ઘરમાં આવેલા નાણાં જોઈને આપણા દેશની માનવંતી ગૃહિણીઓના ચહેરા પર અજાયબ સ્મિત ફરકે છે. એ સ્મિત કૈકેયી, મંથરા કે આમ્રપાલી જેવું છે.
આ બધા જ આપણા પોતાના વિનાશના રાજમાર્ગો છે. જે આપણે પસંદ કરેલા છે. તમારી પસંદગીઓ જ તમારું ભવિષ્ય નક્કી કરે છે. પ્રજાને ખોટા રસ્તેથી પાછી વાળવી એ તો મહાપુરુષોનું અથવા સમાજમાં અત્ર તત્ર ફેલાયેલા અનામી સત્પુરુષોનું કામ છે.
~ ગુજરાત સમાચાર ના તારીખ 15-ઓગસ્ટ-2026માં લખાયેલા તંત્રી લેખમાં થી. જોકે હવે "તંત્રી લેખ" એવું લખતા નથી, પણ લખાણ આ કોલમમાં ખુબ સુંદર રીતે લખાય છે. બીજું ના વંચાય તો કઈ નહિ આ કોલમ વાંચવી.
AI ડેટા ચોરી સામે નવું હથિયાર - નવા પ્રકારના ફોન્ટ
AI સતત નવા ડેટા માટે રાત-દિવસ જોયા વગર દુનિયા આખીની વેબસાઈટ, બ્લોગ્સ, ફોટા, વિડિઓ, દસ્તાવેજો, વગેરે સ્ક્રેપ કર્યા જ રાખે છે. AI ને નવો ડેટા જોઈએ છે, જેથી એ પોતાની ગુણવત્તા, પોતાની આવડત સુધારી શકે.
આની સામે ઘણા લોકોને વાંધો છે, ખાસ કરીને સર્જનાત્મક(=creative) કાર્યો સાથે જોડાયેલા લોકો. AI એમનાં સર્જનાત્મક કાર્યોનો ઉપભોગ કરે છે, એમાંથી શીખે છે, અને એવું અથવાતો ક્યારેક એનાથી પણ ચડિયાતું બનાવે છે. આતો યંત્રો સીધા માનવો જોડે, માનવોની જેમાં તાકાત(=strength) છે એમાં હરીફાઈ/સ્પર્ધામાં ઉતાર્યા! આ ઉપરાંત વળતર, જરૂરી સંદર્ભ, શ્રેય, અને માનવ સબંધો ઉપરાંત લાગણીઓને લગતા મુદ્દાઓ પણ છે. આ મુદ્દાઓનો હજુ સુધી કોઈ તોળ(=solution) નથી આવ્યું એના ઉપાયો શોધવાનું ચાલુ જ છે.
એક ઉપાય હાલમાં ચર્ચામાં આવ્યો છે - ફોન્ટ, નવા પ્રકારના ફોન્ટ.
કમ્પ્યુટરમાં જે લખાણ વાંચો છો, એ ફોન્ટ છે. ફોન્ટ ગ્લિફના બનેલા છે જેમ બારાક્ષરી મૂળાક્ષરોની બનેલી છે. કમ્પ્યુટર જયારે વાક્યને તમારા વાંચવા માટે, કમ્પ્યુટર પર દોરે છે, ત્યારે એની પાછળ અત્યંત જટિલ અને રસપ્રદ ગણતરીઓ ગણાય છે. એટલું જ નહિ, આ ગણતરીઓ થયા પછી પણ કેટલીક પ્રક્રિયાઓ(=processes) થાય છે. એમની એક છે - લીગેચર(=ligatures). અમુક અક્ષરો જો સાથે લખાય તો તે વધુ સારા લાગે, વાંચવામાં સરળ પડે, અને આંખોને પણ તકલીફ ન પડે એ માટે લીગેચર પ્રક્રિયા થાય છે. તો આ લીગેચર ને સરળ ભાષામાં સમજીએ જેથી નવા પ્રકારના ફોન્ટને કઈ રીતે આ લડાઈમાં લઇ શકાય એ સમજવામાં સરળતા પડે.
ફોન્ટ (ફાઈલ)માં લીગેચર નું એક કોષ્ટક(=table) હોય છે, જે સંકેત(=hint) આપે છે કે જયારે અમુક શબ્દ સાથે આવે ત્યારે એ શબ્દોને આલગ આલગ ના દોરતાં તેમને વણાંક સાથે સાથે દોરવા. જેથી શબ્દ સાચો લખાય ઉપરાંત વાંચવામાં પણ સરળ પડે અને ઉઠાવ પણ આવે.
ઉદાહરણ તરીકે "વ્યકિત" શબ્દ લઈએ. તમે આ શબ્દને સરળ રીતે વાંચી શકો છો. કેમ કે, ફોન્ટમાં આ શબ્દ માટે જરૂરી સંકેતો આપેલા છે. જેમકે, જો "ક" અને "ત" સાથે આવે તો "કત" ન લખતાં "ક્ત" લખવું. "કત" માં બંને અલગ અક્ષરો છે એટલે બંને સ્વતંત્ર રીતે વંચાશે. જયારે, બીજા "ક્ત" માં બને જોડાઈ ગયા છે આથી "ક" નું સ્વતંત્ર અસ્તિત્વના રહેતા "ક્ત" સાથે વંચાશે. એમાં પણ જો " િ" + "ક" + "ત" આવે તો "કિત" ના દોરતા "ક્તિ" દોરવું. આ પ્રકારનો સંકેત કોષ્ટકમાં લખેલો હશે.
જો હું મારા કમ્પ્યુટર સેટિંગમાં જઈને લીગેચરની પ્રક્રિયા જે દરેક વખતે થાય છે, એને બંધ કરી દવ તો "વ્યકિત" આ રીતે દોરાશે.
જોયું. વાંચવામાં અઘરું પડે છે. હવે તમને જો લીગેચર વિષે ખબર પડી ગઈ હશે એમ ગણી આગળ વાત આગળ ચલાવીએ.
અત્યાર સુધી આ લીગેચર કોષ્ટક એક, બે, કે ત્રણ અક્ષરોના સંકેત(=hint) પૂરતું માર્યાદિત હતું. પણ નવા પ્રકારના ફોન્ટ, જેમકે ShieldFont આને આગળ લઇ જઈ શબ્દ સુધી લીગેચરના સંકેતો મુક્યા.જેમ " િ" + "ક" + "ત" મળે તો એનું "ક્તિ" કરવું એમ ShieldFont એવું કહે છે કે, જો ધારો કે, "engine" શબ્દ મળે તો એમાં જોડાણ-બોડાણ કાંઈ નહિ આખેઆખો શબ્દ જ બદલી નાખવો. જેમકે, "engine" નું "horse" અથવાતો "morning" નું "tunnel" અને "poison" નું "nector" કરી નાખવું, વગેરે.
આમ કરવાથી વાંચનાર માટે તો સાચા જ શબ્દો દોરાશે પણ AIના સોફ્ટવેર જે વાંચતા નથી અને સ્ક્રેપ કરે છે એને જેમ લીગેચરની પ્રક્રિયાનો સમાવેશ નથી થતો એમને કાંઈક બીજું જ હાથમાં આવશે! જેમકે, વાંચનારને કાંઈક નીચે પ્રમાણે વંચાશે -
"This is a text written in English. Read it aloud."
પણ AIની પાસે કાંઈક નીચે પ્રમાણે મળશે.
"This is a concert twined in English. Reset it aloud"
જોવી લો! ક્યાંથી ક્યાં મતલબ ચાલ્યો ગયો! છેને બાકી તોડ?
અંતે આ પ્રકારની જે સુવિધા આપે છે, એ ShieldFontની વેબસાઈટ જોવાનું ચુકતા નહિ. ત્યાં તમને આ લેખ કરતા વધુ જાણવા મળશે ઉપરાંત તમને થતા પ્રશ્નોના જવાબ અને live demo પણ છે. આ ઉપરનું ઉદાહરણ "This is a text..." મેં ત્યાં live demo માં અજમાવીને જ અહીં લખ્યું છે.
Emacs Minipost Pt. 4
Open the Emacs. You should see the following screen.
Remove these two lines (or comments) from the scratch pad and type the following code.
P.S. You might face difficulty while adding the indentation. For now, stay with me and type spaces literally instead of tabs.
#include <stdio.h> int main(int argc, char** argv) { printf("hello, world\n"); return 0; }
We know how to save the file, right? Yes, ctrl-x ctrl-s. Press. But, we haven't created the file yet. So, Emacs first ask to create the file and then will save the content of it.
Here, instead of typing the name of the file, you can type the full path if you don't want to save at the default location that Emacs is suggesting and then press Enter.
Congratulation on creating and saving the files using Emacs!
Summary: Now you know how to create and save the file from Emacs only!
ફ્રાન્સ ૧૧ ઓગસ્ટથી અનિચ્છનીય ટેલિમાર્કેટિંગ કોલ્સ પર પ્રતિબંધ મૂકશે
શું તમને માર્કેટિંગ એટલે કે વસ્તુ જાહેરાતના ફોન આવે છે? શું તમે પૂર્વ મંજૂરી વગર આવતા આ પ્રકારના ફોનથી કંટાળી ગયા છો? તો તમારા માટે તો નહીં પણ ફ્રાન્સના લોકો માટે સરકાર કાયદો લાવી રહી છે કે, પૂર્વ મંજૂરી વગર જો ટેલેમાર્કેટિંગના ફોન આવશે તો દંડ થશે.
આ કાયદો ૧૧ ઓગસ્ટથી લાગુ પડશે. નિર્ણય ૧૧ ગ્રાહક સંસ્થાઓની સંયુક્ત માંગ બાદ ફ્રેન્ચ સંસદે મંજૂર કરેલા કાયદા હેઠળ લેવામાં આવ્યો છે. અત્યાર સુધી કેટલીક શરતો સાથે માર્કેટિંગ કૉલ્સની મંજૂરી હતી, પરંતુ નવા નિયમનો મુખ્ય હેતુ લોકોને વારંવાર આવતા અનિચ્છનીય અને પરેશાન કરનારા ફોનથી સુરક્ષિત કરવાનો છે.
નવા કાયદા હેઠળ વ્યક્તિ કે કંપની જો ગ્રાહકની મંજૂરી વિના માર્કેટિંગ ફોન કરશે તો તેના પર દંડ થઈ શકે છે. આવા અનધિકૃત ફોનની ફરિયાદ કરવા માટે જાહેર વેબસાઇટની વ્યવસ્થા પણ કરવામાં આવી છે, જેથી ગ્રાહકો નિયમનો ભંગ કરનારાઓની જાણ કરી શકે. આ પગલાને ફ્રાન્સમાં ગ્રાહક અધિકારોને મજબૂત કરવા અને ટેલિમાર્કેટિંગમાં વધુ કડક નિયંત્રણ લાવવાના મહત્વપૂર્ણ પ્રયાસ તરીકે જોવામાં આવે છે.
ઓપન સોર્સ
કોમ્પ્યુટરના ક્ષેત્રમાં ઓપન સોર્સ(=open source) શબ્દ ઘણો પ્રચલિત છે. કોઈ સોફ્ટવેર ઓપન સોર્સ છે એનો મતલબ એ સોફ્ટવેરનો કોડ વાંચવા માટે ઉપલબ્ધ છે, સુધારા વધારા કરવા માટે ઉપલબ્ધ છે, બીજાને આપવા માટે ઉપલબ્ધ છે, એને બીજાને પૈસાથી વેચવાં માટે ઉપલબ્ધ છે, આનાથી બીજા સોફ્ટવેર બનાવવા માટે ઉપલબ્ધ છે. આ પ્રકારની સ્વતંત્રતા કેટલા અંશે ઉપલબ્ધ છે, એ સોફ્ટવેરના લાઇસન્સ પર આધાર રાખે છે. જેના વિષે આપણે આગળ વાત કરીશું.
આ એક રસપ્રદ વાત થઇ, નહિ?
ધારો કે તમે કોઈ ફિલ્મ પર કામ કરી રહ્યા છો અને એની વાર્તા/કથા(=script) તમે જાહેરમાં મૂકી દીધી છે, અને એ કોઈ બીજા વ્યક્તિ વાપરી શકે, એમાં ફેરફાર કરી ને બીજી કથા બનાવી શકે અને એને મફતમાં કે પૈસાથી બીજાને વેચી શકે!
ધારો કે તમે કોઈ સંગીત/ગીત પર કામ કરી રહ્યા છો એની શબ્દ અને સંગીત રચના તમે જાહેર કરી દીધી છે, કોઈ પણ એનો ઉપયોગ કરીને એ ગીત બનાવી શકે, જાહેરમાં મૂકી શકે, વગાડી શકે, અને મફતમાં કે પૈસાથી વેચી શકે!
તમને એવા વિચાર પણ આવે કે, આમ થોડું હોય, મહેનત એક વ્યક્તિ કરી, અને બીજો પૈસા કમાય? આમ થોડું ઘર ચાલે? જાહેર કરનાર વ્યક્તિ કેવો કહેવાય? વગેરે વગેરે. પણ, કરોડો નહિ તો પણ લાખોની સંખ્યામાં ઓપન સોર્સ સોફ્ટવર ઉપલબ્ધ છે, જેનો તમે ઉપયોગ કરી શકો છો, વાપરી શકો છો, બીજાને આપી શકો છો, એમાં સુધારા-વધારા કરી શકો છે, અને એને મૂળ વ્યક્તિ કે જેને એ સોફ્ટવેર બનાવ્યો એને પૈસા આપ્યા વગર બીજાંને વહેંચી શકો છો.
જે તે કોડ/સોફ્ટવેર કેટલા અંશે ફેરફાર માટે, વેચાણ માટે, ઉપલબ્ધ છે એ એની સાથે વાપરવામાં આવેલ લાઇસન્સ પર આધાર રાખે છે. ઘણા પ્રકારના લાઇસન્સ ઉપલબ્ધ છે, સોફ્ટવેર બનાવનાર વ્યકિત કોઈ પણ લાઇસન્સ વાપરી શકે અને એના આધારે સોફ્ટવેર/કોડની સ્વતંત્રતા નક્કી થાય.
જેમકે, કોઈ વ્યક્તિએ મ્યુઝિક પ્લેયર(=music player) નો સોફ્ટવેર બનાવ્યો અને એનો કોડ એને MIT લાઇસન્સ સાથે જાહેરમાં મુક્યો. તો હવે આ લાઇસન્સ પ્રમાણે કોઈ પણ વ્યક્તિ આ સોફ્ટવેરનો કોડ લઈને પોતાના માટે અલગથી મ્યુઝિક પ્લેયર બનાવી શકે છે, એમાં સુધારો કરીને વાપરી શકે છે, બીજાને આપી શકે છે, પૈસા લઈને વહેંચી શકે છે, એનો ઉપયોગ કરીને બીજો સોફ્ટવેર - જેમકે વિડિઓ પ્લેયર(=video player) બનાવી ને વહેંચી શકે છે. અંતે, પોતે ભલે બીજાનો કોડ વાપરીને સોફ્ટવેર બનાવે. પણ પોતાનો સોફ્ટવેરનો કોડ ના પણ આપે. MIT લાઇસન્સમાં જેમ સ્વતંત્રતા મળે છે, એમ જવાબદારી નથી આવતી. એટલે કે, મૂળ વ્યક્તિ પહેલેથી કહી દે છે, કે જો આ સોફ્ટવેરથી કાંઈ નુકસાન થાય તો અમારી જવાબદારી નથી, તમારો ડેટા ઉડી જાય, કોમ્પ્યુટરમાં નુકસાન થાય, ગણતરીમાં નુકસાન થાય તો પણ અમારી જવાબદારી નથી.
આગળના ફકરામાં એક વાક્યનો ભાગ અહીં ફરીથી લખું, "પોતે ભલે બીજાનો કોડ વાપરીને સોફ્ટવેર બનાવે. પણ પોતાનો સોફ્ટવેરનો કોડ ના પણ આપે." અહીં તમે બીજાનો કોડ લીધો પણ તમે એમાંથી બનાવેલા સોફ્ટવેરનો કોડ અપાતા નથી. એવું જો મૂળ બનાવનારને ના કરવા દેવું હોયતો એ સોફ્ટવેરને GNU GPL લાઇસન્સ સાથે સોફ્ટવેરને જાહેરમાં મૂકી શકે, કેમ કે આ સોફ્ટવેરમાં આગળ જણાવેલ સ્વતંત્રતા તો મળે જ છે પણ એમ એક મુદ્દો વધુ ઉમેરાય છે અને એ છે કે, તમે સોફ્ટવેરમાં સુધારો વધારો કરો તો એ સુધારા વધારા કરાયેલ સોફ્ટવેરનો કોડ પણ બીજાને આપવાનો છે અને એ પણ આજ લાઇસન્સ સાથે જેથી આ સાંકળ તૂટે અહીં. એમાં પણ આગળ જણાવેલ જવાબદારી આવતી નથી.
ઘણા લોકો GPL ને કેન્સર લાઇસન્સ કહે છે, કારણકે એ ફેલાય છે જેમ આગળ કીધું એમ. વધુમાં એ લાઇસન્સથી તમે કોઈ સોફ્ટવેર બીજાનો આપો - મફતમાં કે પૈસાથી તો તમારે એ લાઇસન્સ પ્રમાણે એને કોડ પણ આપવો જ પડે અને એ પણ સ્વતંત્ર છે સુધારા વધારા કરવામાં. આ વાત ખાસ કરીને એવી કંપનીઓને લાગુ પડે છે, જેમણે મૂળ સોફ્ટવેરનો ઉપયોગ કર્યો પણ હવે એમાં સુધારો કરીને ઓપન સોર્સ નથી કરવો, એ સુધારો બહાર પડવો નથી.
કંપનીઓને પોતાની અલગ દ્રષ્ટિ છે આ વિષયને જોવાની. ઘણી કંપનીઓ સોફ્ટવેરનો કોડ જાહેર નથી કરતી. કેમકે, કોડમાં એમના ઉદ્યોગનું રહસ્ય છે, અથવાતો એમનો સોફ્ટવેર એજ આવકનો સ્ત્રોત છે, જો એ ઓપન સોર્સ કરશે અને બીજો લોકો જાતે કોડમાંથી સોફ્ટવેર બનાવી લેશે તો આવક બંધ થઇ જશે અથવાતો એમની પાસે કોડ જશે તો બીજા પાસે એમાં સુધારા-વધારા કરાવી લેશે - ઓછી કિંમતથી કે મફતમાં. તો ઘણી કંપની ગોપનીયતાના લીધે ઓપન સોર્સ નથી કરતી. ઓપન સોર્સ કરવાથી કોઈ વ્યકિત એ કોડ વાંચશે અને જો એને એમાં ખામી મળી તો એ ખામીથી સોફ્ટવેર હેક કરીને ડેટા ચોરી ચોરી લેશે, વગેરે વગેરે.
તેમ છતાં ઘણી વાર વ્યક્તિ સારા ઉદ્દેશ્ય સાથે કોડને ઓપન સોર્સ કરે છે. એનો ઉપયોગ બીજો વ્યક્તિ, ત્રીજી કંપની વાપરે છે અને એમાંથી પૈસા કમાય છે. જેમકે, મરાક સ્ક્વાયર્સ(=Marak Squires) કે faker.js કરીને એક લાયબ્રેરી બનાવી જે ફેક ડેટા બનાવે, તમારે જેવા જોઈએ એવા. આ લાયબ્રેરી સોફ્ટવેર ટેસ્ટ કરવામાં ખુબ વપરાતી. અને કંપનીઓ કરોડો કમાતી, પણ બનાવનારને કઈ મળતું નહિ એટલે એને લાયબ્રેરી ઉડાડી દીધી. એ સમયે ખુબ અંધાધુંધી ફેલાયી હતી!
બીજો પણ એવો એક કિસ્સો છે, જેમાં વ્યક્તિ સોફ્ટવેર ઓપન સોર્સ કરે છે અને વારસો સુધી જાણવણી કરે છે, પૈસા વગર અને જયારે એમાં કઈ ખામી જોવા મળે છે ત્યારે જે વ્યક્તિ એ સોફ્ટવેર વાપરતો હોય એ બનાવનારને ઝડપથી ખામી દૂર કરવાનું કહે છે, મફતમાં, તરત, ઓર્ડરથી. વળી પોતે એમાંથી પૈસા કમાય છે!
તો એની સામે સારા ઉદાહરણો પણ જોવા મળે છે. RedHat કરીને કંપની કે જે $32 બિલિયોન એટલેકે 3243224300000.00 રૂપિયામાં IBM એ ખરીદી એ પુરી કંપની ઓપન સોર્સ સોફ્ટવેર પર ચાલે છે, ઓપન સોર્સ સોફ્ટવેરને સારો બનાવી એનો સપોર્ટ આપે છે, વહેંચે છે, અને મૂળ બનાવનાર વ્યક્તિને પણ સમયાંતરે પૈસા આપતા રહે છે, કામમાં મદદ કરતા રહે છે.
ઘણા લોકો સોફ્ટવેરને ઓપન સોર્સ કરીને ઋણ ચૂકવે છે. એમનું એવું માનવું છે, કે બીજા ઓપન સોર્સ સોફ્ટવેરથી જ્ઞાન મળ્યું તો એમાંથી બીજા સોફ્ટવેર બનાવી ઓપન સોર્સ કરીએ જેથી બીજા લોકોને પણ નવા જ્ઞાનનો મોકો મળે.
ઘણા લોકો એને મૂળભૂત હક તરીકે જોવે છે. જેમકે, GNU.org વાળા મને છે કે બધા સોફટરે ઓપન સોર્સ જ હોવા જોઈએ. તમારે એના પૈસા લેવા હોય તો લઇ શકો પણ એનો કોડ તો જાહેર જ હોવો જોઈએ, એમાં શું લખ્યું છે, અમારો કેટલો ડેટા તમે લો છે, બીજું શું શું કરો છ એ બધું શુ લખ્યું છે, એ અમે જોવી શકતા હોવા જોઈએ અને સાથે એમાં સુધારો-વધારો પણ કરી શકતા હોવા જોઈએ. GNU.org વાળાએ ઘણા સોફ્ટવેર ઓપન સોર્સ કર્યા છે GPL લાઇસન્સ સાથે અને કેટલાક તો એવા સોફ્ટવેર છે, જે આખી દુનિયા વાપરે છે, મફતમાં, જો તમે કોમ્પ્યુટરથી ઈન્ટરનેટ વાપરતા હોય તો સમજો કે GNU.org વાળાએ લખેલા ઘણા સોફ્ટવેર વપરાતા હશે અને ત્યારે એ વેબસાઈટ તમે જોઈ શકતા હશો. અને જો તમે એન્ડ્રોઇડ મોબાઇલ વાપરો છો તો એમાં એમના ઘણા સોફ્ટવેર છે, જે તમને દેખાતા નથી પણ અંદર સતત વપરાય છે.
GNU.org વાળા જયારે બધા જ સોફ્ટવેર ઓપન સોર્સ હોવા જોઈએ એવું મને છે તો ઘણા એવું મને છે, બધા નહી તો અમુક મહત્વના સોફ્ટવેર તો ઓપન સોર્સ જ હોવા જોઈએ. જેમ કે, Ladybird Browser વાળા બ્રોઉસર બનાવે છે ઓપન સોર્સ અને મફતમાં પણ.
અંતે એક મહત્વની વાતનો ચોખ પડવો છે એ કે - ઓપન સોર્સ મફત હોય શકે અને ના પણ હોય. પણ એનો કોડ તો જાહેર જ હોય.
Emacs Minipost Pt. 3
Go ahead and create a new file with name main.c. Right-click the file and open with Emacs. It should looks like this:
Now, type the following code.
#include <stdio.h> int main(int argc, char** argv) { printf("hello, world\n"); return 0; }
After you typed this code, it should look like this.
We need to save the file with this code. To do so, we need to type ctrl+x and then ctrl+s meaning that pressing ctrl and then x and then s while keep pressing ctrl. After successful save, you should see a message at the end of the editor in single line as follows:
Congratulation on modifying and saving the file using Emacs. Go ahead practice now!
Summary: Now you know how to save the file in Emacs - ctrl+x ctrl+s.
ષટ્-કર્મ
આ છ પ્રકારના કર્મોને ઋષિઓએ ષટ્-કર્મ કહ્યાં છે.
૧. શાંતિ કર્મ,
૨. વશીકરણ,
૩. સ્તંભન,
૪. વિદ્વેષણ,
૫. ઉચ્ચાટન, અને
૬. મારણ
ષટ્-કર્મ લક્ષણ
જે પ્રયોગથી કોઈપણ પ્રકારના અવરોધ શાંત થાય છે, અથવાતો અનિષ્ઠ ગ્રહોને શાંત કરવામાં આવે છે એને શાંતિ કર્મ કહેવામાં આવે છે.
જે પ્રયોગથી સ્ત્રી, રાજા, શત્રુ અથવા ઇષ્ટ વશ થાય છે, એટલે કે, પોતાની ઇચ્છા મુજબ વર્તે છે, તેને વશીકરણ કહેવામાં આવે છે.
જે પ્રયોગથી અગ્નિ, પાણી, દુશ્મનના પરાક્રમ અથવા દુશ્મનની સેનાને રોકવામાં આવે છે અથવાતો અવરોધ ઉત્પન્ન કરી શકાય છે તેને સ્તંભન કર્મ કહેવામાં આવે છે.
જે પ્રયોગથી બીજા વ્યક્તિના પ્રેમને તોડી નાખવામાં આવે છે તેને વિદ્વેષણ કહેવામાં આવે છે.
જે પ્રયોગથી વ્યક્તિ પોતાના સ્થાનથી ભાગી જાય છે તેને ઉચ્ચાટન કહેવામાં આવે છે.
જે પ્રયોગ વ્યક્તિના મૃત્યુનું કારણ બને છે તેને મારણ કહેવામાં આવે છે.
~ રાવણ સંહિતા
જેફ ડીન અને સંજય ઘેમાવતની ગૂગલમાંથી વિદાય
DeepMind(=ડીપ માઇન્ડ) નામથી ગૂગલનો એક વિભાગ છે, જેની અંદર AIનો વિભાગ પણ આવે છે. આ વિભાગના નેતૃત્વમાં કેટલાક ફેરફાર આવ્યા જેના વિષે ગૂગલના CEO સુંદર પિચાઈએ લેખ લખીને માહિતી આપી. આ લિંક પર જઈને એ લેખ વાંચી શકો.
આ લેખના એક ફકરામાં જે વાત કરી છે, એ વિષે અહીં ધ્યાન દોરવું છે અને તે છે, જેફ ડીન અને સંજય ઘેમાવતની ગૂગલમાંથી વિદાય. જેફ અને સંજય ગૂગલમાં આશરે 27-વર્ષથી હતા અને હમણાં એમને ગૂગલમાંથી વિદાયલીધી*. આ એક મોટી વાત છે અને એ એટલી મોટી કે ગૂગલનો શેર 5% પડી ગયો.
જેફ અને સંજય ગૂગલમાં "Google Senior Fellows" પદ પર હતાં. લેવલ(=level) 11 તરીકે ઓળખાતા આ પદ પર ફક્ત બેજ વ્યક્તિ હતાં અને તે આ બંને.
લેવલ 1 પર IT સપોર્ટ સ્ટાફ આવે છે. કોલેજમાથી જે એન્જીનીઅર્સ જોડાય એમને લેવલ 2 મળે. જો માસ્ટર ડિગ્રી સાથે એન્જીનીઅર્સ જોડાય તો લેવલ 3 મળે. લેવલ 4 માટે Ph.D. જોઈએ. અને મહેનત કરતાં લેવલ 5 પર પહોંચી શકાય. અને મોટાભાગના એન્જીનીઅર્સ અહીં સુધી જ રહે છે. લેવલ 6 મા તો એવાં 10% જ એન્જીનીઅર્સ આવે છે જેમનાં લીધે કોઈ મોટો પ્રોજેક્ટ સફળ થયો હોય. લેવલ 6 માં રહીને સતત મોટા પ્રોજેક્ટ સફળતાપર્વક આપવાથી લેવલ 7 પર પહોંચી શકાય. લેવલ 8 - Principal Engineers - માં એવા એન્જીનીઅર્સ આવે છે જે ગૂગલની મોટી પ્રોડક્ટ સાથે સંકળાયેલા હોય અને એમનું મહત્વનું યોગદાન હોય. ત્યાર બાદ આવે છે લેવલ - 9 - Distinguished(=પ્રતિષ્ઠિત) Engineers - જેમનું નામ આદર સાથે લેવાતું હોય ગૂગલમાં. લેવલ 10 એતો સન્માનજનક વાત છે જિંદગી ભરની મહેનતનું. આ લેવલમાં એવા એન્જીનીઅર્સ જે ગૂગલમાં નહિ પણ પુરી દુનિયામાં નિષ્ણાંત હોય જે તે વિષયમાં. અને પછી આવે છે લેવલ 11 - Google Senior Fellows - સૌથી પ્રતિષ્ઠિત ગૂગલનું પદ - જે અત્યાર સુધીમાં ફક્ત બે જ લોકોને મળ્યું છે અને એ છે - જેફ ડીન અને સંજય ઘેમાવતસંદર્ભ, જે હવે ગૂગલ છોડીને જાય છે.
* = જેફ ડીન અને સંજય ઘેમાવતે બીજા મિત્રો સાથે મળીને Discovery Loop નામની કંપની સ્થાપી છે.
# = જેફ ડીન ગૂગલમાં દંતકથા સમાન પાત્ર બની ગયેલ છે એટલે સુધી કે એની આજુબાજુ ઘણી અફવાઓ અને દંતકથાઓ પ્રચલિત છે. કેટલીક એક-લાઈનની હાસ્ય વાતો અહીં વાંચી શકો છો - https://github.com/LRitzdorf/TheJeffDeanFacts
Emacs Minipost Pt. 2
This is a startup screen. When you open Emacs without any file, you'll probably see this startup screen all the time at the start of Emacs. You can customize the startup screen by clicking on "Customize Startup" link from this startup screen and within "To start..." section or you can write following line in .emacs.d file. .emacs.d is a config file and based on the instructions you write in this file, Emacs behave accordingly.
Following are the possible locations of the .emacs.d file.
# GNU/Linux ~/.config/emacs/init.el # macOS ~/.emacs.d/init.el # Windows %USERPROFILE%\.emacs.d\init.el
Navigate and open based on your OS and add following line. This will hide/disable the startup screen permanently.
(setq inhibit-startup-screen t)
Restart the Emacs and you won't see that startup screen on next time!
Summary: With this step, now you know that there is Emacs config file where you can write configuration for the Emacs!
Emacs Minipost Pt. 1
Emacs is a wonderful editor. It is one of those software that you should try and learn before you die! I'm not die hard fan of Emacs. Hell! I'm using other editors based and on work (i.e. Code for web development, Sublime for text writing, Notepad++ for copy-paste, nano for config edit, and few more). But, I still have soft corner for the Emacs and I use it whenever possible.
This is the first in the series of miniposts where I'm going to teach (and learning as I'm explaining to you) Emacs. Each post will be a paragraph or two long with one point. Read it, remember it, try it, and practice it!
Go ahead and install the latest version of Emacs from the official website - https://www.gnu.org/software/emacs (as of writing it is v30.2). It is available for all popular OSes. Once the installation is done, launch it, stare it, and then close it. It is standalone software. So, use it in that way - no need to open in terminal. Open it from applications launcher and you're good to go!
Summary: With this step, we've installed the Emacs!
મનની વિટંબણાઓ
આગળના લેખમાં આપણે ધનની અચોક્કસતા અને એના નિવારણના ઉપાયો વિષે વાત કરી આ લેખમાં આપણે મનની વિટંબણાઓ (તન, મન, અને ધનમાંથી મન) વિષે વાત કરીશું.
મનનો એક માત્ર ધ્યેય આત્માને આનંદ આપવાનો છે. પણ, આત્મા હજુ ઓળખાયો નથી. શરીરને જ મન આત્મા/સ્વામી મને છે. આથી, મન શરીરને આનંદ આપવાનો પ્રયત્ન કરે છે. એમાં મન સારું/ખરાબ નથી જોતું. આથી ઘણીવાર આનંદ પછી આપણે ઉદ્વેગ પામીએ છીએ. જેમકે, સમોસા ખાવાથી શરીરને આનંદ મળે છે, એટલે ખાતા તો ખાઈ લેવાય છે, પણ પછી બુદ્ધિથી ખબર પડે છે, કે આનાથી હવે ચરબી વધશે, તળેલું તેલ નુકસાન કરશે એટલે આપણે ઉદ્વેગ પામીએ છીએ.
વિટંબણા ત્યારે ઉત્પન્ન થાય છે, જયારે બુદ્ધિથી આપણને ખબર છે, કે આ બરોબર નથી છતાં મન એ શરીરને આનંદ આપવા કરે છે. ઉપાય મુશ્કેલ છે - પણ અશક્ય નથી. ઉપાયમાં
1. મનનો પ્રાણ શ્વાસોશ્વાસ છે, જો એના પર કાબુ રાખવામાં આવે તો મન પર પણ કાબુ રાખી શકાય છે.
a. પ્રાણાયામથી થઇ શકે પણ એના માટે સમય કાઢવો પડે. સવારે ચાલવામાં અથવા પૂજા વખતે (જો પૂજા ના કરતાં હોય તો કરો!). શરૂઆત 5 મિનિટથી કરવી અને પછી વધારતા 1.5 કલાક સુધી લઇ જવું. અને સમગ્ર જીવન જ પ્રાણાયામ થઇ જાય એવું કરવું.
b. શ્વાસોશ્વાસ ઉપર નજર રાખવી. સતત નજર રાખવી જેથી શરૂઆતના તબક્કામાં ચુકી ના જવાય.
c. હાથમાં કાંઈક એવું પહેરવું કે જે યાદ આપાવે કે આ પ્રક્રિયા ચાલુ જ છે જ્યાં સુધી એ આદત ના થઇ જાય.
2. પોતાને મનથી અલગ કરી દેવું અને તટસ્થ ભાવે એને વિચરણ કરવા દેવો અને એનું નિરીક્ષણ કરવું. મનને બળ આ શરીરથી મળે છે. જો એને શરીરથી દૂર કરવામાં આવે તો એનું બળ જતું રહશે એટલે શાંત થશે.
અહીં એ ખાસ યાદ રાખવાનું કે, જયારે મન ને ખબર પડશે કે એના પર નિયંત્રણ કરવામાં આવી રહ્યું છે અથવાતો એનો પ્રયાસ કરવામાં આવી રહ્યો છે, એટલે મન ચોક્કસથી બળવો કરશે. ગભરાવું નહિ, પ્રયાસ ચાલુ રાખવા.
સરકાર
બાઇટ જોડકું(=pair) એન્કોડિંગ અલ્ગોરિધમ
આ લેખમાં આપણે byte pair encoding algorithm (બાઇટ જોડકું એન્કોડિંગ અલ્ગોરિધમ) વિષે જાણીશું.
આ તકનીક/અલ્ગોરિધમનો ઉપયોગ AIમાં થાય છે. ખાસ કરીને, tokenizerમાં. AIને આપવામાં આવતી માહિતી/લખાણ(=text) ને જ્યારે tokenરૂપે સંગ્રહ કરવાનો હોય છે, ત્યારે આ તકનીકના ઉપયોગથી tokensને કાર્યક્ષમ(=efficiently) રીતે સંગ્રહ કરી શકાય છે
આ તકનીકને સરળ ભાષામાં સમજીએ.
લખાણમાં અક્ષરો(codingમાં bytes) ના જોડકાં(=pair) એક કરતાં વધુ વખત પુનરાવર્તન થતાં હોય તો એ જોડકાંને લખાણમાં ન વપરાયેલ સ્થાનધારક(=placeholder) થી બદલવામાં આવે છે. આ માહિતી(સ્થાનધારકને કયા જોડકાંથી બદલાવેલ છે) ને લખાણ સાથે સંગ્રહિત કરવામાં આવે છે. જોડકાં બદલવાની પ્રક્રિયા ત્યાં સુધી ચાલુ રહે છે, જ્યાં સુધી જોડકાનું વધુ વખત પુનરાવર્તન જોવા ન મળે.
હવે, આ તકનીકને ઉદાહરણથી સમજીએ.
આપણી પાસે નીચે પ્રમાણે લખાણ(=text) છે.
aaabdaaabac
અહી, aa (pair)નું વધુ વખત પુનરાવર્તન થાય છે. આથી, આ જોડકાંને Z સ્થાનધારકથી બદલી શકાય (Zનો ઉપયોગ કરવાનું કારણ એ આ લખાણમાં નથી). બદલી બાદ લખાણ નીચે પ્રમાણે થશે.
ZabdZabac Z=aa
હવે, abનું પણ એક કરતાં વધુ વખત પુનરાવર્તન થાય છે, તો આ જોડકાંને Yથી બદલીએ.
ZYdZYac Y=ab Z=aa
આગળ, ZYનું એક કરતાં વધુ વખત પુનરાવર્તન થાય છે. તો આ જોડકાંને Xથી બદલીએ.
XdXac X=ZY Y=ab Z=aa
લખાણમાં હવે કોઈ જોડકાનું પુનરાવર્તન થતું નથી. આથી, આ પ્રક્રિયા અહી સમાપ્ત થશે.
તમારે જો અસલ લખાણ પાછું જોતું હોય તો આ પ્રક્રિયાને ઊલટા ક્રમમાં કરવી.
---chatGPT અને બીજી AI સિસ્ટમમાં લખાણ વિશાળ માત્રામાં હોય છે, આથી એમાં પુનરાવર્તન માટે એક આંકની મર્યાદા(=limit) રાખવામાં આવે છે. જેમ કે, સૌથી વધુ પુનરાવર્તન થતાં ૧,૦૦,૦૦૦ જોડકાંને સ્થાનધારકથી બદલો અને ત્યારબાદ આ પ્રક્રિયાને રોકી દો.
---કેટલાક સંદર્ભો વધુ વાંચન માટે:
સમજણના બે છેડા
આ વાત મેં મારા સંસ્કૃતના શિક્ષક પાસેથી સાંભળી હતી, એ હું અહી મૂકું છું.
મારા દાદાના સમયની વાત છે. શુભ પ્રસંગે, અમારા ત્યાં જમણવાર રાખ્યો હતો ગામ આખાનો અને મિષ્ટાનમાં શ્રીખંડ રાખ્યો હતો, એ સમયે પુરા ગામને શ્રીખંડ ખવડાવવો એ બહુ મોટી વાત હતી. છેલ્લે જ્યારે મજૂરોના જમવાનો સમય આવ્યો ત્યારે શ્રીખંડ પતી ગયો. દાદાને કહેવું હતું કે, આખા ગામે શ્રીખંડ ખાધો તો પછી જેને આટલી બધી મહેનત કરી છે, એ મજૂરો કેમ બાકી રહી જાય. એટલે એમણે શહેરથી શ્રીખંડ લેવા માટે માણસો મોકલ્યા અને શ્રીખંડ મગાવ્યો.
મજૂરો જમવા બેઠા અને એ લોકોને શ્રીખંડ આપવામાં આવ્યો. મજૂરો જમતાં-જમતાં બોલ્યા કે, “જોયું મહેમાનોને ગરમાગરમ શ્રીખંડ આપ્યો અને આપણને છેલ્લે ટાઢો શ્રીખંડ મળ્યો”.
ત્યારે દાદા એ અંતે કીધું કે, આ લોકોને શ્રીખંડના સ્વાદની ખબર જ નથી, અને એમને ખાતા ખાતા શ્રીખંડના સ્વાદ વિષે ખબર પડશે તો ઠીક છે, બાકી પછી કોઈ આમને સમજાવી નહીં શકે કે, શ્રીખંડ ઠંડો જ હોય.














