Arda Basoglu
  • Home
  • Blog
  • Links
  • Contact

Spritz İle Hızlı ve Tembel Okuma

3/9/2014

0 Comments

 
Resim
Spritz yeni bir hızlı okuma sistemi ve bir yazılım olarak çalışıyor. Bu yazılım sayesinde okuma sırasındaki göz hareketleriniz minimuma iniyor ve daha hızlı okuma yapılıyor. Spritz hakkında bolca övgü de, eleştiri de mevcut.

Benim ekleyeceğim yorum ise şu:

Spritz ve benzeri uygulamalar yaygınlaşırsa, ekranlar karşısında gün geçtikçe hareketsizleşen bedenimize göz hareketsizliği de eklenecek :)

www.spritzinc.com/the-science

0 Comments

How to search for folders only in Windows 7 ?

3/2/2014

1 Comment

 
If you want to limit your Windows search results to folders only, use the "type:folder" option at the end of your query.

Example: 

Intel type:folder
Resim
1 Comment

Sosyal Medyada Kedilerle Nasıl Rekabet Edilir?

2/11/2014

0 Comments

 

Sosyal Pazarlamacıları İçin Bir Rehber

Sosyal pazarlama konusu bir gizem değil. Hakkında ne kadar bilgili olunursa o kadar verimli olunacağı da açık. Bu alanda çalışanlar için verim de  hem psikolojik hem de ekonomik rahatlık yaratacaktır. Bu yüzden her zaman öğrenilecek birşeyler vardır deyip bu sunumu sizin de okumanızı tavsiye ederim. 
The 2014 Social Media Marketing Guide from Brand Networks
0 Comments

Hashmap Data Structure in Javascript, Example with Node.js 

1/21/2013

0 Comments

 
  1. // Author: Arda Basoglu, ardabasoglu@gmail.com
  2. // This example demonstrates the use of map like (like hash map in Java and dictionary in C#) data structure
  3. // The code is tested with a machine Node.js installed
  4. // If you have Node.js installed on your machine run the script by writing "node map.example.js" on the console
  5.  
  6. // create a map
  7. var map = {};
  8.  
  9. // Add key, value pairs into the map with random strings
  10. for (var i = 0; i < 500; i++) {
  11.     var item =generateRandomString();
  12.     var value = generateRandomString();
  13.     map[item] = value;
  14. };
  15.  
  16. // Output every key, value pair onto the screen
  17. for (var i in map) {
  18.     console.log("Key: " + i + ", Value: " + map[i]);
  19. }
  20.  
  21. // The function required for generating random strings
  22. function generateRandomString()
  23. {
  24.     var randomString = "";
  25.     var randomStringSource = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  26.  
  27.     for( var i=0; i < 5; i++ ){
  28.         randomString += randomStringSource.charAt(Math.floor(Math.random() * randomStringSource.length));
  29.     }
  30.    
  31.     return randomString;
  32. }
0 Comments

Node

6/16/2012

0 Comments

 
0 Comments

error: The program ['pg_config'] is required

5/31/2012

0 Comments

 

How to fix the installation problem of the module "pg" for Node in Mac OS X

Problem

When you issue npm install pg command to instal pg package for Node on your Mac OS X, you might get an error like this

        "...error: The program ['pg_config'] is required"

Error simply implies that pg installation cannot find pg_config file.

Solution

1. First make sure you installed PostgreSQL.
2. Find the path to your pg_config file. In my case it is /Library/PostreSQL/8.4/bin/pg_config
3. Open the Terminal and enter the following commands one by one    
    
    PG_CONFIG=/Library/PostreSQL/8.4/bin/pg_config
    export PG_CONFIG
    npm install pg
0 Comments

How To Sync Gmail Contacts With iPhone Without Any Problem

5/7/2012

5 Comments

 
Syncing your iPhone contacts might get ugly if you do not know how to do it or you use an app that is not well tailored for your needs. In this tutorial I'm going to show you how to sync your Gmail contacts (with groups) with your iPhone. Let's get started.

First, you need to backup your contacts from your Gamil account. To do that, go to Contacts and hit More tab and you will see a dropdown list. Choose Export and export your contacts as Google CSV format. If everything goes wrong you can bring all your contacts back from this backup. Besides you can save this file to your backup drive for another use.
Export Gmail Contacts
Export Gamil Contacts in Google CSV format
After backing up your contacts go to Settings/ Mail,Contacts, Calender on your iPhone and delete all the mail accounts before synchronization. You need to do it since synchronizing works best this way. Othervise you will end up with duplicate contacts or other unwanted behavior.
Delete All Email Accounts From iPhone
Delete iPhone Email Account
Next step is to install the required app. It is called Contacts EXtreme by POPo's Innovation Ltd. It was a free app when I installed it.
Install Contacts EXtreme on iPhone
When the installation is complete run Contacts EXtreme, hit More tab, scroll down and choose Clear iPhone Contacts. Later, choose Clear Local Sync Data (probably you don't need to do this if this is your first use; however, clearing local sync data won't give any damage).
Clear iPhone Contacts via Contacts EXtreme
Clear Local Sync Data via Contacts EXtreme
As a final step scroll up and choose Sync with Gmail Contacts. That's it.
Sync with Gmail Contacts
All these steps worked for me. If they do not work you please leave a comment and I'll try to help you. 
5 Comments

