<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: smithmchael550</title>
    <description>The latest articles on DEV Community by smithmchael550 (@smithmchael550).</description>
    <link>https://dev.to/smithmchael550</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F520700%2F29e4bc5c-b527-4156-bb91-595f92ad6d30.png</url>
      <title>DEV Community: smithmchael550</title>
      <link>https://dev.to/smithmchael550</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/smithmchael550"/>
    <language>en</language>
    <item>
      <title>The configuration file now needs a secret passphrase (blowfish_secret).</title>
      <dc:creator>smithmchael550</dc:creator>
      <pubDate>Thu, 26 Nov 2020 16:35:58 +0000</pubDate>
      <link>https://dev.to/smithmchael550/the-configuration-file-now-needs-a-secret-passphrase-blowfishsecret-4ank</link>
      <guid>https://dev.to/smithmchael550/the-configuration-file-now-needs-a-secret-passphrase-blowfishsecret-4ank</guid>
      <description>&lt;p&gt;There are a couple of things you must consider while installing phpMyAdmin to manage MYSQL. You may receive some errors if you do not complete all the prerequisites but they are easy to resolve. The first error probably you will receive is&lt;/p&gt;

&lt;h1&gt;
  
  
  Error:
&lt;/h1&gt;

&lt;p&gt;“The configuration file now needs a secret passphrase (blowfish_secret)”.&lt;/p&gt;

&lt;p&gt;This can be resolved by copying the sample configuration file to the correct name and make small modifications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Copy sample configuration file to real configuration file:
&lt;/h2&gt;

&lt;p&gt;You need to edit the line and add a blow_fish secret. For this purpose, you can use an online blowfish_secret variables generator. The online generator will output 36 to 46 characters. The output includes lowercase letters, uppercase letters, numbers, and symbols. &lt;a href="https://www.kodlogs.com/blog/172/configuration-file-needs-secret-passphrase-blowfish_secret"&gt;Read more.&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Update the blowfish_secret
&lt;/h3&gt;

</description>
    </item>
    <item>
      <title>How to copy an image from one folder to another in php?</title>
      <dc:creator>smithmchael550</dc:creator>
      <pubDate>Thu, 26 Nov 2020 09:31:54 +0000</pubDate>
      <link>https://dev.to/smithmchael550/how-to-copy-an-image-from-one-folder-to-another-in-php-5a2f</link>
      <guid>https://dev.to/smithmchael550/how-to-copy-an-image-from-one-folder-to-another-in-php-5a2f</guid>
      <description>&lt;p&gt;To copy an image from one folder to another folder you have to read the image file that you want to copy. Then create another file with the same name as the original file in the directory to where you want to copy.&lt;/p&gt;

&lt;h1&gt;
  
  
  Copy() function:
&lt;/h1&gt;

&lt;p&gt;The copy() function in PHP is used to copy a file from source to target or destination directory. It makes a copy of the source file to the destination file and if the destination file already exists, it gets overwritten. The copy() function returns true on success and false on failure.&lt;br&gt;
Read more at &lt;a href="https://www.kodlogs.com/blog/409/how-to-copy-an-image-from-one-folder-to-another-in-php"&gt;kodlogs&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

$old_sub_dir = '/directory/containing/the/images';

$new_sub_dir = '/directory/waiting/for/the/images';



 //get the content from directory

 $contents = array();

 $dir = opendir($_SERVER['DOCUMENT_ROOT'] . $old_sub_dir);

while (false !== ($file = readdir($dir)))

{

 $contents[] = $file;

 }

 closedir($dir);



//get only jpeg images from folder

 $jpeg_contents = array();

 foreach($contents as $file) {

 if (eregi('.jpg{1}$', $file)) {

 $jpeg_contents[] = $file;

}

}

// copy each jpeg from directory 'source' to directory 'destination'

 foreach($jpeg_contents as $file) { 

copy($_SERVER['DOCUMENT_ROOT'] . $old_sub_dir . '/' . $file, $_SERVER['DOCUMENT_ROOT'] . $new_sub_dir . '/' . $file);

 }

