یافته های شخصی من



Basically, API level means the Android version. This defines for which version you are targeting your application and what is going to be the minimum level of android version in your application will run. For setting Minimum level and Maximum level android studio provides two terminologies.

minSdkVersion means minimum Android OS version that will support your app and targetSdkVersion means the version for which you are actually developing your application. Your app will be compatible with all the version of android which are falling between minimum level SDK and target SDK.


How to change API SDK level in Android Studio

For changing the API level in android we have two different Approaches, let’s check both one by one:

Approach 1 To Change SDK API Level in Android Studio:

Step 1: Open your Android Studio, and go to Menu. File >Project Structure.

project structure in Android Studio

Step 2: In project Structure window, select app module in the list given on left side.

Step 3: Select the Flavors tab and under this you will have an option for setting Min Sdk Version” and for setting Target Sdk Version”.

change api sdk level in Android Studio

You can check the name of version too in the drop down list while selecting the API level that makes the selection more clearer for anyone. Because sometimes remembering numbers is bit messy.

Step 4: Select both the versions and Click OK.


Approach 2 To Change API (Android Version) in Android Studio:

That will be pretty straight forward, but you need to stay very alert while making changes here.

Step 1: if you are project is opened in android option then select open Gradle Scripts > build.gradle(Module: app)

if you are in project View then click on your project folder > app > build.gradle

change sdk api level in build gradle android studio

Step 2: Here you have to change minimum and Maximum sdk level as per your requirement. check the below given code:

defaultConfig {
    applicationId "com.AbhiAndroid.Android.myProject"
    minSdkVersion 14
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}

Step 3: Click on Sync Now and You are ready to go.

sync now change api sdk android studio

Note: If you are choosing the First Approach then you need not to make changes in Gradle. It will automatically update the gradle.


Change the group permission for the folder

sudo chown -R User /home/User/.composer/cache/repo/https---packagist.org

and the Files folder too

sudo chown -R User /home/User/.composer/cache/files/

I'm assuming User is your username, if not change the 4th parameter to your username.

If the problem still persists try

sudo chown -R User /home/User/.composer

Now, there is a chance that you won't be able to create your app directory, if that happens do the same for your html folder or the folder you are trying to create yourproject in.

Hope this helps.


You can use these ANSI escape codes:

Black        0;30     Dark Gray     1;30
Red          0;31     Light Red     1;31
Green        0;32     Light Green   1;32
Brown/Orange 0;33     Yellow        1;33
Blue         0;34     Light Blue    1;34
Purple       0;35     Light Purple  1;35
Cyan         0;36     Light Cyan    1;36
Light Gray   0;37     White         1;37

And then use them like this in your script:

#    .---------- constant part!
#    vvvv vvvv-- the code from above
RED='\033[0;31m'
NC='\033[0m' # No Color
printf "I ${RED}love${NC} Stack Overflow\n"

which prints love in red.

From @james-lim's comment, if you are using the echo command, be sure to use the -e flag to allow backslash escapes.

# Continued from above example
echo -e "I ${RED}love${NC} Stack Overflow"