.Net Windows Forms login form with a progress bar control

7/18/2011

0 Comments

 
Picture
If you are using a login form in your .Net Windows Forms application you might want to show a progress bar to the user during authentication takes a little time. Doing that makes your application responsive and makes the users think your application is doing some work and not stuck. 
You choose the Style property of the progress bar as "Marquee" since you do not know how long authentication will take (possibly not more than 1 or 2 seconds but sometimes servers may respond a little longer than that).
By creating the progress bar control with the Marquee style, you can animate it in a way that shows activity but does not indicate what proportion of the task is complete. The highlighted part of the progress bar moves repeatedly along the length of the bar. You can start and stop the animation, and control its speed.
In this example when the user enters the user name / password and hits the "Go" button, the lengthy operation is emulated by Thread.Sleep(3000) call. All the labels, textboxes and the submit button are disabled when the highlight of the progress bar moves for 3 seconds. After it finishes moving the controls are enabled again and progress bar is hidden by Hide() method of itself. This gives the cue to the users that they cannot change their input during the authentication process.

Download the code (Visual Studio project)

loginwithprogressbar.zip
File Size: 10 kb
File Type: zip
Download File

0 Comments

Peynir, ekmek, zeytin, domates, biber

7/13/2011

0 Comments

 
Kızarmış ekmek üzerinde Bergama tulumu ve Gemlik zeytini ve balkonumda yetişen taze biber ve domates. Ağzım sulandı.
Peynir, ekmek, zeytin, domates, biber
0 Comments

Encrypting the Windows Forms Application Settings

12/28/2010

6 Comments

 
Sometimes you need to keep sensitive information in a Windows Forms application settings file. The settings file is plain text by default. In this case, you'd better encrypt this sensitive information, like a password, to protect from someone capturing the file (user.config, app.config depending on your choice) and seeing the content of the settings file and trying to abuse it.

Encrypting settings is very easy. Al you need is:
  • A settings class derives from ApplicationSettingsBase
  • An encryption utility class
  • A couple of lines to get, set and save the settings
You can see the example files below and you can dowload the working VS 2010 Project here. You'll be needing .NET Framework 4.0.

encryptingwindowsformssettings.zip
File Size: 96 kb
File Type: zip
Download File

A settings class derives from ApplicationSettingsBase

using System;
using System.Configuration;

namespace EncryptingWindowsFormsSettings
{
    internal class AppSettings : ApplicationSettingsBase
    {
        // Shared secreet is used for encryption
        // You can change this according to your preference
        private const string SharedSecret = "sSDffdf46FFs";

        // this attribute specifies that an application settings group or
        // property contains distinct values for each user of an application
        [UserScopedSetting]
        public string Password
        {
            get
            {
                // this part is necessary
                // for the first time when there is still nothing to
                // read in the settings file. In other words, the
                // "Password" is null or empty.
                try
                {
                    // Crypto is the utiliy class that holds the encryption logic
                    // You can use your own encryption utility class for more control
                    return Crypto.DecryptStringAES(((string)this["Password"]), SharedSecret);
                }
                catch (FormatException)
                {
                    // simply return nothing in case of exception
                    return ((string)this["Password"]);
                }
            }
            set
            {
                // When you save the settings, the password will be encrypted
                this["Password"] = Crypto.EncryptStringAES(value, SharedSecret);
            }
        }
    }
}
 

An encryption utility class

using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;

namespace EncryptingWindowsFormsSettings
{
    // Encrypt/Decrypt string in .NET
    // http://stackoverflow.com/questions/202011/encrypt-decrypt-string-in-net
    public static class Crypto
    {
        private static readonly byte[] Salt = Encoding.ASCII.GetBytes("dE4ffrTy7/!");

        /// <summary>
        /// Encrypt the given string using AES.  The string can be decrypted using
        /// DecryptStringAES().  The sharedSecret parameters must match.
        /// </summary>
        /// <param name="plainText">The text to encrypt.</param>
        /// <param name="sharedSecret">A password used to generate a key for encryption.</param>
        public static string EncryptStringAES(string plainText, string sharedSecret)
        {
            if (string.IsNullOrEmpty(plainText))
                throw new ArgumentNullException("plainText");
            if (string.IsNullOrEmpty(sharedSecret))
                throw new ArgumentNullException("sharedSecret");

            string outStr;                       // Encrypted string to return
            RijndaelManaged aesAlg = null;              // RijndaelManaged object used to encrypt the data.

            try
            {
                // generate the key from the shared secret and the salt
                Rfc2898DeriveBytes key = new Rfc2898DeriveBytes(sharedSecret, Salt);

                // Create a RijndaelManaged object
                // with the specified key and IV.
                aesAlg = new RijndaelManaged();
                aesAlg.Key = key.GetBytes(aesAlg.KeySize / 8);
                aesAlg.IV = key.GetBytes(aesAlg.BlockSize / 8);

                // Create a decrytor to perform the stream transform.
                ICryptoTransform encryptor = aesAlg.CreateEncryptor(aesAlg.Key, aesAlg.IV);

                // Create the streams used for encryption.
                using (MemoryStream msEncrypt = new MemoryStream())
                {
                    using (CryptoStream csEncrypt = new CryptoStream(msEncrypt, encryptor, CryptoStreamMode.Write))
                    {
                        using (StreamWriter swEncrypt = new StreamWriter(csEncrypt))
                        {

                            //Write all data to the stream.
                            swEncrypt.Write(plainText);
                        }
                    }
                    outStr = Convert.ToBase64String(msEncrypt.ToArray());
                }
            }
            finally
            {
                // Clear the RijndaelManaged object.
                if (aesAlg != null)
                    aesAlg.Clear();
            }

            // Return the encrypted bytes from the memory stream.
            return outStr;
        }