?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>php</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>ISO C++ forbids converting a string constant to char*</title>
      <dc:creator>smithmchael550</dc:creator>
      <pubDate>Wed, 25 Nov 2020 12:21:13 +0000</pubDate>
      <link>https://dev.to/smithmchael550/iso-c-forbids-converting-a-string-constant-to-char-2kog</link>
      <guid>https://dev.to/smithmchael550/iso-c-forbids-converting-a-string-constant-to-char-2kog</guid>
      <description>&lt;p&gt;&lt;br&gt;
&lt;code&gt;char* p = "abc";&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Problem
&lt;/h1&gt;

&lt;p&gt;In the given line of code, we defined an array of char* objects. We initialize pointers with string constants. But the compiler shows error and as the error explains itself, converting a string constant not allowed in C++. There is no extra explanation for this error because it is a rule of C++ and as we all know C++ is a very sensitive programming language as both “a” and “A” have different meanings along with memory allocation.&lt;/p&gt;

&lt;p&gt;If you have use C instead of C++ a lot, then you may be wondering why is a conversion from string constant to char* is valid in C but invalid in C++?&lt;br&gt;
Till  C++03, line of code given above was valid, but used a criticize implicit conversion i.e., a string constant should be treated as of type char const *, because you can't modify its contents. And if you modify its contents, there will be undefined behaviour.&lt;br&gt;
When C++11 comes to the real world of programming, the implicit conversion, which used to be criticized, was officially removed, so code that depends on it should no longer compile.&lt;/p&gt;

&lt;p&gt;Read more at kodlogs.com&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How?&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to resolve this problem?
&lt;/h2&gt;

&lt;p&gt;As we discuss why converting a string literal to const char* is not allowed, so instead of doing this, we can declare an array of const char*. If we don’t modify the strings pointed by the array, this should not be a problem.&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Write a loop that sets newscores to oldscores shifted once left, with element 0 copied to the end.</title>
      <dc:creator>smithmchael550</dc:creator>
      <pubDate>Wed, 25 Nov 2020 11:55:26 +0000</pubDate>
      <link>https://dev.to/smithmchael550/write-a-loop-that-sets-newscores-to-oldscores-shifted-once-left-with-element-0-copied-to-the-end-ko</link>
      <guid>https://dev.to/smithmchael550/write-a-loop-that-sets-newscores-to-oldscores-shifted-once-left-with-element-0-copied-to-the-end-ko</guid>
      <description>&lt;p&gt;I got a problem with my textbook under the for-loop chapter. It’s saying something like this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Write a loop that sets newscores to oldscores shifted once left, with element 0 copied to the end. ex: if oldscores = {10, 20, 30, 40}, then  newscores = {20, 30, 40, 10}.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I am learning c++ and writing my code in codeblocks. What could be the possible solution to this problem? As far as I can understand the above problem it says to set some values to oldscore from newscore. Once shifted, then we need to copy the very first vale with 0  and shift it to the end.&lt;/p&gt;

&lt;h1&gt;
  
  
  Resolution:
&lt;/h1&gt;

&lt;p&gt;I’ve found a possible solution to the problem above. I am attaching my sample code snippet below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;int main()
{
   const int Value_Size = 4;

   int oldScores[Value_Size] = { 10, 20, 30, 40 };
   int newScores[Value_Size];

   for (int n = 0; n &amp;lt; Value_Size; ++n)
   {
      std::cout &amp;lt;&amp;lt; oldScores[n] &amp;lt;&amp;lt; ' ';
   }
   std::cout &amp;lt;&amp;lt; '\n';

   newScores[Value_Size - 1] = oldScores[0];

   for (int n = 0; n &amp;lt; Value_Size - 1; n++)
   {
      newScores[n] = oldScores[n + 1];
   }

   for (int n = 0; n &amp;lt; Value_Size; ++n)
   {
      std::cout &amp;lt;&amp;lt; newScores[i] &amp;lt;&amp;lt; ' ';
   }
   std::cout &amp;lt;&amp;lt; '\n';
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is it.&lt;br&gt;
But you can &lt;a href="https://www.kodlogs.com/blog/5/write-newscores-oldscores-shifted-left-with-element-copied"&gt;read more&lt;/a&gt; at Kodlogs.com&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>computerscience</category>
    </item>
  </channel>
</rss>