(don't add "\n" when using echo unless you want to add additional empty line)


  1. Create a new repository on GitHub. To avoid errors, do not initialize the new repository with README, license, or gitignore files. You can add these files after your project has been pushed to GitHub.
  2. Open Git Bash.

  3. Change the current working directory to your local project.

  4. Initialize the local directory as a Git repository.

    git init
    
  5. Add the files in your new local repository. This stages them for the first commit.

    git add .
    # Adds the files in the local repository and stages them for commit. To unstage a file, use 'git reset HEAD YOUR-FILE'.
  6. Commit the files that you've staged in your local repository.

    git commit -m "First commit"
    # Commits the tracked changes and prepares them to be pushed to a remote repository. To remove this commit and modify the file, use 'git reset --soft HEAD~1' and commit and add the file again.
  7. Copy remote repository URL field

    At the top of your GitHub repository's Quick Setup page, click  to copy the remote repository URL.
  8. In the Command prompt, add the URL for the remote repository where your local repository will be pushed.

    git remote add origin remote repository URL
    # Sets the new remote
    git remote -v
    # Verifies the new remote URL
  9. Push the changes in your local repository to GitHub.

    git push origin master
    # Pushes the changes in your local repository up to the remote repository you specified as the origin

Steps to install curl in windows

Install cURL on Windows

There are 4 steps to follow to get cURL installed on Windows.

Step 1 and Step 2 is to install SSL library. Step 3 is to install cURL. Step 4 is to install a recent certificate

Step One: Install Visual C++ 2008 Redistributables

From https://www.microsoft.com/en-za/download/details.aspx?id=29 For 64bit systems Visual C++ 2008 Redistributables (x64) For 32bit systems Visual C++ 2008 Redistributables (x32)

Step Two: Install Win(32/64) OpenSSL v1.0.0k Light

From http://www.shininglightpro.com/products/Win32OpenSSL.html For 64bit systems Win64 OpenSSL v1.0.0k Light For 32bit systems Win32 OpenSSL v1.0.0k Light

Step Three: Install cURL

Depending on if your system is 32 or 64 bit, download the corresponding** curl.exe.** For example, go to the Win64 - Generic section and download the Win64 binary with SSL support (the one where SSL is not crossed out). Visit http://curl.haxx.se/download.html More specific Link: http://curl.haxx.se/latest.cgi?curl=win64-ssl-sspi

Copy curl.exe to C:\Windows\System32

Step Four: Install Recent Certificates

Do not skip this step. Download a recent copy of valid CERT files from https://curl.haxx.se/ca/cacert.pem Copy it to the same folder as you placed curl.exe (C:\Windows\System32) and rename it as curl-ca-bundle.crt

If you have already installed curl or after doing the above steps, add the directory where it's installed to the windows path:

1 - From the Desktop, right-click My Computer and click Properties.
2 - Click Advanced System Settings .
3 - In the System Properties window click the Environment Variables button.
4 - Select Path and click Edit.
5 - Append ;c:\path to curl directory at the end.
5 - Click OK.
6 - Close and re-open the command prompt


Server side

If you want something easy to re-use or automate, you can use Postgresql's built in COPY command. e.g.

Copy (Select * From foo) To '/tmp/test.csv' With CSV DELIMITER ',';

This approach runs entirely on the remote server - it can't write to your local PC. It also needs to be run as a Postgres "superuser" (normally called "root") because Postgres can't stop it doing nasty things with that machine's local filesystem.

That doesn't actually mean you have to be connected as a superuser (automating that would be a security risk of a different kind), because you can use the SECURITY DEFINER option to CREATE FUNCTION to make a function which runs as though you were a superuser.

The crucial part is that your function is there to perform additional checks, not just by-pass the security - so you could write a function which exports the exact data you need, or you could write something which can accept various options as long as they meet a strict whitelist. You need to check two things:

  1. Which files should the user be allowed to read/write on disk? This might be a particular directory, for instance, and the filename might have to have a suitable prefix or extension.
  2. Which tables should the user be able to read/write in the database? This would normally be defined by GRANTs in the database, but the function is now running as a superuser, so tables which would normally be "out of bounds" will be fully accessible. You probably don’t want to let someone invoke your function and add rows on the end of your users” table…

I've written a blog post expanding on this approach, including some examples of functions that export (or import) files and tables meeting strict conditions.


Client side

The other approach is to do the file handling on the client side, i.e. in your application or script. The Postgres server doesn't need to know what file you're copying to, it just spits out the data and the client puts it somewhere.

The underlying syntax for this is the COPY TO STDOUT command, and graphical tools like pgAdmin will wrap it for you in a nice dialog.

The psql command-line client has a special "meta-command" called \copy, which takes all the same options as the "real" COPY, but is run inside the client:

\copy (Select * From foo) To '/tmp/test.csv' With CSV

Note that there is no terminating ;, because meta-commands are terminated by newline, unlike SQL commands.

From the docs:

Do not confuse COPY with the psql instruction \copy. \copy invokes COPY FROM STDIN or COPY TO STDOUT, and then fetches/stores the data in a file accessible to the psql client. Thus, file accessibility and access rights depend on the client rather than the server when \copy is used.

Your application programming language may also have support for pushing or fetching the data, but you cannot generally use COPY FROM STDIN/TO STDOUT within a standard SQL statement, because there is no way of connecting the input/output stream. PHP's PostgreSQL handler (not PDO) includes very basic pg_copy_from and pg_copy_to functions which copy to/from a PHP array, which may not be efficient for large data sets.


// You can call the function as you like
if (!function_exists('mb_str_word_count'))
{
    function mb_str_word_count($string, $format = 0, $charlist = '[]') {
        mb_internal_encoding( 'UTF-8');
        mb_regex_encoding( 'UTF-8');

        $words = mb_split('[^\x{0600}-\x{06FF}]', $string);
        switch ($format) {
            case 0:
                return count($words);
                break;
            case 1:
            case 2:
                return $words;
                break;
            default:
                return $words;
                break;
        }
    };
}



echo mb_str_word_count("القاهرة هى عاصمة مصر وباریس هى عاصمة فرنسا") . PHP_EOL

تبلیغات

محل تبلیغات شما
محل تبلیغات شما محل تبلیغات شما

آخرین وبلاگ ها

آخرین جستجو ها

No-love or love-Z گاه نوشت‌های من همه چیز از همه جا Edward طراحی حرفه ای وب سایت دانلود اهنگ جدید یادداشت های یک شهروند نسبتا دغدغه مند! vardfas advertise آموزش جمع آوری بیت کوین