        /// <summary>
        /// Decrypt the given string.  Assumes the string was encrypted using
        /// EncryptStringAES(), using an identical sharedSecret.
        /// </summary>
        /// <param name="cipherText">The text to decrypt.</param>
        /// <param name="sharedSecret">A password used to generate a key for decryption.</param>
        public static string DecryptStringAES(string cipherText, string sharedSecret)
        {
            if (string.IsNullOrEmpty(cipherText))
                throw new ArgumentNullException("cipherText");
            if (string.IsNullOrEmpty(sharedSecret))
                throw new ArgumentNullException("sharedSecret");

            // Declare the RijndaelManaged object
            // used to decrypt the data.
            RijndaelManaged aesAlg = null;

            // Declare the string used to hold
            // the decrypted text.
            string plaintext;

            try
            {
                // generate the key from the shared secret and the salt
                Rfc2898DeriveBytes key = new Rfc2898DeriveBytes(sharedSecret, Salt);

                // Create a RijndaelManaged object
                // with the specified key and IV.
                aesAlg = new RijndaelManaged();
                aesAlg.Key = key.GetBytes(aesAlg.KeySize / 8);
                aesAlg.IV = key.GetBytes(aesAlg.BlockSize / 8);

                // Create a decrytor to perform the stream transform.
                ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV);
                // Create the streams used for decryption.                
                byte[] bytes = Convert.FromBase64String(cipherText);
                using (MemoryStream msDecrypt = new MemoryStream(bytes))
                {
                    using (CryptoStream csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read))
                    {
                        using (StreamReader srDecrypt = new StreamReader(csDecrypt))

                            // Read the decrypted bytes from the decrypting stream
                            // and place them in a string.
                            plaintext = srDecrypt.ReadToEnd();
                    }
                }
            }
            finally
            {
                // Clear the RijndaelManaged object.
                if (aesAlg != null)
                    aesAlg.Clear();
            }

            return plaintext;
        }
    }
}

A couple of lines to get, set and save the settings

using System;
using System.Windows.Forms;

namespace EncryptingWindowsFormsSettings
{
    public partial class Form1 : Form
    {
        private AppSettings _appSettings;

        public Form1()
        {
            InitializeComponent();
            Load += Form1_Load;
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            // get an instance of the AppSettings object
            _appSettings = new AppSettings();

            // bind the 'Text' property of textBoxPassword with
      // the 'Password' property of _appSettings
            textBoxPassword.DataBindings.Add(new Binding("Text", _appSettings, "Password"));
        }

        private void ButtonCloseClick(object sender, EventArgs e)
        {
            _appSettings.Save();
        }
    }
}
 
6 Comments
<<Previous
Forward>>

    Author

    Arda Basoglu is a digital marketing agency owner, software engineer/developer, musician. Worked for several companies: TWB, BNB Software, PINC Solutions,  hakia, Nurol,  NTV. 

    Archives

    October 2021
    August 2021
    June 2020
    April 2020
    September 2017
    July 2017
    April 2017
    February 2017
    September 2015
    October 2014
    March 2014
    February 2014
    January 2013
    June 2012
    May 2012
    July 2011
    December 2010
    November 2010
    October 2010
    August 2010
    July 2010
    June 2010
    March 2010
    February 2010
    January 2010
    December 2009
    November 2009
    October 2009
    August 2009
    June 2009
    May 2009

    Categories

    All
    Açık Kaynak
    Algorithms
    Avşa
    Big O Notation
    Certbot
    Database
    Ekmek
    Ekonomi
    Encrypting Settings
    Enflasyon
    Google Maps
    Heroku
    Heroku Rake Fixture Yaml Error
    JavaScript
    Mac Os X
    Magento
    .net
    .net Forms Login Progress Bar
    Node
    Node.js
    Node-postgres
    Personal
    Peynir
    Postgresql
    Rack 1.2.1 Utils.rb Error Heroku
    Ruby On Rails
    Windows 7
    Windows Froms
    Windsurfing
    Wordpress
    Yankoltuk

    RSS Feed

Powered by Create your own unique website with customizable templates.