{"@attributes":{"version":"2.0"},"channel":{"title":"DEV Community: yusuf","description":"The latest articles on DEV Community by yusuf (@canbax).","link":"https:\/\/dev.to\/canbax","image":{"url":"https:\/\/media2.dev.to\/dynamic\/image\/width=90,height=90,fit=cover,gravity=auto,format=auto\/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F232480%2Fd918b9de-8abf-494d-b219-ca0ea300c2cd.jpeg","title":"DEV Community: yusuf","link":"https:\/\/dev.to\/canbax"},"language":"en","item":[{"title":"Can WebAssembly make your web apps faster?","pubDate":"Sun, 16 Apr 2023 17:29:10 +0000","link":"https:\/\/dev.to\/canbax\/can-webassembly-make-your-web-apps-faster-378j","guid":"https:\/\/dev.to\/canbax\/can-webassembly-make-your-web-apps-faster-378j","description":"<h2>\n  \n  \n  What is WebAssembly?\n<\/h2>\n\n<h3>\n  \n  \n  Assembly?\n<\/h3>\n\n<p>As we all know, machines read binary codes (strings of zeros and ones) because it is very convenient for them but not for humans. So engineers basically created a mapping from binary code and called the mapped version 'Assembly'.<\/p>\n\n<p><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%2Fo7lolx3sbg1oml9q1qof.png\" class=\"article-body-image-wrapper\"><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%2Fo7lolx3sbg1oml9q1qof.png\" alt=\"Assembly and binary code\"><\/a><\/p>\n\n<h3>\n  \n  \n  WebAssembly?\n<\/h3>\n\n<p>WebAssembly is an 'Assembly'-like language. It's nickname is <em>wasm<\/em>. Basically WebAssembly is the Assembly language for modern browsers. <\/p>\n\n<p>People usually don't write Assembly code directly because it can be tedious. That's why there are many Assembly compilers that simply create Assembly code from <a href=\"https:\/\/emscripten.org\/\" rel=\"noopener noreferrer\">C\/C++<\/a>, C#, Rust, Java ... So basically you can run an existing C\/C++ or Rust application inside a browser.<\/p>\n\n<p>WebAssembly code can be directly injected into Javascript or Node.js environment. This can be very useful because you can combine WebAssembly with Javascript.<\/p>\n\n<p>WebAssembly provides near native performance. Javascript is just-in-time (JIT) compiled. But WebAssembly is pre-compiled. So that's why wasm can be executed faster than Javascript code. <\/p>\n\n<h2>\n  \n  \n  Get your hands dirty\n<\/h2>\n\n<p>Firstly, all the source codes used in this post available in <a href=\"https:\/\/github.com\/canbax\/wasm0\" rel=\"noopener noreferrer\">GitHub<\/a>. The ultimate question in my mind is <strong>\"Can we sort an array of integers faster with WebAssembly?\"<\/strong>. Since we want to execute faster, I think I should use the holy programming language <strong>C<\/strong>. <br>\nTo compile WebAssembly, I used <a href=\"https:\/\/emscripten.org\" rel=\"noopener noreferrer\">emscripten<\/a> I wrote C code and compiled C code into WebAssembly using emscripten.  I simply followed instructions at <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/WebAssembly\/C_to_wasm\" rel=\"noopener noreferrer\">MDN<\/a> and <a href=\"https:\/\/emscripten.org\/docs\/getting_started\/downloads.html\" rel=\"noopener noreferrer\">emscripten<\/a><\/p>\n<h3>\n  \n  \n  Hello World!\n<\/h3>\n\n<p>After you download and install emscripten by following their documentation, you should have a <code>emsdk<\/code> folder. Go into that folder and run <code>source .\/emsdk_env.sh<\/code>. Now you can compile your C codes into WebAssembly. To compile a hello world WebAssembly code, I used command <code>emcc -o hello3.html hello3.c --shell-file html_template\/shell_minimal2.html -s NO_EXIT_RUNTIME=1 -s \"EXPORTED_RUNTIME_METHODS=['ccall']\"<\/code>. Here <code>emcc<\/code> is the emscripten compiler. <code>-o hello3.html hello3.c<\/code> means compile 'hello3.c' and output HTML file 'hello3.html'. My 'hello3.c' is like below<br>\n<\/p>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>#include &lt;stdio.h&gt;\n#include &lt;emscripten\/emscripten.h&gt;\n\nint main() {\n    printf(\"Hello World\\n\");\n    return 0;\n}\n\n#ifdef __cplusplus\n#define EXTERN extern \"C\"\n#else\n#define EXTERN\n#endif\n\nEXTERN EMSCRIPTEN_KEEPALIVE void myFunction(int argc, char ** argv) {\n    printf(\"MyFunction Called\\n\");\n}\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<p>It simply prints 'Hello World' to the developer console when the web page is loaded. And also prints 'MyFunction Called' when the C function is called.<\/p>\n\n<p><code>--shell-file html_template\/shell_minimal2.html<\/code> of the script basically uses a template html file to generate the output 'hello3.html' file. My 'shell_minimal2.html' is like below.<br>\n<\/p>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>&lt;html&gt;\n  &lt;body&gt;\n    &lt;button id=\"mybutton\"&gt;Call the C function&lt;\/button&gt;\n  &lt;\/body&gt;\n&lt;\/html&gt;\n{{{ SCRIPT }}}\n&lt;script&gt;\n  document.getElementById(\"mybutton\").addEventListener(\"click\", () =&gt; {\n    alert(\"check console\");\n    const result = Module.ccall(\n      \"myFunction\", \/\/ name of C function\n      null, \/\/ return type\n      null, \/\/ argument types\n      null \/\/ arguments\n    );\n  });\n&lt;\/script&gt;\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<p>The rest of the command is necessary to call the function using some special method called <code>ccal<\/code>. If you execute the command, it will generate 'hello3.html', 'hello3.js', and 'hello3.wasm' files. If you look at 'hello3.html' you will see<br>\n<\/p>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>&lt;html&gt;\n  &lt;body&gt;\n    &lt;button id=\"mybutton\"&gt;Call the C function&lt;\/button&gt;\n  &lt;\/body&gt;\n&lt;\/html&gt;\n&lt;script async type=\"text\/javascript\" src=\"hello3.js\"&gt;&lt;\/script&gt;\n&lt;script&gt;\n  document.getElementById(\"mybutton\").addEventListener(\"click\", () =&gt; {\n    alert(\"check console\");\n    const result = Module.ccall(\n      \"myFunction\", \/\/ name of C function\n      null, \/\/ return type\n      null, \/\/ argument types\n      null \/\/ arguments\n    );\n  });\n&lt;\/script&gt;\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<p>The only difference between the template file 'shell_minimal2.html' and 'hello3.html' is the <code>{{{ SCRIPT }}}<\/code> section. Inside the 'hello3.html', this part is replaced with <code>&lt;script async type=\"text\/javascript\" src=\"hello3.js\"&gt;<\/code> 'hello3.js' is a Javascript file that provides a global variable named <code>Module<\/code> and also imports <code>hello3.wasm<\/code>. <code>hello3.wasm<\/code> is a binary file. You cannot read it with naked eye easily. Start an HTTP server and open 'hello3.html' in a modern browser. I'm using VSCode for code editing and it has <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ritwickdey.LiveServer\" rel=\"noopener noreferrer\">a nice extension<\/a> for simple HTTP server. Then you can actually see that wasm file is converted to WebAssembly Text (.wat) format in your browser.<br>\n<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%2F4m3yrmn5c3j6kfe5ri3w.png\" class=\"article-body-image-wrapper\"><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%2F4m3yrmn5c3j6kfe5ri3w.png\" alt=\"WebAssembly Text representation in browser\"><\/a><br>\nIn developer console, you can see <code>printf<\/code> statements of C codes are actually printed. This is hello world for WebAssembly! Also if you click to the button, you will see it calls a C function! That's amazing! From JavaScript we can call a C function!<br>\n<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%2Fkfajul8nvil6i9icmddr.png\" class=\"article-body-image-wrapper\"><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%2Fkfajul8nvil6i9icmddr.png\" alt=\"Image description\"><\/a><\/p>\n<h3>\n  \n  \n  Fibonacci\n<\/h3>\n\n<p>Now let's see if a C code can execute faster than plain Javascript code. To make a comparison I implemented fibonacci algorithm in a very inefficient way in both C and Javascript and executed side-by-side. <\/p>\n\n<p>I executed command just like hello world example <code>emcc -o hello4.html fib.c --shell-file html_template\/simple_compare.html -sEXPORTED_FUNCTIONS=_fib -sEXPORTED_RUNTIME_METHODS=cwrap<\/code>. Here to call a C function, we use someother special method <code>cwrap<\/code>.<br>\nBelow is my C code file 'fib.c'<br>\n<\/p>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>int fib(int n)\n{\n    if (n &lt; 2)\n        return n;\n    return fib(n - 1) + fib(n - 2);\n}\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<p>Here is my 'simple_compare.html' file<br>\n<\/p>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>{{{ SCRIPT }}}\n&lt;input type=\"number\" id=\"fibNum\" value=\"35\" \/&gt;\n&lt;button id=\"mybutton\"&gt;Compare JS vs C on Fibonacci&lt;\/button&gt;\n&lt;script&gt;\n  document.getElementById(\"mybutton\").addEventListener(\"click\", () =&gt; {\n    const fibIndex = Number(document.getElementById(\"fibNum\").value);\n    const t1 = executeFibonacciOnC(fibIndex);\n    const t2 = executeFibonacciOnJS(fibIndex);\n    console.log(\"C time:\", t1, \"JS time:\", t2);\n  });\n\n  \/\/ finds the 'n'th fibonacci number in C using the worst implementation and returns the execution time\n  function executeFibonacciOnC(n) {\n    fibC = Module.cwrap(\"fib\", \"number\", [\"number\"]);\n    const t1 = performance.now();\n    const res = fibC(n);\n    const t2 = performance.now();\n    console.log(\"c result: \", res);\n    return t2 - t1;\n  }\n\n  function executeFibonacciOnJS(n) {\n    const t1 = performance.now();\n    const res = fib(n);\n    const t2 = performance.now();\n    console.log(\"JS result: \", res);\n    return t2 - t1;\n  }\n\n  function fib(n) {\n    if (n &lt; 2) return n;\n    return fib(n - 1) + fib(n - 2);\n  }\n&lt;\/script&gt;\n\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<p>Here you can see that Javascript is a lot faster than C code. I feel like I wasted all my time and WebAssembly is just a balloon. <br>\n<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%2Ferqc5tbt7s7eqk6crf20.png\" class=\"article-body-image-wrapper\"><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%2Ferqc5tbt7s7eqk6crf20.png\" alt=\"C vs JS on Fibonacci calculation without any compiler optimizations\"><\/a><\/p>\n\n<p>Then I realized there is some compiler optimization flags in emscripten. Let's use them <code>emcc -o hello4.html fib.c --shell-file html_template\/simple_compare.html -sEXPORTED_FUNCTIONS=_fib -sEXPORTED_RUNTIME_METHODS=cwrap -O2<\/code> I just added a <code>-O2<\/code> flag to my command and do it again.<\/p>\n\n<p>Now you can see some magic!<br>\n<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%2Fbho7fjsubsgcjr2kgtiv.png\" class=\"article-body-image-wrapper\"><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%2Fbho7fjsubsgcjr2kgtiv.png\" alt=\"C vs JS on Fibonacci calculation with O2 compiler optimization flag\"><\/a><br>\nThis time, C code executes faster! In some cases it is like even 2 times faster!<\/p>\n<h3>\n  \n  \n  Sort numbers\n<\/h3>\n\n<p>Now let's try our ultimate aim. Can we sort numbers faster than Javascript? Let's try with C standard library function <code>qsort<\/code> I think it should be faster, C codes are usually fast. Similar to previous command, I executed command <code>emcc -o qsort.html arraySorter.c --shell-file html_template\/simple_compare_array.html -sEXPORTED_FUNCTIONS=_arraySorter,_malloc,_free -sEXPORTED_RUNTIME_METHODS=cwrap<\/code> My 'arraySorter.c' is very simple like below. It simply calls <code>qsort<\/code> function with a comparer function.<br>\n<\/p>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>#include &lt;stdlib.h&gt;\n\nint compareFn(const void *a, const void *b)\n{\n    return (*(int *)a - *(int *)b);\n}\n\nvoid arraySorter(int *arr, int size)\n{\n    qsort(arr, size, sizeof(int), compareFn);\n}\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<p>My template file 'simple_compare_array.html' is like below. Here passing and array as a parameter is bit hard. We need to use <code>malloc<\/code> and <code>free<\/code> functions to create and array and pass it to C.<br>\n<\/p>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>{{{ SCRIPT }}}\n&lt;input type=\"number\" id=\"arrSize\" value=\"1000000\" \/&gt;\n&lt;button id=\"mybutton\"&gt;Compare JS vs C on sorting integer array&lt;\/button&gt;\n&lt;script&gt;\n  function getArray() {\n    const l = Number(document.getElementById(\"arrSize\").value);\n    return Array.from({ length: l }, () =&gt; Math.floor(Math.random() * l));\n  }\n  document.getElementById(\"mybutton\").addEventListener(\"click\", () =&gt; {\n    const arr1 = getArray();\n    const arr2 = Array.from(arr1);\n    const t1 = arrayOperationsOnC(arr1);\n    const t2 = arrayOperationsOnJS(arr2);\n    console.log(\"C time:\", t1, \"JS time:\", t2);\n  });\n\n  function arrayOperationsOnC(n) {\n    const BYTE_SIZE_OF_INT = 4;\n    const t1 = performance.now();\n    const arraySize = n.length;\n    const arrayPointer = Module._malloc(arraySize * BYTE_SIZE_OF_INT);\n    Module.HEAP32.set(new Int32Array(n), arrayPointer \/ BYTE_SIZE_OF_INT);\n    const cFunc = Module.cwrap(\"arraySorter\", null, [\"number\", \"number\"]);\n    cFunc(arrayPointer, arraySize);\n    const resultArray = Array.from(\n      Module.HEAP32.subarray(\n        arrayPointer \/ BYTE_SIZE_OF_INT,\n        arrayPointer \/ BYTE_SIZE_OF_INT + arraySize\n      )\n    );\n    console.log(resultArray);\n    Module._free(arrayPointer);\n    const t2 = performance.now();\n    return t2 - t1;\n  }\n\n  function arrayOperationsOnJS(n) {\n    const t1 = performance.now();\n    const res = arraySorter(n);\n    console.log(res);\n    const t2 = performance.now();\n    return t2 - t1;\n  }\n\n  function arraySorter(arr) {\n    return arr.sort((a, b) =&gt; a - b);\n  }\n&lt;\/script&gt;\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<p>If I execute this I see my C code is like 4 times slower! <br>\nWhat the heck is wrong?<\/p>\n\n<p><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%2Fz4ifpm66r66d216qrhb8.png\" class=\"article-body-image-wrapper\"><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%2Fz4ifpm66r66d216qrhb8.png\" alt=\"Image description\"><\/a><\/p>\n\n<p>OK I see I didn't use compiler optimization flags. Let's try <code>-O2<\/code> flag and do it again. Now it is faster but still very slower than Javascript.<\/p>\n\n<blockquote>\n<p>C time: 716.1 JS time: 269.5<\/p>\n<\/blockquote>\n\n<p>Even if I use <code>-O3<\/code> flag, I see it is still slower. There is no '-O4' this is the most optimized.<\/p>\n\n<blockquote>\n<p>C time: 711.9 JS time: 270.6<\/p>\n<\/blockquote>\n\n<p>Now we are sure that quick sort with C cannot pass plain Javascript. But we used C standard library function <code>qsort<\/code>. Can we try plain C code for quick sort? Let's try. I used command <code>emcc -o faster_sorter.html arraySorter2.c --shell-file html_template\/simple_compare_array.html -sEXPORTED_FUNCTIONS=_arraySorter,_malloc,_free -sEXPORTED_RUNTIME_METHODS=cwrap -O2<\/code> Here I used the same HTML template but this time I implemented quick sort algorithm with plain C code. Below in my <code>arraySorter2.c<\/code> file.<br>\n<\/p>\n\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>\/\/ Quick sort in C\n\n\/\/ function to swap elements\nvoid swap(int *a, int *b)\n{\n    int t = *a;\n    *a = *b;\n    *b = t;\n}\n\n\/\/ function to find the partition position\nint partition(int array[], int low, int high)\n{\n\n    \/\/ select the rightmost element as pivot\n    int pivot = array[high];\n\n    \/\/ pointer for greater element\n    int i = (low - 1);\n\n    \/\/ traverse each element of the array\n    \/\/ compare them with the pivot\n    for (int j = low; j &lt; high; j++)\n    {\n        if (array[j] &lt;= pivot)\n        {\n\n            \/\/ if element smaller than pivot is found\n            \/\/ swap it with the greater element pointed by i\n            i++;\n\n            \/\/ swap element at i with element at j\n            swap(&amp;array[i], &amp;array[j]);\n        }\n    }\n\n    \/\/ swap the pivot element with the greater element at i\n    swap(&amp;array[i + 1], &amp;array[high]);\n\n    \/\/ return the partition point\n    return (i + 1);\n}\n\nvoid quickSort(int array[], int low, int high)\n{\n    if (low &lt; high)\n    {\n\n        \/\/ find the pivot element such that\n        \/\/ elements smaller than pivot are on left of pivot\n        \/\/ elements greater than pivot are on right of pivot\n        int pi = partition(array, low, high);\n\n        \/\/ recursive call on the left of pivot\n        quickSort(array, low, pi - 1);\n\n        \/\/ recursive call on the right of pivot\n        quickSort(array, pi + 1, high);\n    }\n}\n\nvoid arraySorter(int *arr, int size)\n{\n    quickSort(arr, 0, size - 1);\n}\n<\/code><\/pre>\n\n<\/div>\n\n\n\n<p>Now it seems with <code>-O2<\/code> flag we can sort integers faster than plain Javascript! Now C code is like 2 times faster. That's amazing!<\/p>\n\n<blockquote>\n<p>C time: 156.8 JS time: 271.5<\/p>\n<\/blockquote>\n\n<p>Is Wasm faster in your browser? <a href=\"https:\/\/canbax.github.io\/wasm0\/\" rel=\"noopener noreferrer\">Try and see<\/a> now. All the <a href=\"https:\/\/github.com\/canbax\/wasm0\" rel=\"noopener noreferrer\">source codes<\/a> is available under MIT license.<\/p>\n\n","category":["javascript","webassembly","c"]},{"title":"\u0130nternette gezerken d\u00fcnyay\u0131 kurtar!","pubDate":"Mon, 20 Jun 2022 13:56:26 +0000","link":"https:\/\/dev.to\/canbax\/internette-gezerken-dunyayi-kurtar-38ne","guid":"https:\/\/dev.to\/canbax\/internette-gezerken-dunyayi-kurtar-38ne","description":"<p><a href=\"https:\/\/dev.to\/canbax\/save-the-world-while-browsing-the-internet-kko\">English translation<\/a><br>\n\u0130nternetin yayg\u0131nla\u015fmas\u0131 ile insanlar hemen hemen her g\u00fcn d\u00fcnyay\u0131 saran bu kablolu\/kablosuz a\u011fda gezinmeye ba\u015flad\u0131. K\u00fc\u00e7\u00fckken internetin Google oldu\u011funu zannederdim \ud83d\ude01 ancak b\u00fcy\u00fcy\u00fcp m\u00fchendis olunca \"internet taray\u0131c\u0131s\u0131\" denilen programlar ve \"arama motoru\" denilen internet siteleri sayesinde internette gezdi\u011fimi fark ettim.  <\/p>\n\n<p>Google Chrome, Safari, Microsoft Edge, Mozilla Firefox, Opera ... gibi programlar pop\u00fcler internet taray\u0131c\u0131lar\u0131d\u0131r. <br>\n<a href=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--uDop4TdZ--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/w41ihqfcpki2nam98q34.png\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--uDop4TdZ--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/w41ihqfcpki2nam98q34.png\" alt=\"Yayg\u0131n internet taray\u0131c\u0131lar\u0131n\u0131n logolar\u0131\" width=\"800\" height=\"160\"><\/a><\/p>\n\n<p>Google, Bing, Baidu, Yahoo!, Yandex ... gibi internet siteleri ise yayg\u0131n arama motorlar\u0131d\u0131r. <br>\n<a href=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--qkt5_vpn--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/cjzb6jdc8ctj0a2lnz6h.png\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--qkt5_vpn--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/cjzb6jdc8ctj0a2lnz6h.png\" alt=\"Yayg\u0131n arama motorlar\u0131n\u0131n logolar\u0131\" width=\"600\" height=\"310\"><\/a><\/p>\n\n<p>\u0130nternet taray\u0131c\u0131lar\u0131n\u0131n ve arama motorlar\u0131n\u0131n \u00e7o\u011fu (yukar\u0131da \u00f6rnek verilenlerin hepsi) \u00fccretsiz oldu\u011fu halde reklam alarak milyar dolar mertebelerinde gelirler elde edebiliyorlar. Bunu kullanc\u0131lar\u0131n\u0131n yapt\u0131klar\u0131 aramalar\u0131n ve ki\u015fisel bilgilerin kay\u0131tlar\u0131n\u0131 tutup \u00e7e\u015fitli algoritmalar kullanarak ba\u015far\u0131yorlar. \u00d6rne\u011fin Google 2021 y\u0131l\u0131nda <a href=\"https:\/\/www.statista.com\/statistics\/266206\/googles-annual-global-revenue\/\">200 milyar dolardan fazla<\/a> reklam geliri elde etmi\u015ftir.<\/p>\n\n<h1>\n  \n  \n  Ecosia\n<\/h1>\n\n<p><a href=\"https:\/\/www.ecosia.org\">Ecosia<\/a> da t\u0131pk\u0131 Google gibi bir arama motoru. Google'dan farkl\u0131 olarak Ecosia elde etti\u011fi t\u00fcm net k\u00e2r\u0131n\u0131 a\u011fa\u00e7 dikmek i\u00e7in harcad\u0131\u011f\u0131n\u0131 iddia ediyor. Bu \u015firketle herhangi bir alakam yok ve bir g\u00fcvenilirlik garantisi de veremem. Yakla\u015f\u0131k 1-2 y\u0131ld\u0131r Ecosia'y\u0131 kullan\u0131yorum ve genel olarak memnunum. Ecosia'ya g\u00fcveniyorum \u00e7\u00fcnk\u00fc \u015feffaf bir yap\u0131lar\u0131 var, <a href=\"https:\/\/blog.ecosia.org\/ecosia-financial-reports-tree-planting-receipts\/\">finansal raporlar\u0131<\/a> ve <a href=\"https:\/\/twitter.com\/Ecosia\">sosyal medya g\u00f6nderileri<\/a> bana ikna edici geldi.<\/p>\n\n<h2>\n  \n  \n  Neden Ecosia kullan\u0131yorum?\n<\/h2>\n\n<ul>\n<li>Ki\u015fisel veri toplam\u0131yor. Ecosia Google gibi daha \u00f6nceden yap\u0131lan aramalar\u0131n kay\u0131tlar\u0131n\u0131 tutmuyor. Tamamen arad\u0131\u011f\u0131m s\u00f6zc\u00fcklere g\u00f6re sonu\u00e7lar\u0131 getiriyor. Bu hem ki\u015fisel verilerinizi koruman\u0131z\u0131 hem de daha ilgili sonu\u00e7lar bulman\u0131z\u0131 sa\u011fl\u0131yor.<\/li>\n<li>\u00c7ok daha az reklam g\u00f6steriyor.\n<img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--9aSJn07t--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/ostzz73lym2shjykqc1i.png\" alt=\"&quot;adrasan tatil&quot; ifadesine Ecosia ve Google'\u0131n \u00e7\u0131kard\u0131\u011f\u0131 sonu\u00e7lar. Ecosia reklam g\u00f6stermiyor, Google 4 tane.\" width=\"800\" height=\"506\">\n<\/li>\n<li>Sadece girilen yaz\u0131y\u0131 baz al\u0131p arama yapt\u0131\u011f\u0131ndan daha pop\u00fcler olan\u0131 de\u011fil daha alakal\u0131 olan\u0131 g\u00f6r\u00fcyorsunuz. Google'\u0131n <a href=\"https:\/\/en.wikipedia.org\/wiki\/PageRank\">PageRank isimli me\u015fhur algoritmas\u0131<\/a> zaten pop\u00fcler sonu\u00e7lar\u0131 \u00fcste \u00e7\u0131karmay\u0131 hedeflemektedir.<\/li>\n<\/ul>\n\n<h3>\n  \n  \n  Koskoca Google'dan daha m\u0131 iyi yani?\n<\/h3>\n\n<p>Son olarak Google'\u0131n da \u00fcst\u00fcn geldi\u011fi taraflar olabilir. Mesela bir\u015fey sat\u0131n almak istiyorsan\u0131z Google sat\u0131n almak istedi\u011finiz \u00fcr\u00fcnlere \u00e7ok daha iyi ula\u015f\u0131m sa\u011fl\u0131yor. Google'\u0131n harita hizmeti de olduk\u00e7a iyi. Tabi bazen Google daha alakal\u0131 sonu\u00e7lar da g\u00f6sterebiliyor.<\/p>\n\n<p>Son olarak Ecosia'n\u0131n <a href=\"https:\/\/info.ecosia.org\/mobile\">mobil uygulamas\u0131<\/a> yani mobil cihazlarda \u00e7al\u0131\u015fan internet taray\u0131c\u0131s\u0131 da var. Ben biraz kulland\u0131m ama a\u00e7\u0131k\u00e7as\u0131 ba\u015fka taray\u0131c\u0131lar\u0131 daha \u00e7ok be\u011fendi\u011fimden kullanmad\u0131m.<\/p>\n\n<p>Ayr\u0131ca Ecosia ile yapt\u0131\u011f\u0131n\u0131z arama say\u0131s\u0131n\u0131 kay\u0131t edebilirsiniz. Ben telefonum ile 1400'den fazla, bilgisayar ile ise 2700'den fazla arama yapm\u0131\u015f\u0131m. Bu say\u0131lar\u0131 ne kadar do\u011fru tutuyorlar a\u00e7\u0131k\u00e7as\u0131 pek emin de\u011filim.<\/p>\n\n<p><a href=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--sBTYj7Ry--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/8tenuppg9p2g5jdnjrr0.png\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--sBTYj7Ry--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/8tenuppg9p2g5jdnjrr0.png\" alt=\"Ecosia'da yapt\u0131\u011f\u0131m arama say\u0131lar\u0131\" width=\"682\" height=\"259\"><\/a><\/p>\n\n<h1>\n  \n  \n  OceanHero\n<\/h1>\n\n<p>\u0130nternet taray\u0131c\u0131n\u0131zda bo\u015f bir sekme a\u00e7t\u0131\u011f\u0131n\u0131zda ne g\u00f6rece\u011finizi \u00f6zelle\u015ftirebilirsiniz. <a href=\"https:\/\/oceanhero.today\/\">OceanHero<\/a> size reklam g\u00f6sterip, reklam gelirleri ile okyanuslardaki plastik at\u0131klar\u0131 temizledi\u011fini iddia ediyor. <\/p>\n\n<p><a href=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--3EdwvXaQ--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/2xdyiq2xlwtqc28fl06c.png\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--3EdwvXaQ--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/2xdyiq2xlwtqc28fl06c.png\" alt=\"Bo\u015f sekmede g\u00f6sterilen OceanHero reklamlar\u0131\" width=\"800\" height=\"406\"><\/a><\/p>\n\n<p>\u0130\u015fleyi\u015fin nas\u0131l oldu\u011funu <a href=\"https:\/\/www.youtube.com\/watch?v=Un3kQ0abA7M\">1 dakikal\u0131k k\u0131sa ve a\u00e7\u0131klay\u0131c\u0131 bir video<\/a> ile anlatm\u0131\u015flar. <\/p>\n\n<p>Ayr\u0131ca OceanHero'da <a href=\"https:\/\/oceanhero.today\/search\">bir arama motoru hizmeti<\/a> de sunuyor. \u00c7ok fazla kullanmad\u0131\u011f\u0131m i\u00e7in pek yorum yapamayaca\u011f\u0131m ancak okyanus modunun (\"Ocean Mode\") \u00e7ok ho\u015f g\u00f6r\u00fcnd\u00fc\u011f\u00fcn\u00fc s\u00f6yleyebilirim.<\/p>\n\n<p><a href=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--IqO59MDd--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/htddjt5ld8epplx0fzev.jpg\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--IqO59MDd--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/htddjt5ld8epplx0fzev.jpg\" alt=\"OceanHero'da okyanus modunda yap\u0131lan bir arama\" width=\"800\" height=\"346\"><\/a><\/p>\n\n<h1>\n  \n  \n  Brave\n<\/h1>\n\n<p>Bu kez ekoloji ile alakas\u0131 olmayan bir ara\u00e7tan bahsedece\u011fim. <a href=\"https:\/\/brave.com\">Brave<\/a> bir internet taray\u0131c\u0131s\u0131. Gezegenimizin fiziksel olarak ya\u015fan\u0131labilir olmas\u0131na direk bir katk\u0131s\u0131 olmasa da Brave mahremiyete verdi\u011fi b\u00fcy\u00fck \u00f6nem sayesinde dijital hayat\u0131n ya\u015fan\u0131labilirli\u011fine b\u00fcy\u00fck katk\u0131 sa\u011fl\u0131yor. Son d\u00f6nemde Google, Facebook, Microsoft gibi dev \u015firketler de mahremiyeti g\u00fcndemlerine ta\u015f\u0131y\u0131p bu konuda daha \u00e7ok efor sarf etmeye ba\u015flad\u0131lar.<\/p>\n\n<h2>\n  \n  \n  Neden Brave kullan\u0131yorum?\n<\/h2>\n\n<ul>\n<li>Reklam ve izleyicileri blokluyor. Baz\u0131 siteler sizin reklam engelleyicisi kulland\u0131\u011f\u0131n\u0131z\u0131 s\u00f6yleyip size i\u00e7erik g\u00f6stermeyebilir. Bu durumda \"kalkanlar\u0131n\u0131z\u0131\" indirerek reklam ve izleyicilere izin verebilirsiniz.<\/li>\n<\/ul>\n\n<p>Tabletimde kulland\u0131\u011f\u0131m Brave 1-2 y\u0131ll\u0131k s\u00fcre\u00e7te 2 GB'l\u0131k veri, 1 saatlik ise zaman tasarrufu sa\u011flad\u0131\u011f\u0131n\u0131 iddia ediyor.<br>\n<a href=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--XwPu6ePv--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/fw0i50xmxec0qye6zlhd.jpg\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--XwPu6ePv--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/fw0i50xmxec0qye6zlhd.jpg\" alt=\"Tabletimde kulland\u0131\u011f\u0131m Brave'in tuttu\u011fu istatistikler\" width=\"800\" height=\"436\"><\/a><\/p>\n\n<p>Telefonumda kulland\u0131\u011f\u0131m Brave ise 3.8 GB'l\u0131k veri, 1 saatlik zaman tasarrufu sa\u011flad\u0131\u011f\u0131n\u0131 iddia ediyor.<\/p>\n\n<p><a href=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--iwYqCt81--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/z6l9wuo2452u3mtmg7a7.jpg\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--iwYqCt81--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/z6l9wuo2452u3mtmg7a7.jpg\" alt=\"Telefonumda kulland\u0131\u011f\u0131m Brave'in tuttu\u011fu istatistikler\" width=\"720\" height=\"1280\"><\/a><\/p>\n\n<p>E\u011fer YouTube'u kullan\u0131yorsan\u0131z bundan \u00e7ok daha fazla zaman tasarrufu yapaca\u011f\u0131n\u0131za gayet eminim. YouTube'un resmi uygulamas\u0131n\u0131 kullanmaktansa Brave ile YouTube'u kullan\u0131yorum \u00e7\u00fcnk\u00fc y\u0131llard\u0131r YouTube'da reklam izlemiyorum. (Evet, YouTube Premium'a bo\u015fa para veriyorlar :) <\/p>\n\n<ul>\n<li><p>Daha h\u0131zl\u0131. Google Chrome'dan bile daha m\u0131 h\u0131zl\u0131 ger\u00e7ekten? Bence evet. \u00c7ok ciddi \u00f6l\u00e7\u00fcmler yapmad\u0131m ama reklam ve izleyicileri engelledi\u011finden daha h\u0131zl\u0131 olmas\u0131 da gayet normal asl\u0131nda. Brave kullan\u0131rken Google Chrome'dan daha h\u0131zl\u0131 oldu\u011funu a\u00e7\u0131k\u00e7a hissediyorum ancak tabiki m\u00fchendisler hisleriyle hareket etmemeliler. Brave Google Chrome'dan <a href=\"https:\/\/brave.com\/compare\/chrome\/performance\/\">3 kata kadar daha h\u0131zl\u0131<\/a> olabilece\u011fini iddia ediyor.<\/p><\/li>\n<li><p>A\u00e7\u0131k kaynak kodlu. Kodlar\u0131 okuyup tekrar yazmayacak olsan\u0131z bile bunu yapabilmeniz ya da ba\u015fka geli\u015ftiricilere yapt\u0131rabilmeniz g\u00fczel bir imkan. Fazla imkan g\u00f6z \u00e7\u0131karmaz.<\/p><\/li>\n<li><p>\"BAT\" tokeni kazanabilirsiniz. \u0130sterseniz Brave ile baz\u0131 reklamlara maruz kal\u0131p \"BAT\" kripto varl\u0131\u011f\u0131n\u0131 edinebilirsiniz. Brave g\u00f6sterilen reklamlar\u0131n mahremiyete \u00f6nem verdi\u011fini iddia ediyor. Hi\u00e7 reklam g\u00f6rmemek bana cazip geldi\u011finden bundan pek yararlanmad\u0131m.<\/p><\/li>\n<\/ul>\n\n<p>Brave hakk\u0131nda son olarak ilgin\u00e7 bir bilgi verelim. Brave'in CEO'su <a href=\"https:\/\/tr.wikipedia.org\/wiki\/Brendan_Eich\">Brendan Eich<\/a> JavaScript dilinin yarat\u0131c\u0131s\u0131 ve Mozilla'n\u0131n kurucular\u0131ndand\u0131r.<\/p>\n\n<p>Son olarak burada bahsetti\u011fim \u015firketlerin herhangi biri taraf\u0131ndan finansal bir destek almad\u0131m. Herhangi biriyle \u00e7al\u0131\u015fm\u0131yorum. Brave, OceanHero ya da Ecosia hakk\u0131nda herhangi bir garanti veremem. Bunlar\u0131 sadece be\u011feniyorum ve kullan\u0131yorum.<\/p>\n\n","category":["aramamotoru","internet"]},{"title":"Save the world while browsing the internet!","pubDate":"Mon, 20 Jun 2022 13:56:07 +0000","link":"https:\/\/dev.to\/canbax\/save-the-world-while-browsing-the-internet-kko","guid":"https:\/\/dev.to\/canbax\/save-the-world-while-browsing-the-internet-kko","description":"<p><a href=\"https:\/\/dev.to\/canbax\/internette-gezerken-dunyayi-kurtar-38ne\">T\u00fcrk\u00e7e \u00e7evirisi<\/a><br>\nWith the widespread use of the Internet, people started to browse this wired\/wireless network that surrounds the world almost every day. When I was little, I thought the internet was Google \ud83d\ude01 but when I grew up and became an engineer, I realized that I was surfing the internet thanks to programs called \"internet browser\" and websites called \"search engines\".<\/p>\n\n<p>Programs such as Google Chrome, Safari, Microsoft Edge, Mozilla Firefox, Opera ... are popular internet browsers.<br>\n<a href=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--uDop4TdZ--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/w41ihqfcpki2nam98q34.png\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--uDop4TdZ--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/w41ihqfcpki2nam98q34.png\" alt=\"Common internet browsers logos\" width=\"800\" height=\"160\"><\/a><\/p>\n\n<p>Internet sites such as Google, Bing, Baidu, Yahoo!, Yandex ... are common search engines.<br>\n<a href=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--qkt5_vpn--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/cjzb6jdc8ctj0a2lnz6h.png\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--qkt5_vpn--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/cjzb6jdc8ctj0a2lnz6h.png\" alt=\"Logos of common search engines\" width=\"600\" height=\"310\"><\/a><\/p>\n\n<p>Although most internet browsers and search engines (all of the examples above) are free, they can earn billions of dollars by advertising. They achieve this by keeping records of their users' searches and personal information, using various algorithms. For example, Google generated <a href=\"https:\/\/www.statista.com\/statistics\/266206\/googles-annual-global-revenue\/\">more than $200 billion<\/a> ad revenue in 2021.<\/p>\n\n<h1>\n  \n  \n  Ecosia\n<\/h1>\n\n<p><a href=\"https:\/\/www.ecosia.org\">Ecosia<\/a> is a search engine just like Google. Unlike Google, Ecosia claims to spend all its net profits on planting trees. I have no affiliation with this company and I cannot give any guarantee of reliability. I have been using Ecosia for about 1-2 years and I am generally satisfied. I trust Ecosia because they have a transparent structure, <a href=\"https:\/\/blog.ecosia.org\/ecosia-financial-reports-tree-planting-receipts\/\">financial reports<\/a> and <a href=\"https:\/\/twitter%20.com\/Ecosia\">social media posts<\/a> sounded convincing to me.<\/p>\n\n<h2>\n  \n  \n  Why do I use Ecosia?\n<\/h2>\n\n<ul>\n<li>It does not collect personal data. Ecosia does not keep logs of previous searches like Google. It returns results exactly based on the words I'm looking for. This allows you to both protect your personal data and find more relevant results.<\/li>\n<li>It shows a lot less ads.\n<img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--9aSJn07t--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/ostzz73lym2shjykqc1i.png\" alt=\"Ecosia and Google's results for the expression &quot;adrasan holiday&quot;. Ecosia doesn't show ads, Google has 4.\" width=\"800\" height=\"506\">\n<\/li>\n<li>You only see what's more relevant, not what's more popular, as you search based on the entered text. Google's <a href=\"https:\/\/en.wikipedia.org\/wiki\/PageRank\">famous algorithm named PageRank<\/a> aims to top the already popular results.<\/li>\n<\/ul>\n\n<h3>\n  \n  \n  Is it really better than all mighty GOOGLE?\n<\/h3>\n\n<p>Finally, there may be parties where Google excels. For example, if you want to buy something, Google provides much better access to the products you want to buy. Google's map service is pretty good too. Of course, sometimes Google can show more relevant results.<\/p>\n\n<p>Finally, there is Ecosia's <a href=\"https:\/\/info.ecosia.org\/mobile\">mobile application<\/a>, that is, an internet browser that works on mobile devices. I used a little bit, but frankly, I didn't use it because I like other browsers more.<\/p>\n\n<p>You can also record the number of calls you make with Ecosia. I made more than 1400 searches with my phone and more than 2700 searches with my computer. Honestly, I'm not sure how accurate these numbers are.<\/p>\n\n<p><a href=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--sBTYj7Ry--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/8tenuppg9p2g5jdnjrr0.png\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--sBTYj7Ry--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/8tenuppg9p2g5jdnjrr0.png\" alt=\"The number of searches I made on Ecosia\" width=\"682\" height=\"259\"><\/a><\/p>\n\n<h1>\n  \n  \n  OceanHero\n<\/h1>\n\n<p>You can customize what you see when you open a blank tab in your internet browser. <a href=\"https:\/\/oceanhero.today\/\">OceanHero<\/a> claims to be showing you ads and clearing plastic waste from the oceans with ad revenue.<\/p>\n\n<p><a href=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--3EdwvXaQ--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/2xdyiq2xlwtqc28fl06c.png\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--3EdwvXaQ--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/2xdyiq2xlwtqc28fl06c.png\" alt=\"OceanHero ads showing in blank tab\" width=\"800\" height=\"406\"><\/a><\/p>\n\n<p>They explained how it works with <a href=\"https:\/\/www.youtube.com\/watch?v=Un3kQ0abA7M\">a 1-minute short and explanatory video<\/a>.<\/p>\n\n<p>It also offers <a href=\"https:\/\/oceanhero.today\/search\">a search engine service<\/a> on OceanHero. I can't comment much since I don't use it much, but I can say that the ocean mode (\"Ocean Mode\") looks very nice.<\/p>\n\n<p><a href=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--IqO59MDd--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/htddjt5ld8epplx0fzev.jpg\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--IqO59MDd--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/htddjt5ld8epplx0fzev.jpg\" alt=\"A search in OceanHero in ocean mode\" width=\"800\" height=\"346\"><\/a><\/p>\n\n<h1>\n  \n  \n  Brave\n<\/h1>\n\n<p>This time I will talk about a tool that has nothing to do with ecology. <a href=\"https:\/\/brave.com\">Brave<\/a> is an internet browser. Although it does not directly contribute to the physical livability of our planet, Brave makes a great contribution to the livability of digital life thanks to the great importance it gives to privacy. Recently, giant companies such as Google, Facebook and Microsoft have also brought privacy to their agenda and started to make more effort in this regard.<\/p>\n\n<h2>\n  \n  \n  Why am I using Brave?\n<\/h2>\n\n<ul>\n<li>Blocks advertisements and trackers. Some sites may say that you are using an ad-blocker and not show you any content. In this case, you can disable your \"shields\" and allow ads and trackers.<\/li>\n<\/ul>\n\n<p>Brave, which I use on my tablet, claims to save 2 GB of data and 1 hour of time in 1-2 years.<br>\n<a href=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--XwPu6ePv--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/fw0i50xmxec0qye6zlhd.jpg\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--XwPu6ePv--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/fw0i50xmxec0qye6zlhd.jpg\" alt=\"Statistics kept by Brave on my tablet\" width=\"800\" height=\"436\"><\/a><\/p>\n\n<p>Brave, which I use on my phone, claims to save 3.8 GB of data and 1 hour of time.<\/p>\n\n<p><a href=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--iwYqCt81--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/z6l9wuo2452u3mtmg7a7.jpg\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--iwYqCt81--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/z6l9wuo2452u3mtmg7a7.jpg\" alt=\"Statistics kept by Brave on my phone\" width=\"720\" height=\"1280\"><\/a><\/p>\n\n<p>If you're using YouTube, I'm pretty sure you'll save a lot more time. Rather than using YouTube's official app, I use YouTube with Brave because I haven't watched YouTube ads for years. (Yes, they are wasting money on YouTube Premium :)<\/p>\n\n<ul>\n<li><p>Faster. Is it really even faster than Google Chrome? I think yes. I didn't make very serious measurements, but it is quite normal that it is faster as it blocks ads and trackers. When using Brave, I clearly feel that it is faster than Google Chrome, but of course, engineers should not act based on their feelings. Brave claims it can be <a href=\"https:\/\/brave.com\/compare\/chrome\/performance\/\">up to 3x faster<\/a> than Google Chrome.<\/p><\/li>\n<li><p>Open source code. Even if you're not going to read and rewrite the code, it's a nice opportunity to be able to do it or have other developers do it.<\/p><\/li>\n<li><p>You can earn \"BAT\" token. If you want, you can get the \"BAT\" crypto-asset by being exposed to some advertisements with Brave. Brave claims that the ads shown are privacy-respecting. I didn't get much use out of it as I was tempted to not see any ads.<\/p><\/li>\n<\/ul>\n\n<p>Finally, let's give some interesting information about Brave. Brave's CEO <a href=\"https:\/\/en.wikipedia.org\/wiki\/Brendan_Eich\">Brendan Eich<\/a> is the creator of the JavaScript language and co-founder of Mozilla.<\/p>\n\n<p>Finally, I have not received any financial support from any of the companies mentioned here. I am not working with anyone. I cannot make any warranties about Brave, OceanHero or Ecosia. I just like and use them.<\/p>\n\n","category":["browser","searchengine"]},{"title":"Visualizing TigerGraph & Neo4j databases with \"Davraz\"","pubDate":"Sun, 12 Jun 2022 11:12:51 +0000","link":"https:\/\/dev.to\/canbax\/visualizing-tigergraph-neo4j-databases-with-davraz-296d","guid":"https:\/\/dev.to\/canbax\/visualizing-tigergraph-neo4j-databases-with-davraz-296d","description":"<p>In this post, I will introduce <a href=\"https:\/\/github.com\/canbax\/davraz\">Davraz<\/a>, a software I created. Firstly, it is deployed on <a href=\"https:\/\/canbax.github.io\/davraz\/\">https:\/\/canbax.github.io\/davraz\/<\/a>. So you can see it in action now. <\/p>\n\n<p>This post aims to introduce graph visualization to non-technical people.<\/p>\n\n<h2>\n  \n  \n  Introduction\n<\/h2>\n\n<p><em>Davraz<\/em> is a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Graph_database\">graph database<\/a> visualizer. Currently it supports only <a href=\"https:\/\/www.tigergraph.com\/\">TigerGraph<\/a> and <a href=\"https:\/\/neo4j.com\/\">Neo4j<\/a>.<\/p>\n\n<h2>\n  \n  \n  Background\n<\/h2>\n\n<p>I created <em>Davraz<\/em> for <a href=\"https:\/\/tigergraph2020.devpost.com\/\">TigerGraph 2020 Graphathon<\/a>. (It got 1st Place Reward YAAAY!) It is a tool for visualizing your <a href=\"https:\/\/www.tigergraph.com\/\">TigerGraph<\/a> and <a href=\"https:\/\/neo4j.com\/\">Neo4j<\/a> databases. TigerGraph and Neo4j are <a href=\"https:\/\/en.wikipedia.org\/wiki\/Graph_database\">graph databases<\/a>. Usually,  data is stored in SQL databases. Graph databases are a fairly new way to store data.<\/p>\n\n<h2>\n  \n  \n  Why Graph Database?\n<\/h2>\n\n<p>In SQL databases, if your data is highly connected, querying data might be time-consuming (due to <a href=\"https:\/\/www.w3schools.com\/sql\/sql_join.asp\">join<\/a> operations). In this case, using a graph database might considerably decrease execution time. This depends on how the graph database is implemented at its core. <a href=\"https:\/\/www.w3schools.com\/SQL\/sql_ref_index.asp\">Creating index<\/a> in SQL database will also help you execute faster. At its core, creating an index is actually like creating a graph data structure. So we can say SQL is also benefiting from graphs for faster execution.<\/p>\n\n<h2>\n  \n  \n  Why Graph Visualization?\n<\/h2>\n\n<p>Visualizing data is one of the most effective ways of understanding data. Graphs are a pretty generic data structure and almost any data can be defined as a graph. So visualizing graphs can be a very generic and effective way to understand any data. Graph visualization can be used for insightful analysis and interpretation. <\/p>\n\n<p><a href=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--3AEfpj08--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/pzr3ttjxcg59t2rc8czj.png\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--3AEfpj08--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/pzr3ttjxcg59t2rc8czj.png\" alt=\"A sample graph visualization with a rich style from my MS thesis\" width=\"800\" height=\"732\"><\/a><\/p>\n\n<h2>\n  \n  \n  Set-up for TigerGraph\n<\/h2>\n\n<p>From <a href=\"https:\/\/tgcloud.io\/\">https:\/\/tgcloud.io\/<\/a> you can jump-start creating your own free TigerGraph database. It is very easy, you just need to click \"next\" etc... But you can find <a href=\"https:\/\/medium.com\/swlh\/getting-started-with-tigergraph-3-0-4aac0ca4fb3d\">more guidance<\/a> on the Internet. For visualization, you can also use their embedded system called <em>\"Graph Studio\"<\/em>. <\/p>\n\n<p>After you have a running TigerGraph instance, you can start visualizing it on <em>Davraz<\/em>. If you open <a href=\"https:\/\/canbax.github.io\/davraz\/\">https:\/\/canbax.github.io\/davraz\/<\/a>, at first you should enter database configuration data. <a href=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--7AawqL20--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/np9mrd39yqofdunz5yx4.png\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--7AawqL20--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/np9mrd39yqofdunz5yx4.png\" alt=\"First opening of Davraz\" width=\"800\" height=\"650\"><\/a><\/p>\n\n<p>You need to provide \"Database URL\", \"Graph Name\", \"Database username\", and \"Database password\" fields. After that, if you click to \"Generate Token\" button, you are ready to go.<\/p>\n\n<p>You do <strong>NOT<\/strong> need to change \"Proxy Server URL\" if you don't want to use your own proxy. <\/p>\n\n<p>If your \"Database URL\" is wrong or if the TigerGraph instance is not active, you might get an error like the below <a href=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--4EGIrcQo--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/je3yqm1eaekwxzo74u4y.png\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--4EGIrcQo--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/je3yqm1eaekwxzo74u4y.png\" alt=\"TigerGraph instance is not active error message screenshot\" width=\"549\" height=\"245\"><\/a><\/p>\n\n<p>You might get errors like the below if you don't provide the correct username, password, or graph name.<br>\n<a href=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--y5YhSg0K--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/kv6w9zw9wr2gfqnujj3e.png\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--y5YhSg0K--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/kv6w9zw9wr2gfqnujj3e.png\" alt=\"username or password is wrong error message screenshot\" width=\"548\" height=\"123\"><\/a> <a href=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--SPsh2p13--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/w2o4uox05z6tfitu4qcz.png\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--SPsh2p13--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/w2o4uox05z6tfitu4qcz.png\" alt=\"Graph name is wrong error message screenshot\" width=\"555\" height=\"102\"><\/a><\/p>\n\n<p>If there is no error, you are good to GO! Below is a video showing how it works. Also, note that certain operations might require <strong>\"database secret\"<\/strong>. So you should provide or generate the secret of your TigerGraph database as well.<\/p>\n\n\n  \n\n\n<p>Also, note that the proxy server (<a href=\"https:\/\/tiger-api.herokuapp.com\/\">https:\/\/tiger-api.herokuapp.com\/<\/a>) might be down for some reason. (It is a free instance) So just refreshing it might help in some cases.<\/p>\n\n<h2>\n  \n  \n  Set-up for Neo4j\n<\/h2>\n\n<p>If you use Davraz from the GitHub deployment (<a href=\"https:\/\/canbax.github.io\/davraz\/\">https:\/\/canbax.github.io\/davraz\/<\/a>), you need to serve your Neo4j API from HTTPS. This is because you cannot communicate with an HTTP server from an HTTPS server. Setting up an HTTPS server and setting up the SSL policy seems a bit tedious for me. For this reason, I will run a local version of Davraz on my own machine with HTTP. And also a local Neo4j server again from my own machine with HTTP. Inside Neo4j settings, I set <code>dbms.security.auth_enabled=false<\/code> so I can make HTTP requests and get a response without providing any username and password.<\/p>\n\n<p>Below are my settings to connect to my local Neo4j instance. The database URL is <strong><a href=\"http:\/\/localhost:7474\/db\/data\/transaction\/commit\">http:\/\/localhost:7474\/db\/data\/transaction\/commit<\/a><\/strong>. Username and password are not necessary, they can be empty.<br>\n<a href=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--8TAlP7ns--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/ickc2ic48nacavn28gr8.png\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--8TAlP7ns--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/ickc2ic48nacavn28gr8.png\" alt=\"Settings for a Neo4j instance\" width=\"738\" height=\"580\"><\/a><\/p>\n\n<p>From below video, you can see how you can visualize Neo4j data.<\/p>\n\n\n  \n\n\n<p>Here you might see a strange view if the styles are not the default styles. See the below image for example. <a href=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--dCcF4Euh--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/2q1fqdo5jjitg3u52tox.png\" class=\"article-body-image-wrapper\"><img src=\"https:\/\/res.cloudinary.com\/practicaldev\/image\/fetch\/s--dCcF4Euh--\/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800\/https:\/\/dev-to-uploads.s3.amazonaws.com\/uploads\/articles\/2q1fqdo5jjitg3u52tox.png\" alt=\"Graph with incompatible styles\" width=\"800\" height=\"696\"><\/a><br>\nTo use default graph styles, you can click to <em>\"File\"<\/em>&gt;<em>\"Clear Graph Style\"<\/em>.<\/p>\n\n<p>Like TigerGraph, Neo4j also provides free cloud instances. <a href=\"https:\/\/neo4j.com\/cloud\/platform\/aura-graph-database\/\">Neo4j AuraDB<\/a> looks very cool and nice as well. Up to 50k nodes and 175k edges, it is free. Also, it has a nice visualizer called <em>\"Bloom\"<\/em>.<\/p>\n\n<h2>\n  \n  \n  Features\n<\/h2>\n\n<p>From <em>\"File\"<\/em> menu, you can save a graph as JSON file, load back from the file. You can save only the selected elements. You can export graph as an image. You can load different <a href=\"https:\/\/js.cytoscape.org\/#style\">graph styles<\/a>.<\/p>\n\n\n  \n\n\n<p>From <em>\"Edit\"<\/em> menu, you can delete selected elements, hide selected elements, show all the previously hidden elements and observe a history of graph states.<\/p>\n\n\n  \n\n\n<p>From <em>\"Data\"<\/em> menu, you can clear all the data or bring a sample data.<\/p>\n\n\n  \n\n\n<p>From <em>\"Layout\"<\/em> menu, you can run an incremental or randomized layout. There are many different layout types but the default is <a href=\"https:\/\/github.com\/iVis-at-Bilkent\/cytoscape.js-fcose\">fCoSE<\/a> algorithm.<\/p>\n\n\n  \n\n\n<p>From <em>\"Highlight\"<\/em> menu, elements can be emphasized to distinguish from others.<\/p>\n\n\n  \n\n\n<p>From <em>\"Compound\"<\/em> menu, compound elements can be created or removed.<\/p>\n\n\n  \n\n\n<p>From <em>\"Table\"<\/em> menu, whole data or a part of the existing data can be shown as table(s).<\/p>\n\n\n  \n\n\n<p>From <em>\"Cluster\"<\/em> menu, you can run \"Markov Clustering\" algorithm or cluster degree-1 nodes.<\/p>\n\n\n  \n\n\n","category":["neo4j","tigergraph","visualization","angular"]}]}}