All of above means same. Below I’ve explained why
Convert from QString to LPCWSTR
const wchar_t *keyName = (const wchar_t*)key.utf16();
LPCWSTR = const wchar_t
Here is how
LPCWSTR = CONST WCHAR
CONST = const
wchar_t = WCHAR
//so we can write like this
LPCWSTR str = (const wchar_t*)key.utf16();
Convert from LPCWSTR to QString
$csv = app_path().DIRECTORY_SEPARATOR."database".DIRECTORY_SEPARATOR."resources".DIRECTORY_SEPARATOR."locations.csv";
$query = sprintf("LOAD DATA INFILE '%s' INTO TABLE locations FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' ESCAPED BY '\"' LINES TERMINATED BY '\\n' IGNORE 0 LINES (`location_id`, `country`, `region`, `city`, `postal_code`, `lat`, `lng`, `metro_code`, `area_code`)", addslashes($csv));
May face this problem
SQLSTATE: Invalid authorization specification: 1045 Access denied for user ‘ww’@’localhost’ (using password: YES)
So the first thing I did was to check if the parameter “local_infile” was enabled in my mysql database by running the following command:
mysql> show variables;
As in my case was already, I added the following parameter in my config file laravel / database.php:
'options' => array(
PDO::MYSQL_ATTR_LOCAL_INFILE => true
And then added the argument ‘local’ for the load data infile command, thus:
$pdo = DB::connection()->pdo;
$pdo->exec("load data LOCAL infile '".path('data')."filetoimport.sql' replace into table tablename CHARACTER SET 'UTF8' FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\\n';");
$pdo = DB::connection()->pdo;
$pdo->exec("load data infile '".path('data')."filetoimport.sql' replace into table tablename CHARACTER SET 'UTF8' FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\\n';");
This is one solution
and other is
Try to give more privileges ..admin and query related. In my case giving more access worked.
Windows Registry is a virtual record of physically scattered hives, containing certain system and user settings. These records are employed by system components, third party applications, hardware, user profiles, and other great deal of stuff. A contaminated registry can lead to certain problematic situations, like sluggish PC performance, broken file extensions, and misconfigured applications.
Fortunately, Windows lets you enter the realm of its registry and make changes in it. You can create, remove, copy, rename, and modify registry entries for your own customization. However, to perform such tasks, you must possess an advanced level of knowledge and experience.
Assess registry entries to know their validity. Some of the basic types of entries are;
- Application Settings
- Uninstall Entries
- Shared DLLs
- Startup Items
- File Extension Association
- COM Components
- Drivers and Services
Detailed examples associating each of the above are described below. Each cleaning process requires Registry Editor. Wait a second! Just before editing your registry, make sure to create a backup to avoid inconvenience due to any mistake.
- Type regedit in the Run box or Start menu/screen Search
- Click Yes on UAC message to confirm your action
- Create a backup of your current registry by accessing File menu and selecting Export
- Under Export range select All, give .reg file a name and Save it
- If anything goes wrong during the course of registry cleanup, you can restore the backup by accessing Import option from File menu
- In the displayed Dialog box locate the .reg file created earlier and click Open.
sudo apt-get install imagemagick
for i in $(ls *.png); do convert -scale 400 $i th-$i; done
Code is like poetry
difficult to understand and often has other meaning than intended.
Code is like poetry.
Delightful to read
a pleasure to understand
a lifetime to master.