<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Web Development &#8211; Blackbams Blog</title>
	<atom:link href="https://blog.blackbam.at/category/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.blackbam.at</link>
	<description>development - digital arts - internet</description>
	<lastBuildDate>Sat, 16 May 2020 11:15:07 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.1</generator>
	<item>
		<title>Speaker at WordCamp Vienna 2020: How to create high-quality and long living WordPress Projects</title>
		<link>https://blog.blackbam.at/2020/05/16/speaker-at-wordcamp-vienna-2020-how-to-create-high-quality-and-long-living-wordpress-projects/</link>
					<comments>https://blog.blackbam.at/2020/05/16/speaker-at-wordcamp-vienna-2020-how-to-create-high-quality-and-long-living-wordpress-projects/#respond</comments>
		
		<dc:creator><![CDATA[Blackbam]]></dc:creator>
		<pubDate>Sat, 16 May 2020 11:07:15 +0000</pubDate>
				<category><![CDATA[Talks]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[David Stöckl]]></category>
		<category><![CDATA[Speaker]]></category>
		<category><![CDATA[Talk]]></category>
		<category><![CDATA[wordcamp]]></category>
		<category><![CDATA[wordcamp vienna 2020]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">https://blog.blackbam.at/?p=2408</guid>

					<description><![CDATA[Today a little post about myself: I was speaker at Wordcamp Vienna 2020. It was my first talk in front of a huge audience and therefore definitely a challenge. Anyway I a am proud that I have done it and the message was recieved by the audience quite well. I had to speak in the [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Today a little post about myself: I was speaker at Wordcamp Vienna 2020. It was my first talk in front of a huge audience and therefore definitely a challenge. Anyway I a am proud that I have done it and the message was recieved by the audience quite well. I had to speak in the german track therefore the video is only available in german. By the way: This Blog was created in the year 2008 and required barely any maintenance work since then &#8211; though the code is 12 years old.</p>
<p>&nbsp;</p>
<p><iframe src="https://videopress.com/embed/rpSZwQgA" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe> <script src="https://videopress.com/videopress-iframe.js"></script></p>
<p><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fblog.blackbam.at%2F2020%2F05%2F16%2Fspeaker-at-wordcamp-vienna-2020-how-to-create-high-quality-and-long-living-wordpress-projects%2F&#038;title=Speaker%20at%20WordCamp%20Vienna%202020%3A%20How%20to%20create%20high-quality%20and%20long%20living%20WordPress%20Projects" data-a2a-url="https://blog.blackbam.at/2020/05/16/speaker-at-wordcamp-vienna-2020-how-to-create-high-quality-and-long-living-wordpress-projects/" data-a2a-title="Speaker at WordCamp Vienna 2020: How to create high-quality and long living WordPress Projects"><img src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded>
					
					<wfw:commentRss>https://blog.blackbam.at/2020/05/16/speaker-at-wordcamp-vienna-2020-how-to-create-high-quality-and-long-living-wordpress-projects/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Laravel in five minutes: A super short crash course for the awesome PHP framework (principles and core functionalities)</title>
		<link>https://blog.blackbam.at/2019/07/08/laravel-in-five-minutes-a-super-short-crash-course-for-the-awesome-php-framework-principles-and-core-functionalities/</link>
					<comments>https://blog.blackbam.at/2019/07/08/laravel-in-five-minutes-a-super-short-crash-course-for-the-awesome-php-framework-principles-and-core-functionalities/#respond</comments>
		
		<dc:creator><![CDATA[Blackbam]]></dc:creator>
		<pubDate>Mon, 08 Jul 2019 19:44:35 +0000</pubDate>
				<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[Laravel]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[crash course]]></category>
		<category><![CDATA[dependency injection]]></category>
		<category><![CDATA[for dummies]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[middleware]]></category>
		<category><![CDATA[Tutorial]]></category>
		<guid isPermaLink="false">https://blog.blackbam.at/?p=2384</guid>

					<description><![CDATA[Laravel super short five minutes crash course - an overview of what it is, the core concepts and the core functionalities.]]></description>
										<content:encoded><![CDATA[<p>For understanding this Q&amp;A style tutorial you should have basic knowledge about PHP programming and frameworks. You do not have to know Laravel yet. For the real documentation just learn <a href="https://laravel.com/docs/">https://laravel.com/docs/</a> &#8211; most information in this tutorial is just a real short summary of the documentation. It is useful though if you have to learn about what Laravel is and what the most important concepts and components are.</p>
<p>&nbsp;</p>
<p><strong>Why should I even use Laravel?</strong></p>
<p>Because it is a super clean, easy to use PHP framework. My personal experience (this is subjective) told me that it is way easier to understand than the whole Symfony framework (Laravel is built on Symfony) or the Zend Frameworks. Symfony and Zend are both great frameworks, for sure, but Laravel offers you <em>simplicity</em>.</p>
<p>Laravel enables you to use best practice coding techniques for object-oriented programming. It comes with a powerful set of features for building solid web applications and assists you with solving common as well as complex problems.</p>
<p>&nbsp;</p>
<p><strong>Why shall Laravel be used with the newest PHP version (best will be the upcoming PHP 7.4)?</strong></p>
<p>Laravel makes heavy use of modern features within the PHP language. It is completely object oriented and uses e.g. typed input parameters which came with PHP 7.</p>
<p>The real great thing about PHP 7.4 is that it offers <strong>typed properties</strong>, <strong>covariant returns</strong> (more generic in subclass) and <strong>contravariant input parameters</strong> (more specific in subclass). This is extremely powerful (you should read more about it)!</p>
<p><strong> </strong></p>
<p><strong>What is Dependency Injection?</strong></p>
<p>Definition (Wikipedia): “In software engineering, dependency injection is a technique whereby one object supplies the dependencies of another object. A &#8220;dependency&#8221; is an object that can be used, for example a service. Instead of a client specifying which service it will use, something tells the client what service to use. The &#8220;injection&#8221; refers to the passing of a dependency (a service) into the object (a client) that would use it. The service is made part of the client&#8217;s state. Passing the service to the client, rather than allowing a client to build or find the service, is the fundamental requirement of the pattern.</p>
<p>The intent behind dependency injection is to achieve Separation of Concerns of construction and use of objects. This can increase readability and code reuse.</p>
<p>Dependency injection is one form of the broader technique of inversion of control. The client delegates the responsibility of providing its dependencies to external code (the injector). The client is not allowed to call the injector code; it is the injecting code that constructs the services and calls the client to inject them. This means the client code does not need to know about the injecting code, how to construct the services or even which actual services it is using; the client only needs to know about the intrinsic interfaces of the services because these define how the client may use the services. This separates the responsibilities of use and construction.”</p>
<p>That means that an object either is provided with another required object within its constructor or it just specifies some interface which is used for type hinting in constructors or methods.</p>
<p>The purpose of this is to get rid of dependencies and to achieve loose coupling (and high cohesion).</p>
<p>&nbsp;</p>
<p><strong>What is a Service Container and what is the Laravel Service Container doing?</strong></p>
<p>A Service Container (or dependency injection container) is simply a PHP object that manages the instantiation of services (i.e. objects). The Service Container in Laravel is a Dependency Injection Container and a Registry for the application. The advantages of using a Service Container over creating manually your objects are.</p>
<p>It is often called with App::bind App:make etc.</p>
<p>The service provider is creating concrete classes automatically when required.</p>
<p>Class dependencies can be managed on object creation and it is used as a registry.</p>
<p>Laravel does this with binding certain services to the App:</p>
<p><code>$this-&gt;app-&gt;bind('FooService', \App\Services\FooService::class);</code></p>
<p>Essentially we are telling Laravel: “Hey store this object in your bag of tricks and label it as FooService”. Remember to always bind your services within the register method of your service providers.</p>
<p>There are also events in the service container where somebody can register to.</p>
<p><strong> </strong></p>
<p><strong>What is a Service Provider?</strong></p>
<p>Core part of a Laravel application, resides in Providers directory. Has usually a special purpose like e.g. Authentication, Translation, ….</p>
<p>Service providers are usually registered on application bootstrap. All service providers are registered in <strong>app/config.php.</strong></p>
<p>A service provider has a register and a boot method. The register method is called early and is for registering with the Service Container, the boot method is called after all Services has been registered and therefore you can use all Service Container within it.</p>
<p>&nbsp;</p>
<p><strong>What is „type hinting“?</strong></p>
<p>Methods / functions with typed input parameters (optional in PHP).</p>
<p>&nbsp;</p>
<p><strong>What is (dynamic) binding in Laravel?</strong></p>
<p>Laravel usually means binding a service provider to the service container. Almost all service container bindings will be registered within service providers.</p>
<p>&nbsp;</p>
<p><strong>What is middleware?</strong></p>
<p>A layer between a client request from the frontend and a resource (data) in the backend. Therefore the logical part oft he backend which glues certain programs / part of a program together. It simplifies backend resource requests.</p>
<p>Middleware also serves the purpose of load balancing (distributing requests), concurrency, securring the backend,  …</p>
<p>Laravel offers many Middleware objects. One middleware for instance is for authentication, but you can also use middleware for certain headers for instance.</p>
<p>&nbsp;</p>
<p><strong>What is a Facade?</strong></p>
<p>A Facade is a programming design pattern. It usually offers <strong><em>a simplified standardized interface to a certain set of sub-systems</em></strong>.</p>
<p>In Laravel: Facades provide a &#8220;static&#8221; interface to classes that are available in the application&#8217;s service container. Laravel ships with many facades which provide access to almost all of Laravel&#8217;s features. Laravel facades serve as &#8220;static proxies&#8221; to underlying classes in the service container, providing the benefit of a terse, expressive syntax while maintaining more testability and flexibility than traditional static methods.</p>
<p>Examples for Facades in Laravel are calls to App::, Auth::, DB::, Cookie:: …</p>
<p>Facades can be useful because they are not required in class constructors, but they can also make an application complicated to maintain in case they get to large.</p>
<p>&nbsp;</p>
<p><strong>What is a Contract in Laravel?</strong></p>
<p>Laravel&#8217;s Contracts are a set of interfaces that define the core services provided by the framework. The Illuminate\Contracts\Queue\Queue contract i.e. defines the methods needed for queueing jobs, while the Illuminate\Contracts\Mail\Mailer contract defines the methods needed for sending e-mail.</p>
<p>Contracts are often imported with the use keyword and used (e.g. in the constructor or some method). It is easy to write alternative Contract implementations and therefore they can be replaced easily.</p>
<p>&nbsp;</p>
<p><strong>What is PHP artisan?</strong></p>
<p>PHP artisan is command line tool that makes your life easier. In fact, very much easier while working with Laravel. If you know about any MVC framework, you would know what I&#8217;m about to say, it can create models, controllers, seeders, migrations and many other things with minimum (or maximum) boilerplate code. It can also start a server and can do many other things.</p>
<p><strong> </strong></p>
<p><strong>How is routing working in Laravel?</strong></p>
<p>Usually defined in routes/web.php (for API routs for instance routes/api.php is used). Basically defined with the Route Facade which offers the common HTTP methods and a callback function. Routes have certain rules for parameters (also wildcard), can be grouped, …</p>
<p>&nbsp;</p>
<p><strong>What are Controllers in Laravel?</strong></p>
<p>Handling all requests within route files can be clumsy. Controllers can do the most important calls to the model/business layer and return everything properly.</p>
<p>&nbsp;</p>
<p><strong>What is the Request/Response object doing?</strong></p>
<p>The service container can automatically inject Request/Response objects (e.g. into a certain Controller). It contains info like e.g. input parameters, cookies, and does some sanitation on it.</p>
<p>Routes and Controllers usually should return response objects or views. You can add headers and cookies, create downloads, define the output, …</p>
<p>&nbsp;</p>
<p><strong>How are views in Laravel working?</strong></p>
<p>In most projects Blade is used as a template engine. The views are built with html and contain output injected by Blade.</p>
<p>&nbsp;</p>
<p><strong>How is validation in Laravel working?</strong></p>
<p>Laravel has a powerful set of validation rules which can be performed on inputs (e.g. in Controllers).</p>
<p>&nbsp;</p>
<p><strong>How is Laravel to databases?</strong></p>
<p>Laravel usually uses the Eloquent ORM mapper. It simplifies database communication and SQL statements with certain methods. It offers a query builder which simplifies queries.</p>
<p>&nbsp;</p>
<p><strong>How are migrations and seeding working in Laravel?</strong></p>
<p>Migrations are like version control for your database, allowing your team to easily modify and share the application&#8217;s database schema. Migrations are typically paired with Laravel&#8217;s schema builder to easily build your application&#8217;s database schema. If you have ever had to tell a teammate to manually add a column to their local database schema, you&#8217;ve faced the problem that database migrations solve.</p>
<p>The Laravel Schema facade provides database agnostic support for creating and manipulating tables across all of Laravel&#8217;s supported database systems.</p>
<p>Laravel has a Seeder for seeding applications with defined or random data which is really helpful during development.</p>
<p>&nbsp;</p>
<p>Be free to critizise this tutorial. Improvement ideas are always welcome! 😉 </p>
<p><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fblog.blackbam.at%2F2019%2F07%2F08%2Flaravel-in-five-minutes-a-super-short-crash-course-for-the-awesome-php-framework-principles-and-core-functionalities%2F&#038;title=Laravel%20in%20five%20minutes%3A%20A%20super%20short%20crash%20course%20for%20the%20awesome%20PHP%20framework%20%28principles%20and%20core%20functionalities%29" data-a2a-url="https://blog.blackbam.at/2019/07/08/laravel-in-five-minutes-a-super-short-crash-course-for-the-awesome-php-framework-principles-and-core-functionalities/" data-a2a-title="Laravel in five minutes: A super short crash course for the awesome PHP framework (principles and core functionalities)"><img src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded>
					
					<wfw:commentRss>https://blog.blackbam.at/2019/07/08/laravel-in-five-minutes-a-super-short-crash-course-for-the-awesome-php-framework-principles-and-core-functionalities/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>New WordPress Plugin released: Simple User Locking</title>
		<link>https://blog.blackbam.at/2019/07/04/new-wordpress-plugin-released-simple-user-locking/</link>
					<comments>https://blog.blackbam.at/2019/07/04/new-wordpress-plugin-released-simple-user-locking/#respond</comments>
		
		<dc:creator><![CDATA[Blackbam]]></dc:creator>
		<pubDate>Thu, 04 Jul 2019 13:12:46 +0000</pubDate>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[management]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[user]]></category>
		<category><![CDATA[WordPress Plugins]]></category>
		<guid isPermaLink="false">https://blog.blackbam.at/?p=2382</guid>

					<description><![CDATA[A little bit of advertising for my new Plugin "Simple User Locking" which I have just released to the WordPress plugin repository. It has just passed the security audit by the WordPress plugin team and is not publicly available and free for everybody.]]></description>
										<content:encoded><![CDATA[<p>A little bit of advertising for my new Plugin &#8220;Simple User Locking&#8221; which I have just released to the WordPress plugin repository. It has just passed the security audit by the WordPress plugin team and is not publicly available and free for everybody: <a href="https://wordpress.org/plugins/simple-user-locking/">https://wordpress.org/plugins/simple-user-locking/</a></p>
<p>This is its description:</p>
<p>Prevent users from logging into your WordPress installation for a certain timeframe or permanently. Works also great with the multisite user management area. The locked users are easily manageable within the users overview page. The settings are within the user edit pages. No user can lock himself. No user with a lower role can lock a higher user and administrators in a network can not lock super administrators. If a user is locked, he is instantly logged out of any session until the lock expires or is removed.</p>
<p>No useless overhead, no ads. Just a tiny, but very effective plugin to keep your website secure.</p>
<ul>
<li>you do not want to delete a user, but you want to make sure he can not access the site (at least for a certain timeframe)</li>
<li>an employee leaves your company and access should be removed, but you want to keep his user as an author in the system</li>
<li>you want to punish a certain user which did bad things for a certain timeframe</li>
<li>you want only few persons to have access to your WordPress site in order to minimize risk of incidents</li>
<li> &#8230; or maybe some other use case</li>
</ul>
<p>Would be great to hear whatever feedback or improvement ideas 😉 </p>
<p><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fblog.blackbam.at%2F2019%2F07%2F04%2Fnew-wordpress-plugin-released-simple-user-locking%2F&#038;title=New%20WordPress%20Plugin%20released%3A%20Simple%20User%20Locking" data-a2a-url="https://blog.blackbam.at/2019/07/04/new-wordpress-plugin-released-simple-user-locking/" data-a2a-title="New WordPress Plugin released: Simple User Locking"><img src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded>
					
					<wfw:commentRss>https://blog.blackbam.at/2019/07/04/new-wordpress-plugin-released-simple-user-locking/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>qTranslate is dead &#8211; long live qTranslate XT</title>
		<link>https://blog.blackbam.at/2019/03/14/qtranslate-is-dead-long-live-qtranslate-xt/</link>
					<comments>https://blog.blackbam.at/2019/03/14/qtranslate-is-dead-long-live-qtranslate-xt/#respond</comments>
		
		<dc:creator><![CDATA[Blackbam]]></dc:creator>
		<pubDate>Thu, 14 Mar 2019 18:13:53 +0000</pubDate>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[multilanguage]]></category>
		<category><![CDATA[qtranslate]]></category>
		<category><![CDATA[qtranslate xt]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">https://blog.blackbam.at/?p=2340</guid>

					<description><![CDATA[qTranslate is a great multilanguage Plugin for WordPress. It is fast and easy. For many of my projects from 2012-2017 I have chosen it over WPML or multisite multilanguage as it is super fast and easy. Then the author suddenly has disappeared without a Word tens of thousands of WordPress sites have been affected. One [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>qTranslate is a great multilanguage Plugin for WordPress. It is fast and easy. For many of my projects from 2012-2017 I have chosen it over WPML or multisite multilanguage as it is super fast and easy.</p>
<p>Then the author suddenly has disappeared without a Word tens of thousands of WordPress sites have been affected. One year later some great guy appeared which improved qTranslate and developed it further und the name qTranslate X. Again a lot of developers and bloggers were using it. Guess what happend? The author has collected donations and again disappeared without a word. The project was abandoned again and tens of thousands of unhappy users were left behind.</p>
<p>After almost two years of silence I am really happy to announce that new authors have decided to continue the project with the name <strong>qTranslate XT</strong>. The project is not yet in the official plugin repository but it is available on Github: <a href="https://github.com/qtranslate/qtranslate-xt">https://github.com/qtranslate/qtranslate-xt</a></p>
<p>You can replace old installations of qTranslate X and e.g. bugs with more recent versions of PHP are fixed!</p>
<p>All the best to the new team and I hope that the completely open source project will become even more popular in the future. This site is powered by qTranslate XT 😎 </p>
<p><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fblog.blackbam.at%2F2019%2F03%2F14%2Fqtranslate-is-dead-long-live-qtranslate-xt%2F&#038;title=qTranslate%20is%20dead%20%E2%80%93%20long%20live%20qTranslate%20XT" data-a2a-url="https://blog.blackbam.at/2019/03/14/qtranslate-is-dead-long-live-qtranslate-xt/" data-a2a-title="qTranslate is dead – long live qTranslate XT"><img src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded>
					
					<wfw:commentRss>https://blog.blackbam.at/2019/03/14/qtranslate-is-dead-long-live-qtranslate-xt/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>MySQL PHPMyAdmin: How to import and export SQL dumps fast and secure</title>
		<link>https://blog.blackbam.at/2018/01/03/mysql-phpmyadmin-how-to-import-and-export-sql-dumps-fast-and-secure/</link>
					<comments>https://blog.blackbam.at/2018/01/03/mysql-phpmyadmin-how-to-import-and-export-sql-dumps-fast-and-secure/#respond</comments>
		
		<dc:creator><![CDATA[Blackbam]]></dc:creator>
		<pubDate>Wed, 03 Jan 2018 10:05:05 +0000</pubDate>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Tools]]></category>
		<guid isPermaLink="false">https://blog.blackbam.at/?p=2330</guid>

					<description><![CDATA[Answer: Do not use PHPMyAdmin. This is how you do it with the command line: Importing an SQL dump file: mysql -u [user] -p [password] [database name] &#60; [Path to Dump File] Exporting an SQL dump file: mysqldump -u [user] -p [password] [database name] &#62; [Path to Dump File]]]></description>
										<content:encoded><![CDATA[<p>Answer: Do not use PHPMyAdmin. This is how you do it with the command line:</p>
<p>Importing an SQL dump file:</p>
<pre>
mysql -u [user] -p [password] [database name] &lt; [Path to Dump File]
</pre>
<p>Exporting an SQL dump file:</p>
<pre>
mysqldump -u [user] -p [password] [database name] &gt; [Path to Dump File]
</pre>
<p><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fblog.blackbam.at%2F2018%2F01%2F03%2Fmysql-phpmyadmin-how-to-import-and-export-sql-dumps-fast-and-secure%2F&#038;title=MySQL%20PHPMyAdmin%3A%20How%20to%20import%20and%20export%20SQL%20dumps%20fast%20and%20secure" data-a2a-url="https://blog.blackbam.at/2018/01/03/mysql-phpmyadmin-how-to-import-and-export-sql-dumps-fast-and-secure/" data-a2a-title="MySQL PHPMyAdmin: How to import and export SQL dumps fast and secure"><img src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded>
					
					<wfw:commentRss>https://blog.blackbam.at/2018/01/03/mysql-phpmyadmin-how-to-import-and-export-sql-dumps-fast-and-secure/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Ajax (jQuery) and loops: Local variable scoping and callback functions</title>
		<link>https://blog.blackbam.at/2015/12/08/ajax-jquery-and-loops-local-variable-scoping-and-callback-functions/</link>
					<comments>https://blog.blackbam.at/2015/12/08/ajax-jquery-and-loops-local-variable-scoping-and-callback-functions/#respond</comments>
		
		<dc:creator><![CDATA[Blackbam]]></dc:creator>
		<pubDate>Tue, 08 Dec 2015 17:30:15 +0000</pubDate>
				<category><![CDATA[JavaScript / Ajax]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[asynchronous]]></category>
		<category><![CDATA[callback]]></category>
		<category><![CDATA[loop]]></category>
		<category><![CDATA[scoping]]></category>
		<category><![CDATA[variable]]></category>
		<guid isPermaLink="false">https://blog.blackbam.at/?p=2273</guid>

					<description><![CDATA[Thats a very annoying common problem I discovered &#8211; if calling Ajax within a Javascript loop the callback function will be called asynchronously. That means: All local variables in the callback function will have their future value instead the value they had when the loop was running. &#160; Example 1 (probably unwanted results): var types [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Thats a very annoying common problem I discovered &#8211; if calling Ajax within a Javascript loop the callback function will be called asynchronously. That means: All local variables in the callback function will have their future value instead the value they had when the loop was running.</p>
<p>&nbsp;</p>
<p><span style="color: #ff6666;">Example 1 (probably unwanted results):</span></p>
<pre lang="javascript">var types = ["boring","stupid","funny"];

for(key in types) {
    var type=types[key];

    $.ajax({url: "/?connection=get&amp;type="+type, success: function(result){
        $('#'+type).html(result);
    }
    });
}

</pre>
<p>Result: Only #funny is populated (with the results of the last callback, no matter which ends last).</p>
<p>&nbsp;</p>
<p><span style="color: #66ff66;">Example 2 (solution):</span></p>
<pre lang="javascript">
var types = ["boring","stupid","funny"];

for(key in types) {
    var type=types[key];

    (function(type) {
        $.ajax({url: "/?connection=get&amp;type="+type, success: function(result){
            $('#'+type).html(result);
        }
        });
    })(type);
}

</pre>
<p>Result: The elements with ids #boring, #stupid and #funny are populated with the result of the corresponding callback.</p>
<p>&nbsp;</p>
<p>Explanation: You have created a closure which is preserving the value of type according to the current iteration.</p>
<p><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fblog.blackbam.at%2F2015%2F12%2F08%2Fajax-jquery-and-loops-local-variable-scoping-and-callback-functions%2F&#038;title=Ajax%20%28jQuery%29%20and%20loops%3A%20Local%20variable%20scoping%20and%20callback%20functions" data-a2a-url="https://blog.blackbam.at/2015/12/08/ajax-jquery-and-loops-local-variable-scoping-and-callback-functions/" data-a2a-title="Ajax (jQuery) and loops: Local variable scoping and callback functions"><img src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded>
					
					<wfw:commentRss>https://blog.blackbam.at/2015/12/08/ajax-jquery-and-loops-local-variable-scoping-and-callback-functions/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>PHP: Get rid of  &#8220;Notice: Undefined index .. in .. on line XXX&#8221; and undefined variable problems forever with this script</title>
		<link>https://blog.blackbam.at/2015/09/19/php-get-rid-of-notice-undefined-index-in-on-line-xxx-and-undefined-variable-problems-forever-with-this-script/</link>
					<comments>https://blog.blackbam.at/2015/09/19/php-get-rid-of-notice-undefined-index-in-on-line-xxx-and-undefined-variable-problems-forever-with-this-script/#respond</comments>
		
		<dc:creator><![CDATA[Blackbam]]></dc:creator>
		<pubDate>Sat, 19 Sep 2015 03:08:27 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[custom script]]></category>
		<category><![CDATA[helpers]]></category>
		<guid isPermaLink="false">https://blog.blackbam.at/?p=2264</guid>

					<description><![CDATA[Probably every PHP developer in the world has already seen the following notice at least once: Notice: Undefined index: not_set in /home/.sites/../../../&#8230;php on line 1 It happens if accessing the key of an array which does not exist. There is a very similar problem with PHP objects: If you access a property of an object [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Probably every PHP developer in the world has already seen the following notice at least once: </p>
<p><strong>Notice: Undefined index: not_set in /home/.sites/../../../&#8230;php on line 1</strong></p>
<p>It happens if accessing the key of an array which does not exist.</p>
<p>There is a very similar problem with PHP objects: If you access a property of an object in PHP you just get an empty string <strong>ever knowing if the property even existed</strong>. PHP does not even throw notices in this case.</p>
<p>Some examples:</p>
<pre lang="php">

//
$array = array("a","b","c");
echo $array[2]; // returns "c"
echo $array[3]; // returns nothing, notice undefined index

//
$_POST["my_field"]; // returns the value if submitted, or a notice if that value was not submitted

//
$obj = new stdClass();
$obj->a = "12";
$obj->b = "whatever";

echo $obj->a; // outputs string "12"
echo $obj->c; // outputs nothing, not even a notice just empty string

</pre>
<p>In order to enable save and good programming with PHP experienced PHP developers check for type safety and save array key accesses within their applications which usually requires a lot of extra work. PHP provides some operators and methods which check for the existence of keys and properties as well as for their type safety.</p>
<p>Example: Check if the user has submitted the value &#8220;yes&#8221; for the field &#8220;update&#8221; from a form and the array $_POST at key update contains a string value of yes.</p>
<pre lang="php">

if(isset($_POST['update']) &amp;&amp; $_POST['update'] === "yes")) {

}

</pre>
<p>Quite a lot of text to write right? There are a lot of native PHP methods which check for existence like isset(), property_exists(), array_key_exists() and more. Furthermore there are a lot of methods which check for type safety like is_int, is_bool etc. as well as the operators with the additional = like ===, !==.</p>
<p>However some time ago I somehow got annoyed by this behaviour of PHP especially. I developed a method which is especially useful in case a developer knows that a <strong>variable might not be populated</strong> and wants to set <strong>an adequate default value</strong> for this case. Furthermore I guarantees <strong>a type safe result</strong> for key/property access.</p>
<p>Just check out the following function and you may find it helpful, too:</p>
<p>&nbsp;</p>
<pre lang="php">
/**
 * Constats representing the primitive types.
 */
class Primitive {
    const STR = 0;
    const INT = 1;
    const BOOL = 2;
    const FLOAT = 3;
}

/**
 * In case you are unsure if an array key/object property exists and you want to get a (possibly typesafe) defined result.
 * 
 * @param $var array/object: An array or object with the possible key/property
 * @param $key array/string: The key. For a multidimensional associative array, you can pass an array.
 * @param $empty: If the key does not exist, this value is returned.
 * @param $primitive: The type of the given variable (-1 for ignoring this feature).
 * 
 * @return The (sanitized) value at the position key or the given default value if nothing found.
 */
function resempty(&$var,$key,$empty="",$primitive=-1) {
    
    $tcast = function($var,$primitive) {
        switch(true):
            case $primitive === Primitive::STR:
                $var = strval($var);
                break;
            case $primitive === Primitive::INT:
                $var = intval($var);
                break;
            case $primitive === Primitive::BOOL:
                $var = boolval($var);
                break;
            case $primitive === Primitive::FLOAT:
                $var = floatval($var);
                break;
        endswitch;
        return $var;
    };

    
    if(is_object($var)) {
        if(is_array($key)) {
            $tpclass = $var;
            $dimensions = count($key);
            for($i=0;$i<$dimensions;$i++) {
                if(property_exists($tpclass,$key[$i])) {
                    if($i === $dimensions-1) {
                        return $tcast($tpclass->$key[$i],$primitive);
                    } else {
                        $tpclass = $tpclass->$key[$i];
                    }
                } else {
                    return $tcast($empty,$primitive);
                }
            }
            return $tcast($empty,$primitive);
        }

        if(property_exists($var,$key)) {
            return $tcast($var->$key,$primitive);
        }
    } else if(is_array($var)) {
        if(is_array($key)) {
            $tpar = $var;
            $dimensions = count($key);
            for($i=0;$i<$dimensions;$i++) {
                if(array_key_exists($key[$i],$tpar)) {
                    if($i === $dimensions-1) {
                        return $tcast($tpar[$key[$i]],$primitive);
                    } else {
                        $tpar = $tcast($tpar[$key[$i]],$primitive);
                    }
                } else {
                    return $tcast($empty,$primitive);
                }
            }
            return $tcast($empty,$primitive);
        }

        if(array_key_exists($key,$var)) {
            return $tcast($var[$key],$primitive);
        }
    }
    return $tcast($empty,$primitive);
}

// Examples:
resempty($array,"key"); // returns the value at postion "key" if set, otherwise empty string
resempty($obj,"key",-1,Primitive::INT); // returns an integer value, -1 in case the property of the object is not set, otherwise the integer value of the object at this place


</pre>
<p>Be free to tell me if you find this useful or if you have improvement suggestions.</p>
<p><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fblog.blackbam.at%2F2015%2F09%2F19%2Fphp-get-rid-of-notice-undefined-index-in-on-line-xxx-and-undefined-variable-problems-forever-with-this-script%2F&#038;title=PHP%3A%20Get%20rid%20of%20%20%E2%80%9CNotice%3A%20Undefined%20index%20..%20in%20..%20on%20line%20XXX%E2%80%9D%20and%20undefined%20variable%20problems%20forever%20with%20this%20script" data-a2a-url="https://blog.blackbam.at/2015/09/19/php-get-rid-of-notice-undefined-index-in-on-line-xxx-and-undefined-variable-problems-forever-with-this-script/" data-a2a-title="PHP: Get rid of  “Notice: Undefined index .. in .. on line XXX” and undefined variable problems forever with this script"><img src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded>
					
					<wfw:commentRss>https://blog.blackbam.at/2015/09/19/php-get-rid-of-notice-undefined-index-in-on-line-xxx-and-undefined-variable-problems-forever-with-this-script/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>GEO optimization for websites with local businesses</title>
		<link>https://blog.blackbam.at/2015/06/22/geo-optimization-for-websites-with-local-businesses/</link>
					<comments>https://blog.blackbam.at/2015/06/22/geo-optimization-for-websites-with-local-businesses/#respond</comments>
		
		<dc:creator><![CDATA[Blackbam]]></dc:creator>
		<pubDate>Mon, 22 Jun 2015 14:05:13 +0000</pubDate>
				<category><![CDATA[SEO]]></category>
		<category><![CDATA[geo]]></category>
		<category><![CDATA[local]]></category>
		<category><![CDATA[optimization]]></category>
		<guid isPermaLink="false">https://blog.blackbam.at/?p=2248</guid>

					<description><![CDATA[If creating websites for local businesses which have a local store or something similar it is recommendable to use some geo optimization techniques. Using GEO optimization makes your website being found easier by customers which may be actually interested in what you have to offer. According to surveys 25% of commercially motivated searches on the [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>If creating websites for local businesses which have a local store or something similar it is recommendable to use some geo optimization techniques. Using GEO optimization makes your website being found easier by customers which may be actually interested in what you have to offer. According to surveys 25% of commercially motivated searches on the internet are related to local offers. Therefore I am using two techniques for this purpose:</p>
<h3>1. GEO Meta Tags</h3>
<pre lang="html">  

    <!-- GEO TAGS -->
    <meta name="geo.region" content="..." />
    <meta name="geo.placename" content="...." />
    <meta name="geo.position" content="..." />
    <meta name="ICBM" content="..." />

</pre>
<h3>2. Google Local Search Optimization</h3>
<pre lang="html">  

    <!-- Google Local Search -->
    <div itemscope itemtype="http://schema.org/LocalBusiness" style="display:none;">
    <a itemprop="url" href="..."><div itemprop="name"><strong>...</strong></div></a>
    <div itemprop="description">...</div>
    <div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
    <span itemprop="streetAddress">...</span><br>
    <span itemprop="addressLocality">...</span><br>
    <span itemprop="postalCode">...</span><br>
    <span itemprop="addressCountry">...</span><br>
    </div>
    <div itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates">
        <meta itemprop="latitude" content="..." />
        <meta itemprop="longitude" content="..." />
    </div>
    </div>

</pre>
<p>Improvement ideas in the comments are welcome 🙂</p>
<p><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fblog.blackbam.at%2F2015%2F06%2F22%2Fgeo-optimization-for-websites-with-local-businesses%2F&#038;title=GEO%20optimization%20for%20websites%20with%20local%20businesses" data-a2a-url="https://blog.blackbam.at/2015/06/22/geo-optimization-for-websites-with-local-businesses/" data-a2a-title="GEO optimization for websites with local businesses"><img src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded>
					
					<wfw:commentRss>https://blog.blackbam.at/2015/06/22/geo-optimization-for-websites-with-local-businesses/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Responsiveness: Change HTML element order (of e.g. content/sidebars)</title>
		<link>https://blog.blackbam.at/2015/05/26/responsiveness-change-html-element-order-of-e-g-contentsidebars/</link>
					<comments>https://blog.blackbam.at/2015/05/26/responsiveness-change-html-element-order-of-e-g-contentsidebars/#respond</comments>
		
		<dc:creator><![CDATA[Blackbam]]></dc:creator>
		<pubDate>Tue, 26 May 2015 15:30:44 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[responsiveness]]></category>
		<guid isPermaLink="false">https://blog.blackbam.at/?p=2242</guid>

					<description><![CDATA[The following technique is very useful if you have to make existing websites responsive and e.g. want to have two sidebars after the main content without changing the original HTML. You can define the order of the HTML element which have a common parent element by doing the following: .parent { display:-webkit-box; display:-moz-box; display:box; -webkit-box-orient:vertical; [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>The following technique is very useful if you have to make existing websites responsive and e.g. want to have two sidebars after the main content without changing the original HTML. You can define the order of the HTML element which have a common parent element by doing the following:</p>
<pre lang="css">.parent {
  display:-webkit-box;
  display:-moz-box;
  display:box;
  -webkit-box-orient:vertical;
  -moz-box-orient:vertical;
  box-orient:vertical
}

.child1 {
    -webkit-box-ordinal-group:2;
    -moz-box-ordinal-group:2;
    box-ordinal-group:2;
}

.child2 {
  -webkit-box-ordinal-group:3;
  -moz-box-ordinal-group:3;
  box-ordinal-group:3;
}

.child3 {
  -webkit-box-ordinal-group:1;
  -moz-box-ordinal-group:1;
  box-ordinal-group:1;
}</pre>
<p>Old box model &#8211; more info on the new flexbox model: <a href="https://css-tricks.com/snippets/css/a-guide-to-flexbox/">https://css-tricks.com/snippets/css/a-guide-to-flexbox/</a></p>
<p><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fblog.blackbam.at%2F2015%2F05%2F26%2Fresponsiveness-change-html-element-order-of-e-g-contentsidebars%2F&#038;title=Responsiveness%3A%20Change%20HTML%20element%20order%20%28of%20e.g.%20content%2Fsidebars%29" data-a2a-url="https://blog.blackbam.at/2015/05/26/responsiveness-change-html-element-order-of-e-g-contentsidebars/" data-a2a-title="Responsiveness: Change HTML element order (of e.g. content/sidebars)"><img src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded>
					
					<wfw:commentRss>https://blog.blackbam.at/2015/05/26/responsiveness-change-html-element-order-of-e-g-contentsidebars/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Moving WordPress: Too many redirects</title>
		<link>https://blog.blackbam.at/2015/05/07/moving-wordpress-too-many-redirects/</link>
					<comments>https://blog.blackbam.at/2015/05/07/moving-wordpress-too-many-redirects/#respond</comments>
		
		<dc:creator><![CDATA[Blackbam]]></dc:creator>
		<pubDate>Wed, 06 May 2015 22:15:56 +0000</pubDate>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[moving wordpress]]></category>
		<guid isPermaLink="false">https://blog.blackbam.at/?p=2238</guid>

					<description><![CDATA[Sometimes when moving a WordPress installation to another Webhost if cloning the database and the files and even if the domain is the same you may get the error &#8220;Too many redirects&#8221;. This usually happens if the configuration of the new server environment is different from the old one. In many cases the problem is that [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Sometimes when moving a WordPress installation to another Webhost if cloning the database and the files and even if the domain is the same you may get the error &#8220;Too many redirects&#8221;. This usually happens if the configuration of the new server environment is different from the old one.</p>
<p>In many cases the problem is that <strong>the domain is with www. or without www.</strong> in the beginning which may differ from the old system. In this case you probably have to go to the &#8220;hosting settings&#8221; of your cPanel or whatever and set the domain correctly. The error will be gone afterwards.</p>
<p><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fblog.blackbam.at%2F2015%2F05%2F07%2Fmoving-wordpress-too-many-redirects%2F&#038;title=Moving%20WordPress%3A%20Too%20many%20redirects" data-a2a-url="https://blog.blackbam.at/2015/05/07/moving-wordpress-too-many-redirects/" data-a2a-title="Moving WordPress: Too many redirects"><img src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded>
					
					<wfw:commentRss>https://blog.blackbam.at/2015/05/07/moving-wordpress-too-many-redirects/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
