<?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>Archief Knowledge Base - Utilewebsites</title>
	<atom:link href="https://www.utilewebsites.nl/en/knowledgebase/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.utilewebsites.nl/en/knowledgebase/</link>
	<description></description>
	<lastBuildDate>Mon, 05 Jan 2026 15:24:40 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>
	<item>
		<title>Overview Map: Open-Source AI Video &#038; Image Models (January 2026)</title>
		<link>https://www.utilewebsites.nl/en/knowledgebase/overzichtskaart-open-source-ai-video-image-modellen-januari-2026/</link>
		
		<dc:creator><![CDATA[UtileWebsites]]></dc:creator>
		<pubDate>Mon, 05 Jan 2026 15:03:25 +0000</pubDate>
				<guid isPermaLink="false">https://www.utilewebsites.nl/knowledgebase/overzichtskaart-open-source-ai-video-image-modellen-januari-2026/</guid>

					<description><![CDATA[<p>This article describes the most powerful open-source models for video and image generation. You can install these models entirely locally, provided you have a suitable GPU. While 12 GB of VRAM is often considered the baseline for larger models, quantized versions (mostly found on Hugging Face) make it possible to run these models with significantly less memory (starting from as little as 8 GB). 1. Video Generation Models Wan 2.1 / 2.2 Description: The current standard for open-source video. Highly stable in motion and anatomy. Use case: High-end cinematography, realistic human actions. GitHub (Model): Wan-Video/Wan2.1 ComfyUI Node: kijai/ComfyUI-WanVideoWrapper Hunyuan Video&#160;<a href="https://www.utilewebsites.nl/en/knowledgebase/overzichtskaart-open-source-ai-video-image-modellen-januari-2026/" class="read-more">Continue Reading</a></p>
<p>Het bericht <a href="https://www.utilewebsites.nl/en/knowledgebase/overzichtskaart-open-source-ai-video-image-modellen-januari-2026/">Overview Map: Open-Source AI Video &#038; Image Models (January 2026)</a> verscheen eerst op <a href="https://www.utilewebsites.nl/en/">Utilewebsites</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This article describes the most powerful open-source models for video and image generation. You can install these models entirely locally, provided you have a suitable GPU. While 12 GB of VRAM is often considered the baseline for larger models, <strong>quantized</strong> versions (mostly found on <a href="https://huggingface.com/" target="_blank" rel="noreferrer noopener">Hugging Face</a>) make it possible to run these models with significantly less memory (starting from as little as 8 GB).</p>
<h2 class="wp-block-heading">1. Video Generation Models</h2>
<h3 class="wp-block-heading"><strong>Wan 2.1 / 2.2</strong></h3>
<ul class="wp-block-list">
<li><strong>Description:</strong> The current standard for open-source video. Highly stable in motion and anatomy.</li>
<li><strong>Use case:</strong> High-end cinematography, realistic human actions.</li>
<li><strong>GitHub (Model):</strong> <a href="https://github.com/Wan-Video/Wan2.1" target="_blank" rel="noreferrer noopener">Wan-Video/Wan2.1</a></li>
<li><strong>ComfyUI Node:</strong> <a href="https://github.com/kijai/ComfyUI-WanVideoWrapper" target="_blank" rel="noreferrer noopener">kijai/ComfyUI-WanVideoWrapper</a></li>
</ul>
<h3 class="wp-block-heading"><strong>Hunyuan Video (v1.5)</strong></h3>
<ul class="wp-block-list">
<li><strong>Description:</strong> Tencent's flagship model with 13 billion parameters, now in v1.5 with improved prompt adherence and a "distilled" version for speed.</li>
<li><strong>Use case:</strong> Complex textual instructions and long scenes.</li>
<li><strong>GitHub (Model):</strong> <a href="https://github.com/Tencent-Hunyuan/HunyuanVideo" target="_blank" rel="noreferrer noopener">Tencent-Hunyuan/HunyuanVideo</a></li>
<li><strong>ComfyUI Node:</strong> <a href="https://github.com/kijai/ComfyUI-HunyuanVideoWrapper" target="_blank" rel="noreferrer noopener">kijai/ComfyUI-HunyuanVideoWrapper</a></li>
</ul>
<h3 class="wp-block-heading"><strong>LTX Video (LTXV)</strong></h3>
<ul class="wp-block-list">
<li><strong>Description:</strong> A DiT-based model focused on real-time generation and efficiency on consumer GPUs.</li>
<li><strong>Use case:</strong> Fast previews and real-time video-to-video transformations.</li>
<li><strong>GitHub (Model):</strong> <a href="https://github.com/Lightricks/LTX-Video" target="_blank" rel="noreferrer noopener">Lightricks/LTX-Video</a></li>
<li><strong>ComfyUI Node:</strong> <a href="https://github.com/Lightricks/ComfyUI-LTXVideo" target="_blank" rel="noreferrer noopener">Lightricks/ComfyUI-LTXVideo</a></li>
</ul>
<h3 class="wp-block-heading"><strong>Kandinsky 5.0 Video (Lite &amp; Pro)</strong></h3>
<ul class="wp-block-list">
<li><strong>Description:</strong> A suite of models based on the <em>Cross-Attention Diffusion Transformer</em> (CrossDiT). The <strong>Lite (2B)</strong> version is lightning fast and runs on consumer GPUs, while the <strong>Pro (19B)</strong> version generates cinematic 10-second clips with complex camera movements.</li>
<li><strong>Use case:</strong> Versatile video creation (Text-to-Video and Image-to-Video) with strong support for various languages and artistic styles.</li>
<li><strong>GitHub (Model):</strong> <a href="https://github.com/kandinskylab/kandinsky-5" target="_blank" rel="noreferrer noopener">kandinskylab/kandinsky-5</a></li>
<li><strong>ComfyUI Template:</strong> <a href="https://docs.comfy.org/tutorials/video/kandinsky/kandinsky-5" target="_blank" rel="noreferrer noopener">Kandinsky 5 Video Workflow (Official)</a></li>
</ul>
<h3 class="wp-block-heading"><strong>Specialized Video Fine-tunes</strong></h3>
<ul class="wp-block-list">
<li><strong>SCAIL:</strong> Studio-grade character animation (pose-to-video) with 3D consistency.
<ul class="wp-block-list">
<li><strong>GitHub:</strong> <a href="https://github.com/zai-org/SCAIL" target="_blank" rel="noreferrer noopener">zai-org/SCAIL</a> | <strong>ComfyUI:</strong> <a href="https://github.com/kijai/ComfyUI-WanVideoWrapper" target="_blank" rel="noreferrer noopener">ComfyUI-SCAIL-Pose</a> (part of WanVideoWrapper).</li>
</ul>
</li>
<li><strong>MoCha:</strong> The standard for seamlessly replacing characters in existing videos.
<ul class="wp-block-list">
<li><strong>GitHub:</strong> <a href="https://github.com/Orange-3DV-Team/MoCha" target="_blank" rel="noreferrer noopener">Orange-3DV-Team/MoCha</a> | <strong>ComfyUI:</strong> Integrated into <a href="https://github.com/kijai/ComfyUI-WanVideoWrapper" target="_blank" rel="noreferrer noopener">WanVideoWrapper</a>.</li>
</ul>
</li>
<li><strong>Nexus 1.3B</strong> : <strong>Description:</strong> A specialized fine-tune of the Wan 1.3B architecture, developed within the Nexus project. This model is specifically trained on "Nexus data" for complex human movements. <strong>Use case:</strong> Dance, martial arts, and gym exercises where anatomical correctness is crucial. <strong>GitHub (Model):</strong> <a href="https://github.com/PKU-YuanGroup/OpenS2V-Nexus" target="_blank" rel="noreferrer noopener">PKU-YuanGroup/OpenS2V-Nexus</a> <strong>ComfyUI Node:</strong> Supported via the <a href="https://github.com/kijai/ComfyUI-WanVideoWrapper" target="_blank" rel="noreferrer noopener">WanVideoWrapper</a>. </li>
</ul>
<hr class="wp-block-separator has-alpha-channel-opacity"/>
<h2 class="wp-block-heading">2. Image Generation Models</h2>
<h3 class="wp-block-heading"><strong>FLUX.2</strong></h3>
<ul class="wp-block-list">
<li><strong>Description:</strong> The successor to FLUX.1. Offers photorealism and text rendering that rivals commercial models like Midjourney.</li>
<li><strong>Use case:</strong> Everything from marketing materials to complex digital art.</li>
<li><strong>GitHub (Model):</strong> <a href="https://github.com/black-forest-labs/flux2" target="_blank" rel="noreferrer noopener">black-forest-labs/flux2</a></li>
<li><strong>ComfyUI Node:</strong> <a href="https://github.com/city96/ComfyUI-GGUF" target="_blank" rel="noreferrer noopener">city96/ComfyUI-GGUF</a> (for GGUF quantizations).</li>
</ul>
<h3 class="wp-block-heading"><strong>Qwen Image 2512</strong></h3>
<ul class="wp-block-list">
<li><strong>Description:</strong> An advanced model from Alibaba that excels in following instructions for image editing.</li>
<li><strong>Use case:</strong> Layer-based editing and complex compositions.</li>
<li><strong>GitHub (Model):</strong> <a href="https://github.com/QwenLM/Qwen-Image" target="_blank" rel="noreferrer noopener">QwenLM/Qwen-Image</a></li>
<li><strong>ComfyUI Node:</strong> Use the <a href="https://github.com/ltdrdata/ComfyUI-Manager" target="_blank" rel="noreferrer noopener">ComfyUI-Manager</a> and search for "Qwen2-VL".</li>
</ul>
<h3 class="wp-block-heading"><strong>Z-Image (Turbo)</strong></h3>
<ul class="wp-block-list">
<li><strong>Description:</strong> A 6B parameter model from Alibaba that delivers top-tier results in just 8 steps.</li>
<li><strong>Use case:</strong> Real-time generation and systems with limited hardware.</li>
<li><strong>GitHub (Model):</strong> <a href="https://github.com/Tongyi-MAI/Z-Image" target="_blank" rel="noreferrer noopener">Tongyi-MAI/Z-Image</a></li>
<li><strong>ComfyUI Node:</strong> Integrated via <a href="https://github.com/kijai/ComfyUI-WanVideoWrapper" target="_blank" rel="noreferrer noopener">WanVideoWrapper</a> or directly via diffusers.</li>
</ul>
<p>Het bericht <a href="https://www.utilewebsites.nl/en/knowledgebase/overzichtskaart-open-source-ai-video-image-modellen-januari-2026/">Overview Map: Open-Source AI Video &#038; Image Models (January 2026)</a> verscheen eerst op <a href="https://www.utilewebsites.nl/en/">Utilewebsites</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Discover ComfyUI: the modular visual AI engine for creative workflows</title>
		<link>https://www.utilewebsites.nl/en/knowledgebase/ontdek-comfyui-de-modulaire-visuele-ai-engine-voor-creatieve-workflows/</link>
		
		<dc:creator><![CDATA[UtileWebsites]]></dc:creator>
		<pubDate>Sat, 27 Sep 2025 06:58:51 +0000</pubDate>
				<guid isPermaLink="false">https://www.utilewebsites.nl/knowledgebase/ontdek-comfyui-de-modulaire-visuele-ai-engine-voor-creatieve-workflows/</guid>

					<description><![CDATA[<p>AI development is moving incredibly fast. Every week a new model appears with more possibilities: higher quality, new styles, or completely new features. But how can you test all these innovations yourself, without relying on expensive cloud services? The answer could be: ComfyUI. What is ComfyUI? ComfyUI is a powerful and modular visual AI engine that works with stable diffusion workflows. Instead of a closed interface, you get a graph- and node-based canvas. With this, you can build your own AI pipelines by connecting, branching, and adjusting nodes. This gives you maximum freedom to create exactly the workflow you need.&#160;<a href="https://www.utilewebsites.nl/en/knowledgebase/ontdek-comfyui-de-modulaire-visuele-ai-engine-voor-creatieve-workflows/" class="read-more">Continue Reading</a></p>
<p>Het bericht <a href="https://www.utilewebsites.nl/en/knowledgebase/ontdek-comfyui-de-modulaire-visuele-ai-engine-voor-creatieve-workflows/">Discover ComfyUI: the modular visual AI engine for creative workflows</a> verscheen eerst op <a href="https://www.utilewebsites.nl/en/">Utilewebsites</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">AI development is moving incredibly fast. <strong>Every week a new model appears</strong> with more possibilities: higher quality, new styles, or completely new features. But how can you test all these innovations yourself, without relying on expensive cloud services? The answer could be: <strong>ComfyUI</strong>.</p>



<h3 class="wp-block-heading">What is ComfyUI?</h3>



<p class="wp-block-paragraph">ComfyUI is a powerful and modular visual AI engine that works with <strong>stable diffusion workflows</strong>. Instead of a closed interface, you get a <strong>graph- and node-based canvas</strong>. With this, you can build your own AI pipelines by connecting, branching, and adjusting nodes. This gives you maximum freedom to create exactly the workflow you need.</p>



<figure class="wp-block-image size-full"><a href="https://www.utilewebsites.nl/wp-content/uploads/2025/09/comfyUI.jpg"><img fetchpriority="high" decoding="async" width="840" height="494" src="https://www.utilewebsites.nl/wp-content/uploads/2025/09/comfyUI.jpg" alt="" class="wp-image-5454" srcset="https://www.utilewebsites.nl/wp-content/uploads/2025/09/comfyUI.jpg 840w, https://www.utilewebsites.nl/wp-content/uploads/2025/09/comfyUI-300x176.jpg 300w, https://www.utilewebsites.nl/wp-content/uploads/2025/09/comfyUI-768x452.jpg 768w" sizes="(max-width: 840px) 100vw, 840px" /></a></figure>



<h3 class="wp-block-heading">Test the latest models yourself</h3>



<p class="wp-block-paragraph">Because AI models evolve so quickly, you will of course want to try them out right away. If you have a PC with sufficient hardware — for example an <strong>NVIDIA RTX graphics card with at least 8GB of VRAM</strong> — you can install ComfyUI locally. This allows you to run the latest models directly on your own system, without queues or per-prompt costs.</p>



<h3 class="wp-block-heading">Save, share, and reuse workflows</h3>



<p class="wp-block-paragraph">What makes ComfyUI especially powerful is that you can not only create workflows, but also easily <strong>save and share</strong> them. Files such as images, videos, or 3D models contain metadata that allows the full workflow to be automatically rebuilt as soon as you drop them into ComfyUI. This is ideal for collaboration, learning from others, or simply experimenting again quickly.</p>



<h3 class="wp-block-heading">Open-source and cross-platform</h3>



<p class="wp-block-paragraph">ComfyUI is completely <strong>free and open-source</strong>, and available for <strong>Windows, Linux, and macOS</strong>. Whether you are a creative maker who wants to experiment visually, or a developer who wants to dive deeper technically: the tool adapts to your workflow.</p>



<h3 class="wp-block-heading">Why choose ComfyUI?</h3>



<ul class="wp-block-list">
<li><strong>Flexible and modular</strong>: build your own AI workflows.</li>



<li><strong>Future-proof</strong>: easily test the latest models.</li>



<li><strong>Run locally</strong>: no cloud costs or dependencies.</li>



<li><strong>Community-driven</strong>: share, remix, and reuse workflows.</li>
</ul>



<p class="wp-block-paragraph">In short: if you want to truly take control of AI creation, and explore all the new models that appear every week, then <strong>ComfyUI is the engine to get started with</strong>.</p>



<p class="wp-block-paragraph"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f449.png" alt="👉" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <strong>Download ComfyUI from the official website:</strong> <a href="https://www.comfy.org/">https://www.comfy.org/</a></p>


        <div id="utilehelp-chatbot" class="utilehelp-chatbot utilehelp-collapsed">
            <div class="utilehelp-chat-header utilehelp-chat-toggle" style="cursor:pointer;">
                <div class="utilehelp-chat-header-logo">
                    <span>U</span>
                </div>
                <div>
                    <div class="utilehelp-chat-header-title">
                        UtileHelp AI Assistant                        <span class="utilehelp-beta-label">BETA</span>
                    </div>
                    <div class="utilehelp-chat-header-desc">Ask your question about our services, support or knowledge base.</div>
                </div>
                <button class="utilehelp-chat-start-btn" type="button" style="margin-left:auto;">Start chat</button>
            </div>
            <div class="utilehelp-chat-body" style="display:none;">
                <div class="utilehelp-chat-window"></div>
                <form class="utilehelp-chat-form">
                    <input type="text" name="message" class="utilehelp-chat-input" placeholder="Type your question..." required />
                    <button type="submit" class="utilehelp-chat-send" aria-label="Send">
                        <svg viewBox="0 0 24 24" focusable="false" aria-hidden="true">
                            <path d="M12 5l6 6h-4v8h-4v-8H6z"/>
                        </svg>
                    </button>
                </form>
                <div class="utilehelp-chat-disclaimer">
                    <small>This is a <b>beta</b> version. The AI assistant is in training and may not always provide correct or complete information. Always verify important answers yourself or contact our team.</small>                </div>
                <div class="utilehelp-chat-loading" style="display:none;">Loading...</div>
            </div>
        </div>
        <script>
        window.utilehelp_ajax = {
            ajax_url: 'https://www.utilewebsites.nl/wp-admin/admin-ajax.php',
            nonce:    'a821582acc',
            lang:     'en'
        };
        // Toggle chat open/close
        jQuery(function($){
            $('#utilehelp-chatbot .utilehelp-chat-header, #utilehelp-chatbot .utilehelp-chat-start-btn').on('click', function(e){
                var $bot = $('#utilehelp-chatbot');
                var $body = $bot.find('.utilehelp-chat-body');
                $body.slideToggle(220);
                $bot.toggleClass('utilehelp-collapsed utilehelp-open');
                // Focus input bij openen
                if($bot.hasClass('utilehelp-open')) {
                    setTimeout(function() {
                        $body.find('.utilehelp-chat-input').focus();
                    }, 250);
                }
                e.stopPropagation();
            });
        });
        </script>
        
<p>Het bericht <a href="https://www.utilewebsites.nl/en/knowledgebase/ontdek-comfyui-de-modulaire-visuele-ai-engine-voor-creatieve-workflows/">Discover ComfyUI: the modular visual AI engine for creative workflows</a> verscheen eerst op <a href="https://www.utilewebsites.nl/en/">Utilewebsites</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Secure Headless Architecture with Ionic Vue and a PHP JWT API</title>
		<link>https://www.utilewebsites.nl/en/knowledgebase/een-veilige-ionic-vue-app-bouwen-met-een-php-jwt-api/</link>
		
		<dc:creator><![CDATA[UtileWebsites]]></dc:creator>
		<pubDate>Sun, 13 Jul 2025 09:29:17 +0000</pubDate>
				<guid isPermaLink="false">https://www.utilewebsites.nl/knowledgebase/een-veilige-ionic-vue-app-bouwen-met-een-php-jwt-api/</guid>

					<description><![CDATA[<p>A guide to securing headless systems with JSON Web Tokens. Introduction: Why JWT for Headless Security? Headless means your backend exclusively provides data without a presentation layer—for example, a PHP API that only returns JSON to a mobile app or JavaScript frontend. In such a stateless environment, traditional session authentication doesn't work smoothly: the server must process each request independently without tracking user sessions. JSON Web Tokens (JWT) offer a compact, self-contained, and secure way to transmit authorization information. After logging in, the client receives a token that is sent with every API call, allowing your backend to easily verify&#160;<a href="https://www.utilewebsites.nl/en/knowledgebase/een-veilige-ionic-vue-app-bouwen-met-een-php-jwt-api/" class="read-more">Continue Reading</a></p>
<p>Het bericht <a href="https://www.utilewebsites.nl/en/knowledgebase/een-veilige-ionic-vue-app-bouwen-met-een-php-jwt-api/">Secure Headless Architecture with Ionic Vue and a PHP JWT API</a> verscheen eerst op <a href="https://www.utilewebsites.nl/en/">Utilewebsites</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>A guide to securing headless systems with JSON Web Tokens.</p>
<h3 class="wp-block-heading"><strong>Introduction: Why JWT for Headless Security?</strong></h3>
<figure class="wp-block-image size-large is-resized"><a href="https://www.utilewebsites.nl/wp-content/uploads/2025/07/jwt_headless_app_ionic_vue3-1024x877.jpg"><img decoding="async" width="1024" height="877" src="https://www.utilewebsites.nl/wp-content/uploads/2025/07/jwt_headless_app_ionic_vue3-1024x877.jpg" alt="JWT headless app architecture diagram" class="wp-image-5401" style="width:360px;height:auto" srcset="https://www.utilewebsites.nl/wp-content/uploads/2025/07/jwt_headless_app_ionic_vue3-1024x877.jpg 1024w, https://www.utilewebsites.nl/wp-content/uploads/2025/07/jwt_headless_app_ionic_vue3-300x257.jpg 300w, https://www.utilewebsites.nl/wp-content/uploads/2025/07/jwt_headless_app_ionic_vue3-768x658.jpg 768w, https://www.utilewebsites.nl/wp-content/uploads/2025/07/jwt_headless_app_ionic_vue3-1536x1316.jpg 1536w, https://www.utilewebsites.nl/wp-content/uploads/2025/07/jwt_headless_app_ionic_vue3.jpg 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure>
<p><strong>Headless</strong> means your backend exclusively provides data without a presentation layer—for example, a PHP API that only returns JSON to a mobile app or JavaScript frontend. In such a stateless environment, traditional session authentication doesn't work smoothly: the server must process each request independently without tracking user sessions.</p>
<p>JSON Web Tokens (JWT) offer a compact, self-contained, and secure way to transmit authorization information. After logging in, the client receives a token that is sent with every API call, allowing your backend to easily verify if the user is authorized.</p>
<h3 class="wp-block-heading"><strong>The Anatomy of a JWT</strong></h3>
<ul class="wp-block-list">
<li><strong>Header:</strong> Contains metadata such as the algorithm (<code>alg</code>) and the token type (<code>typ</code>).</li>
<li><strong>Payload:</strong> Contains the "claims"—data about the user (<code>sub</code>), the issuer (<code>iss</code>), and the expiration (<code>exp</code>). You can also add roles or permissions here.</li>
<li><strong>Signature:</strong> A cryptographic signature over the header and payload, using your secret key, to prevent tampering.</li>
</ul>
<hr class="wp-block-separator has-alpha-channel-opacity"/>
<h3 class="wp-block-heading"><strong>Part 1: The PHP Backend – Building a JWT API</strong></h3>
<p>In this part, we'll build the PHP backend that issues and validates tokens. We will use <code>firebase/php-jwt</code> to create and verify JWTs, ensuring strict claim and algorithm validation.</p>
<ul class="wp-block-list">
<li><strong>Structure:</strong>
<ul class="wp-block-list">
<li><code>api/login.php</code>: Validates login credentials and returns a JWT (access + refresh).</li>
<li><code>api/refresh.php</code>: Refreshes the access token using a valid refresh token.</li>
<li><code>api/secure-data.php</code>: Secure endpoint; only accessible with a valid access token.</li>
<li><code>.env</code>: Contains your secret keys (<code>JWT_SECRET</code> and <code>JWT_REFRESH_SECRET</code>).</li>
</ul>
</li>
<li><strong>Installation:</strong><br />   
<pre class="wp-block-code"><code>composer require firebase/php-jwt</code></pre>
<p>  </li>
</ul>
<h4 class="wp-block-heading"><strong>1. Generating a Token (login.php)</strong></h4>
<pre class="wp-block-code"><code>&lt;?php
require __DIR__ . '/vendor/autoload.php';
use Firebase\JWT\JWT;

// Load secret from .env
$secret       = getenv('JWT_SECRET');
$refreshSecret= getenv('JWT_REFRESH_SECRET');

// Validate user...
if (validUser($_POST['email'], $_POST['password'])) {
    $now = time();
    $accessPayload = [
        'iss' => 'https://your-domain.com',
        'aud' => 'https://your-domain.com',
        'iat' => $now,
        'exp' => $now + 900,      // 15 minutes
        'sub' => getUserId(),
        'role'=> 'user'
    ];
    $refreshPayload = [
        'iss' => 'https://your-domain.com',
        'aud' => 'https://your-domain.com',
        'iat' => $now,
        'exp' => $now + 604800,   // 1 week
        'sub' => getUserId()
    ];
    $accessToken  = JWT::encode($accessPayload, $secret, 'HS256');
    $refreshToken = JWT::encode($refreshPayload, $refreshSecret, 'HS256');
    echo json_encode(['accessToken'=>$accessToken, 'refreshToken'=>$refreshToken]);
    exit;
}
http_response_code(401);
echo json_encode(['error'=>'Invalid credentials']);
</code></pre>
<h4 class="wp-block-heading"><strong>2. Validating a Token (secure-data.php)</strong></h4>
<pre class="wp-block-code"><code>&lt;?php
require __DIR__ . '/vendor/autoload.php';
use Firebase\JWT\JWT;
use Firebase\JWT\Key;

$secret = getenv('JWT_SECRET');
$auth   = $_SERVER['HTTP_AUTHORIZATION'] ?? '';
if (preg_match('/Bearer\s(\S+)/', $auth, $m)) {
    try {
        $token = $m[1];
        $decoded = JWT::decode($token, new Key($secret, 'HS256'));
        // Check iss and aud
        if ($decoded->iss !== 'https://your-domain.com' || $decoded->aud !== 'https://your-domain.com') {
            throw new Exception('Invalid token issuer or audience');
        }
        echo json_encode(['data'=>'Secure information']);
        exit;
    } catch (Exception $e) {
        http_response_code(401);
        echo json_encode(['error'=>'Access denied']);
        exit;
    }
}
http_response_code(401);
echo json_encode(['error'=>'No token found']);
</code></pre>
<h4 class="wp-block-heading"><strong>3. Refresh Endpoint (refresh.php)</strong></h4>
<pre class="wp-block-code"><code>&lt;?php
require __DIR__ . '/vendor/autoload.php';
use Firebase\JWT\JWT;
use Firebase\JWT\Key;

$refreshSecret = getenv('JWT_REFRESH_SECRET');
$body = json_decode(file_get_contents('php://input'), true);
try {
    $decoded = JWT::decode($body['refreshToken'], new Key($refreshSecret, 'HS256'));
    $now = time();
    $newAccess = [
        'iss'=>'https://your-domain.com','aud'=>'https://your-domain.com',
        'iat'=>$now,'exp'=>$now+900,'sub'=>$decoded->sub
    ];
    $token = JWT::encode($newAccess, getenv('JWT_SECRET'), 'HS256');
    echo json_encode(['accessToken'=>$token]);
} catch (Exception $e) {
    http_response_code(401);
    echo json_encode(['error'=>'Invalid refresh token']);
}
</code></pre>
<hr class="wp-block-separator has-alpha-channel-opacity"/>
<h3 class="wp-block-heading"><strong>Part 2: The Ionic Vue App – API Communication with Axios</strong></h3>
<p>In this part, we'll build the frontend in Ionic Vue. We will install Axios, create a service for all our API calls including refresh token rotation, and implement secure storage.</p>
<h4 class="wp-block-heading"><strong>1. Secure Storage &amp; Axios Setup</strong></h4>
<p>First, install the secure storage plugin for Capacitor:</p>
<pre class="wp-block-code"><code>npm install @capacitor-community/secure-storage</code></pre>
<pre class="wp-block-code"><code>// src/services/AxiosService.js
import axios from 'axios';
import { SecureStoragePlugin } from '@capacitor-community/secure-storage';

const API_URL = import.meta.env.VITE_API_URL || 'https://your-domain.com/api';
const storage = new SecureStoragePlugin();

const axiosInstance = axios.create({ baseURL: API_URL, headers:{'Content-Type':'application/json'} });

axiosInstance.interceptors.request.use(async config => {
  const token = await storage.get({ key:'accessToken' });
  if (token.value) config.headers.Authorization = `Bearer ${token.value}`;
  return config;
});

export default axiosInstance;
</code></pre>
<h4 class="wp-block-heading"><strong>2. Login &amp; Token Storage (<code>LoginPage.vue</code>)</strong></h4>
<pre class="wp-block-code"><code>&lt;script setup&gt;
import { SecureStoragePlugin } from '@capacitor-community/secure-storage';
import axiosService from '@/services/AxiosService';
const storage = new SecureStoragePlugin();

async function handleLogin() {
  const resp = await axiosService.post('/login.php', params);
  await storage.set({ key:'accessToken', value:resp.data.accessToken });
  await storage.set({ key:'refreshToken', value:resp.data.refreshToken });
  router.push('/tabs/dashboard');
}
&lt;/script&gt;
</code></pre>
<h4 class="wp-block-heading"><strong>3. Refresh Logic</strong></h4>
<p>In your interceptor, you can automatically make a refresh call on a 401 error:</p>
<pre class="wp-block-code"><code>axiosInstance.interceptors.response.use(null, async error => {
  if (error.response?.status === 401) {
    const refresh = await storage.get({key:'refreshToken'});
    const { data } = await axios.post('/refresh.php', { refreshToken: refresh.value });
    await storage.set({key:'accessToken', value:data.accessToken});
    error.config.headers.Authorization = `Bearer ${data.accessToken}`;
    return axiosInstance.request(error.config);
  }
  return Promise.reject(error);
});</code></pre>
<hr class="wp-block-separator has-alpha-channel-opacity"/>
<h3 class="wp-block-heading"><strong>Best Practices &amp; Security</strong></h3>
<ul class="wp-block-list">
<li>Always use HTTPS for transport security.</li>
<li>Store tokens in secure storage (e.g., Capacitor Secure Storage), not in localStorage.</li>
<li>Implement access and refresh token rotation for short-lived sessions.</li>
<li>Always validate <code>iss</code>, <code>aud</code>, and <code>alg</code> on the server side.</li>
<li>Limit the token payload to the minimum necessary data.</li>
</ul>
<h3 class="wp-block-heading"><strong>Conclusion</strong></h3>
<p>This guide highlights that true security starts with a "security-first" architecture: short-lived tokens, a dual-token strategy, secure client-side storage, and strict server-side validation. With this layered approach, you can build a resilient, production-ready headless application that is resistant to modern threats.</p>
<p>Het bericht <a href="https://www.utilewebsites.nl/en/knowledgebase/een-veilige-ionic-vue-app-bouwen-met-een-php-jwt-api/">Secure Headless Architecture with Ionic Vue and a PHP JWT API</a> verscheen eerst op <a href="https://www.utilewebsites.nl/en/">Utilewebsites</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Run a Large Language Model (LLM) locally with Ollama</title>
		<link>https://www.utilewebsites.nl/en/knowledgebase/draai-een-large-language-model-llm-lokaal-met-ollama/</link>
		
		<dc:creator><![CDATA[UtileWebsites]]></dc:creator>
		<pubDate>Sun, 13 Jul 2025 08:57:25 +0000</pubDate>
				<guid isPermaLink="false">https://www.utilewebsites.nl/knowledgebase/draai-een-large-language-model-llm-lokaal-met-ollama/</guid>

					<description><![CDATA[<p>Introduction Want to experiment with Large Language Models (LLMs) without relying on cloud services? With Ollama you can run powerful open-source language models directly on your own computer. This not only guarantees your privacy, but also gives you full control over your data and the models you use. In this article we explain step by step how to install Ollama, use an LLM locally, and how to integrate it with popular developer tools such as LangChain and Visual Studio Code. What is Ollama? Ollama is a tool that greatly simplifies the process of downloading, setting up, and running LLMs, such&#160;<a href="https://www.utilewebsites.nl/en/knowledgebase/draai-een-large-language-model-llm-lokaal-met-ollama/" class="read-more">Continue Reading</a></p>
<p>Het bericht <a href="https://www.utilewebsites.nl/en/knowledgebase/draai-een-large-language-model-llm-lokaal-met-ollama/">Run a Large Language Model (LLM) locally with Ollama</a> verscheen eerst op <a href="https://www.utilewebsites.nl/en/">Utilewebsites</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3 class="wp-block-heading">Introduction</h3>
<p>Want to experiment with Large Language Models (LLMs) without relying on cloud services? With <strong>Ollama</strong> you can run powerful open-source language models directly on your own computer. This not only guarantees your privacy, but also gives you full control over your data and the models you use. In this article we explain step by step how to install Ollama, use an LLM locally, and how to integrate it with popular developer tools such as LangChain and Visual Studio Code.</p>
<p data-wp-editing="1"><a href="https://www.utilewebsites.nl/wp-content/uploads/2025/07/ollama-lokale-AI-e1752397806395.jpg"><img decoding="async" class="alignnone size-full wp-image-5379" src="https://www.utilewebsites.nl/wp-content/uploads/2025/07/ollama-lokale-AI-e1752397806395.jpg" alt="" width="1024" height="736" srcset="https://www.utilewebsites.nl/wp-content/uploads/2025/07/ollama-lokale-AI-e1752397806395.jpg 1024w, https://www.utilewebsites.nl/wp-content/uploads/2025/07/ollama-lokale-AI-e1752397806395-300x216.jpg 300w, https://www.utilewebsites.nl/wp-content/uploads/2025/07/ollama-lokale-AI-e1752397806395-768x552.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></p>
<hr class="wp-block-separator has-alpha-channel-opacity" />
<h3 class="wp-block-heading">What is Ollama?</h3>
<p>Ollama is a tool that greatly simplifies the process of downloading, setting up, and running LLMs, such as Llama 3. It packages model weights and configurations into a single file, similar to how Docker works for applications. This makes it easy for both developers and enthusiasts to get started with LLMs.</p>
<hr class="wp-block-separator has-alpha-channel-opacity" />
<h3 class="wp-block-heading">System Requirements</h3>
<p>Before you begin, it's important to check that your system meets the minimum requirements. To run smaller models (around 7 billion parameters), the following is recommended:</p>
<ul>
<li><strong>RAM:</strong> At least <strong>8 GB</strong>, but <strong>16 GB</strong> is recommended for better performance.</li>
<li><strong>Storage:</strong> Sufficient free disk space for the models, which can be several gigabytes in size.</li>
</ul>
<p>For larger models, you'll need significantly more RAM and possibly a powerful graphics card (GPU).</p>
<hr class="wp-block-separator has-alpha-channel-opacity" />
<h3 class="wp-block-heading">Installation</h3>
<p>Ollama is available for Windows, macOS and Linux.</p>
<ol>
<li><strong>Download Ollama:</strong> Go to the official Ollama website at <a href="https://ollama.com/" target="_blank" rel="noreferrer noopener">https://ollama.com/</a> and download the installer for your operating system.</li>
<li><strong>Install Ollama:</strong> Run the downloaded file and follow the installation instructions. After installation, Ollama runs in the background.</li>
</ol>
<hr class="wp-block-separator has-alpha-channel-opacity" />
<h3 class="wp-block-heading">Downloading and Running a Model</h3>
<ol>
<li><strong>Open the terminal:</strong>
<ul>
<li><strong>Windows:</strong> Open the Start menu, type <code>cmd</code> or <code>Terminal</code>, and press Enter.</li>
<li><strong>macOS:</strong> Open the <code>Terminal</code> app from the Utilities folder.</li>
<li><strong>Linux:</strong> Open your preferred terminal emulator.</li>
</ul>
</li>
<li><strong>Download a model:</strong> Choose a model from the Ollama library (found at <a href="https://ollama.com/library" target="_blank" rel="noreferrer noopener">https://ollama.com/library</a>). A popular and powerful model to start with is <strong>Llama 3.1</strong>. Download it with the following command:</li>
</ol>
<pre class="wp-block-code"><code>ollama pull llama3.1</code></pre>
<p>This may take a while, depending on the size of the model and your internet speed.</p>
<ol start="3">
<li><strong>Run the model:</strong> Once the download is complete, you can use the model directly in your terminal with the following command:</li>
</ol>
<pre class="wp-block-code"><code>ollama run llama3.1</code></pre>
<hr class="wp-block-separator has-alpha-channel-opacity" />
<h3 class="wp-block-heading">Interaction and Useful Commands</h3>
<p>After running the <code>run</code> command, you can immediately start asking questions or giving commands to the model. You essentially chat with the LLM in your terminal.</p>
<ul>
<li><code>ollama list</code>: Shows a list of all models you have downloaded locally.</li>
<li><code>ollama rm &lt;model-name&gt;</code>: Removes a specific model to free up disk space.</li>
<li><code>/bye</code>: Closes the current chat session with a model.</li>
</ul>
<hr class="wp-block-separator has-alpha-channel-opacity" />
<h3 class="wp-block-heading">Integration with LangChain</h3>
<p><strong>LangChain</strong> is a popular framework for building applications with LLMs. You can easily integrate your locally running Ollama model into both Python and JavaScript/TypeScript projects.</p>
<h4 class="wp-block-heading">Python</h4>
<ol>
<li><strong>Install the Python package:</strong></li>
</ol>
<pre class="wp-block-code"><code>pip install langchain-ollama</code></pre>
<ol start="2">
<li><strong>Use in your code:</strong></li>
</ol>
<pre class="wp-block-code"><code class="language-python" lang="python">from langchain_ollama import ChatOllama

llm = ChatOllama(model="llama3.1")
response = llm.invoke("What is the capital of the Netherlands?")
print(response.content)</code></pre>
<h4 class="wp-block-heading">Node.js (JavaScript/TypeScript)</h4>
<p>LangChain is also available for JavaScript/TypeScript, ideal for back-ends (Node.js) or front-end frameworks (such as Vue.js, React or Svelte).</p>
<ol>
<li><strong>Install via npm or yarn:</strong></li>
</ol>
<pre class="wp-block-code"><code># For npm
npm install @langchain/ollama

# For yarn
yarn add @langchain/ollama</code></pre>
<ol start="2">
<li><strong>Use in your code:</strong></li>
</ol>
<pre class="wp-block-code"><code class="language-javascript" lang="javascript">import { ChatOllama } from "@langchain/ollama";

async function main() {
  const llm = new ChatOllama({ model: "llama3.1" });
  const response = await llm.invoke("What is the capital of the Netherlands?");
  console.log(response.content);
}

main();</code></pre>
<p>This way, you can seamlessly switch between cloud providers and your own local Ollama instance in both your Python backend and your JavaScript stack.</p>
<hr class="wp-block-separator has-alpha-channel-opacity" />
<h3 class="wp-block-heading">Integration with Visual Studio Code</h3>
<p>You can also use your locally running LLM as a complement to your development environment in <strong>Visual Studio Code</strong>. This gives you the ability to generate code and ask questions using your own, locally hosted model.</p>
<ol>
<li><strong>Ensure Ollama is running:</strong> The Ollama process must be active in the background.</li>
<li><strong>Install a compatible extension:</strong> Search the VS Code Marketplace for an extension that offers Ollama integration, such as <strong>Continue</strong>.</li>
<li><strong>Configure the extension:</strong> Follow the extension's instructions to set Ollama as the provider and select the model you want to use (for example <code>llama3.1</code>).</li>
</ol>
<p>Now you can call your local model for code suggestions and other programming tasks in the extension's chat interface, entirely within your own environment.</p>
<hr class="wp-block-separator has-alpha-channel-opacity" />
<h3 class="wp-block-heading">Conclusion</h3>
<p>Ollama makes running LLMs locally accessible to a wide audience. Whether you're a developer looking to build an AI application with LangChain, or want to improve your programming workflow in VS Code, Ollama lets you get started quickly and easily. With an active community and ongoing development, Ollama is an excellent choice for anyone looking to explore the world of <strong>local AI</strong>.</p>
<p>Het bericht <a href="https://www.utilewebsites.nl/en/knowledgebase/draai-een-large-language-model-llm-lokaal-met-ollama/">Run a Large Language Model (LLM) locally with Ollama</a> verscheen eerst op <a href="https://www.utilewebsites.nl/en/">Utilewebsites</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to Install a Local LLM on Ubuntu 24.10 with LM Studio?</title>
		<link>https://www.utilewebsites.nl/en/knowledgebase/hoe-installeer-je-een-lokale-llm-op-ubuntu-24-10-met-lm-studio/</link>
		
		<dc:creator><![CDATA[UtileWebsites]]></dc:creator>
		<pubDate>Tue, 28 Jan 2025 18:46:17 +0000</pubDate>
				<guid isPermaLink="false">https://www.utilewebsites.nl/knowledgebase/hoe-installeer-je-een-lokale-llm-op-ubuntu-24-10-met-lm-studio/</guid>

					<description><![CDATA[<p>With LM Studio, you can run local AI models (LLMs) on your own computer, without relying on cloud services like OpenAI. In this guide, you'll learn how to install LM Studio, download an LLM, test it, and how to start the API server to use the model in your own applications. 1. Download and Install LM Studio LM Studio is distributed as an AppImage, a standalone executable file. Follow these steps to install it: 2. Add LM Studio to the Applications Menu Create a .desktop file so that LM Studio appears in your application menu: Paste this content and adjust&#160;<a href="https://www.utilewebsites.nl/en/knowledgebase/hoe-installeer-je-een-lokale-llm-op-ubuntu-24-10-met-lm-studio/" class="read-more">Continue Reading</a></p>
<p>Het bericht <a href="https://www.utilewebsites.nl/en/knowledgebase/hoe-installeer-je-een-lokale-llm-op-ubuntu-24-10-met-lm-studio/">How to Install a Local LLM on Ubuntu 24.10 with LM Studio?</a> verscheen eerst op <a href="https://www.utilewebsites.nl/en/">Utilewebsites</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p class="wp-block-paragraph">With <strong>LM Studio</strong>, you can run <strong>local AI models (LLMs)</strong> on your own computer, without relying on cloud services like OpenAI. In this guide, you'll learn how to <strong>install LM Studio</strong>, <strong>download</strong> an LLM, <strong>test</strong> it, and how to start the <strong>API server</strong> to use the model in your own applications.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading"><strong>1. Download and Install LM Studio</strong></h2>



<p class="wp-block-paragraph">LM Studio is distributed as an <strong>AppImage</strong>, a standalone executable file. Follow these steps to install it:</p>



<ol class="wp-block-list">
<li><strong>Download LM Studio</strong>
<ul class="wp-block-list">
<li>Go to <a href="https://lmstudio.ai/">lmstudio.ai</a> and download the <strong>Linux AppImage</strong>.</li>



<li>Save the file in a directory such as <code>~/Applications/</code>.</li>
</ul>
</li>



<li><strong>Make the file executable</strong><br>Open a terminal and run the following command: <code>chmod +x ~/Applications/LM-Studio-*.AppImage</code></li>



<li><strong>Start LM Studio</strong> <code>~/Applications/LM-Studio-*.AppImage</code> You can now use LM Studio, but let's also ensure it appears in your <strong>application menu</strong>.</li>
</ol>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading"><strong>2. Add LM Studio to the Applications Menu</strong></h2>



<p class="wp-block-paragraph">Create a <code>.desktop</code> file so that LM Studio appears in your application menu:</p>



<pre class="wp-block-code"><code>nano ~/.local/share/applications/LM-Studio.desktop
</code></pre>



<p class="wp-block-paragraph">Paste this content and <strong>adjust the path</strong>:</p>



<pre class="wp-block-code"><code>&#091;Desktop Entry]
Type=Application
Name=LM Studio
Exec=/home/user/Applications/LM-Studio-0.3.8-4-x64.AppImage --no-sandbox
Icon=/home/user/Applications/lmstudio-icon.png
Terminal=false
Categories=Development;AI;
</code></pre>



<p class="wp-block-paragraph">Save with <code>CTRL+O</code>, close with <code>CTRL+X</code>, and update the menu:</p>



<pre class="wp-block-code"><code>update-desktop-database ~/.local/share/applications
</code></pre>



<p class="wp-block-paragraph">You can now open LM Studio from the application menu! <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f389.png" alt="🎉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<figure class="wp-block-image size-large"><a href="https://www.utilewebsites.nl/wp-content/uploads/2025/01/llmstudio-interface-1024x643.png"><img loading="lazy" decoding="async" width="1024" height="643" src="https://www.utilewebsites.nl/wp-content/uploads/2025/01/llmstudio-interface-1024x643.png" alt="" class="wp-image-5211" srcset="https://www.utilewebsites.nl/wp-content/uploads/2025/01/llmstudio-interface-1024x643.png 1024w, https://www.utilewebsites.nl/wp-content/uploads/2025/01/llmstudio-interface-300x188.png 300w, https://www.utilewebsites.nl/wp-content/uploads/2025/01/llmstudio-interface-768x482.png 768w, https://www.utilewebsites.nl/wp-content/uploads/2025/01/llmstudio-interface-1536x965.png 1536w, https://www.utilewebsites.nl/wp-content/uploads/2025/01/llmstudio-interface.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading"><strong>3. Download a Local LLM Model</strong></h2>



<ol class="wp-block-list">
<li>Open <strong>LM Studio</strong> and go to <strong>Model Search</strong>.</li>



<li>Search for <strong>Llama 3.2 1B Instruct</strong> (lightweight and beginner-friendly).</li>



<li>Select a <strong>Q4_K_M or Q8_0 quantization</strong> (lower bit values use less RAM).</li>



<li>Wait for the download to complete.</li>
</ol>



<figure class="wp-block-image size-large"><a href="https://www.utilewebsites.nl/wp-content/uploads/2025/01/llm-model-downloaden-1024x643.png"><img loading="lazy" decoding="async" width="1024" height="643" src="https://www.utilewebsites.nl/wp-content/uploads/2025/01/llm-model-downloaden-1024x643.png" alt="" class="wp-image-5213" srcset="https://www.utilewebsites.nl/wp-content/uploads/2025/01/llm-model-downloaden-1024x643.png 1024w, https://www.utilewebsites.nl/wp-content/uploads/2025/01/llm-model-downloaden-300x188.png 300w, https://www.utilewebsites.nl/wp-content/uploads/2025/01/llm-model-downloaden-768x482.png 768w, https://www.utilewebsites.nl/wp-content/uploads/2025/01/llm-model-downloaden-1536x965.png 1536w, https://www.utilewebsites.nl/wp-content/uploads/2025/01/llm-model-downloaden.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading"><strong>4. Test if the Model Works</strong></h2>



<ul class="wp-block-list">
<li>Go to <strong>Chats</strong> in LM Studio.</li>



<li>Start a <strong>new chat</strong> and select the loaded model.</li>



<li>Type questions like: <code>"What is the capital of France?" "Explain quantum mechanics in simple terms." "What is LLM model Llama-3.3-1B?"</code> </li>



<li>If the model responds, everything is working!</li>
</ul>



<figure class="wp-block-image size-large"><a href="https://www.utilewebsites.nl/wp-content/uploads/2025/01/test-llm-1024x643.png"><img loading="lazy" decoding="async" width="1024" height="643" src="https://www.utilewebsites.nl/wp-content/uploads/2025/01/test-llm-1024x643.png" alt="" class="wp-image-5215" srcset="https://www.utilewebsites.nl/wp-content/uploads/2025/01/test-llm-1024x643.png 1024w, https://www.utilewebsites.nl/wp-content/uploads/2025/01/test-llm-300x188.png 300w, https://www.utilewebsites.nl/wp-content/uploads/2025/01/test-llm-768x482.png 768w, https://www.utilewebsites.nl/wp-content/uploads/2025/01/test-llm-1536x965.png 1536w, https://www.utilewebsites.nl/wp-content/uploads/2025/01/test-llm.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading"><strong>5. Start the LLM API Server for Use in Your Own App</strong></h2>



<p class="wp-block-paragraph">Want to integrate LM Studio into your <strong>Python app</strong> or chatbot? Start the <strong>local server</strong>:</p>



<ol class="wp-block-list">
<li>Open <strong>LM Studio</strong> and enable <strong>"Developer mode"</strong>.</li>



<li>Click <strong>"Start Server"</strong> (the server will run at <code>http://127.0.0.1:1234</code>).</li>



<li>Test if it's working: <code>curl http://127.0.0.1:1234/v1/models</code></li>
</ol>



<figure class="wp-block-image size-large"><a href="https://www.utilewebsites.nl/wp-content/uploads/2025/01/llm-running-servr-1024x643.png"><img loading="lazy" decoding="async" width="1024" height="643" src="https://www.utilewebsites.nl/wp-content/uploads/2025/01/llm-running-servr-1024x643.png" alt="" class="wp-image-5217" srcset="https://www.utilewebsites.nl/wp-content/uploads/2025/01/llm-running-servr-1024x643.png 1024w, https://www.utilewebsites.nl/wp-content/uploads/2025/01/llm-running-servr-300x188.png 300w, https://www.utilewebsites.nl/wp-content/uploads/2025/01/llm-running-servr-768x482.png 768w, https://www.utilewebsites.nl/wp-content/uploads/2025/01/llm-running-servr-1536x965.png 1536w, https://www.utilewebsites.nl/wp-content/uploads/2025/01/llm-running-servr.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<figure class="wp-block-image size-large"><a href="https://www.utilewebsites.nl/wp-content/uploads/2025/01/afbeeldingjson-1024x643.png"><img loading="lazy" decoding="async" width="1024" height="643" src="https://www.utilewebsites.nl/wp-content/uploads/2025/01/afbeeldingjson-1024x643.png" alt="" class="wp-image-5227" srcset="https://www.utilewebsites.nl/wp-content/uploads/2025/01/afbeeldingjson-1024x643.png 1024w, https://www.utilewebsites.nl/wp-content/uploads/2025/01/afbeeldingjson-300x188.png 300w, https://www.utilewebsites.nl/wp-content/uploads/2025/01/afbeeldingjson-768x482.png 768w, https://www.utilewebsites.nl/wp-content/uploads/2025/01/afbeeldingjson-1536x965.png 1536w, https://www.utilewebsites.nl/wp-content/uploads/2025/01/afbeeldingjson.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading"><strong>6. Example: Using LLM in a Python App</strong></h2>



<pre class="wp-block-code"><code>import requests

url = "http://127.0.0.1:1234/v1/chat/completions"
headers = {"Content-Type": "application/json"}
data = {
    "model": "llama-3.2-1b-instruct",
    "messages": &#091;{"role": "user", "content": "What is the capital of France?"}]
}

response = requests.post(url, json=data, headers=headers)
print(response.json())
</code></pre>



<p class="wp-block-paragraph">To send a JSON-formatted POST request in PHP to interact with LM Studio's API, you can utilize PHP's cURL library. Here's how you can structure your code:</p>



<pre class="wp-block-code"><code>&lt;?php<br>// API endpoint URL<br>$url = 'http://127.0.0.1:1234/v1/chat/completions';<br><br>// Data to be sent in the POST request<br>$data = &#091;<br>    'model' =&gt; 'llama-3.2-1b-instruct',<br>    'messages' =&gt; &#091;<br>        &#091;'role' =&gt; 'user', 'content' =&gt; 'Wat is de hoofdstad van Frankrijk?']<br>    ]<br>];<br><br>// Initialize cURL session<br>$ch = curl_init($url);<br><br>// Encode data to JSON format<br>$payload = json_encode($data);<br><br>// Set cURL options<br>curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);<br>curl_setopt($ch, CURLOPT_POST, true);<br>curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);<br>curl_setopt($ch, CURLOPT_HTTPHEADER, &#091;<br>    'Content-Type: application/json',<br>    'Content-Length: ' . strlen($payload)<br>]);<br><br>// Execute cURL request<br>$response = curl_exec($ch);<br><br>// Check for errors<br>if ($response === false) {<br>    $error = curl_error($ch);<br>    curl_close($ch);<br>    die('cURL Error: ' . $error);<br>}<br><br>// Close cURL session<br>curl_close($ch);<br><br>// Decode and display the response<br>$result = json_decode($response, true);<br>print_r($result);<br>?&gt;</code></pre>



<p class="wp-block-paragraph">This sends a query to the <strong>local LLM</strong> and prints the response.</p>



<h2 class="wp-block-heading">7. Minimum System Requirements for LM Studio</h2>



<p class="wp-block-paragraph">Want to run a local LLM? Here are the <strong>minimum and recommended specifications</strong>:</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Component</th><th>Minimum Specs</th><th>Recommended Specs</th></tr></thead><tbody><tr><td><strong>CPU</strong></td><td>Intel Core i5 (AVX2)</td><td>Intel i7/i9 or AMD Ryzen 7/9</td></tr><tr><td><strong>RAM</strong></td><td>8 GB</td><td>16-32 GB (for larger models)</td></tr><tr><td><strong>Storage</strong></td><td>10 GB free space</td><td>50 GB+ (for multiple models)</td></tr><tr><td><strong>GPU</strong></td><td>Not required</td><td>NVIDIA GPU with CUDA for faster performance</td></tr></tbody></table></figure>



<p class="wp-block-paragraph">The <strong>more powerful your CPU/GPU</strong>, the faster the LLM will respond. A <strong>GPU like an NVIDIA RTX 3060+</strong> can significantly speed up the process.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading"><strong>Conclusion</strong></h2>



<p class="wp-block-paragraph">With LM Studio, you can <strong>run, test, and use local AI models</strong> without depending on cloud services. Whether you're creating a <strong>chatbot, AI assistant, or embedded LLM</strong>, this is a great way to run AI locally. <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f680.png" alt="🚀" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>


        <div id="utilehelp-chatbot" class="utilehelp-chatbot utilehelp-collapsed">
            <div class="utilehelp-chat-header utilehelp-chat-toggle" style="cursor:pointer;">
                <div class="utilehelp-chat-header-logo">
                    <span>U</span>
                </div>
                <div>
                    <div class="utilehelp-chat-header-title">
                        UtileHelp AI Assistant                        <span class="utilehelp-beta-label">BETA</span>
                    </div>
                    <div class="utilehelp-chat-header-desc">Ask your question about our services, support or knowledge base.</div>
                </div>
                <button class="utilehelp-chat-start-btn" type="button" style="margin-left:auto;">Start chat</button>
            </div>
            <div class="utilehelp-chat-body" style="display:none;">
                <div class="utilehelp-chat-window"></div>
                <form class="utilehelp-chat-form">
                    <input type="text" name="message" class="utilehelp-chat-input" placeholder="Type your question..." required />
                    <button type="submit" class="utilehelp-chat-send" aria-label="Send">
                        <svg viewBox="0 0 24 24" focusable="false" aria-hidden="true">
                            <path d="M12 5l6 6h-4v8h-4v-8H6z"/>
                        </svg>
                    </button>
                </form>
                <div class="utilehelp-chat-disclaimer">
                    <small>This is a <b>beta</b> version. The AI assistant is in training and may not always provide correct or complete information. Always verify important answers yourself or contact our team.</small>                </div>
                <div class="utilehelp-chat-loading" style="display:none;">Loading...</div>
            </div>
        </div>
        <script>
        window.utilehelp_ajax = {
            ajax_url: 'https://www.utilewebsites.nl/wp-admin/admin-ajax.php',
            nonce:    'a821582acc',
            lang:     'en'
        };
        // Toggle chat open/close
        jQuery(function($){
            $('#utilehelp-chatbot .utilehelp-chat-header, #utilehelp-chatbot .utilehelp-chat-start-btn').on('click', function(e){
                var $bot = $('#utilehelp-chatbot');
                var $body = $bot.find('.utilehelp-chat-body');
                $body.slideToggle(220);
                $bot.toggleClass('utilehelp-collapsed utilehelp-open');
                // Focus input bij openen
                if($bot.hasClass('utilehelp-open')) {
                    setTimeout(function() {
                        $body.find('.utilehelp-chat-input').focus();
                    }, 250);
                }
                e.stopPropagation();
            });
        });
        </script>
        
<p>Het bericht <a href="https://www.utilewebsites.nl/en/knowledgebase/hoe-installeer-je-een-lokale-llm-op-ubuntu-24-10-met-lm-studio/">How to Install a Local LLM on Ubuntu 24.10 with LM Studio?</a> verscheen eerst op <a href="https://www.utilewebsites.nl/en/">Utilewebsites</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Steps to Download and Display a PDF in an Ionic Vue App (Android/iOS):</title>
		<link>https://www.utilewebsites.nl/en/knowledgebase/stappen-om-een-pdf-te-downloaden-en-weer-te-geven-in-een-ionic-vue-app-android-ios/</link>
		
		<dc:creator><![CDATA[UtileWebsites]]></dc:creator>
		<pubDate>Sat, 30 Nov 2024 09:20:47 +0000</pubDate>
				<guid isPermaLink="false">https://www.utilewebsites.nl/knowledgebase/stappen-om-een-pdf-te-downloaden-en-weer-te-geven-in-een-ionic-vue-app-android-ios/</guid>

					<description><![CDATA[<p>2. Component Code (Web en Mobile)Add the following code as a component in your Ionic Vue project: 3. Explanation 4. Compatibility</p>
<p>Het bericht <a href="https://www.utilewebsites.nl/en/knowledgebase/stappen-om-een-pdf-te-downloaden-en-weer-te-geven-in-een-ionic-vue-app-android-ios/">Steps to Download and Display a PDF in an Ionic Vue App (Android/iOS):</a> verscheen eerst op <a href="https://www.utilewebsites.nl/en/">Utilewebsites</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-full is-resized"><a href="https://www.utilewebsites.nl/wp-content/uploads/2024/11/pdf_donwload_in_app_android_ios.jpg"><img loading="lazy" decoding="async" width="411" height="471" src="https://www.utilewebsites.nl/wp-content/uploads/2024/11/pdf_donwload_in_app_android_ios.jpg" alt="" class="wp-image-5158" style="width:306px;height:auto" srcset="https://www.utilewebsites.nl/wp-content/uploads/2024/11/pdf_donwload_in_app_android_ios.jpg 411w, https://www.utilewebsites.nl/wp-content/uploads/2024/11/pdf_donwload_in_app_android_ios-262x300.jpg 262w" sizes="auto, (max-width: 411px) 100vw, 411px" /></a></figure>



<ol class="wp-block-list">
<li><strong><strong>Install Required Packages</strong></strong> Add the necessary libraries to your project:</li>
</ol>



<pre class="wp-block-code"><code>npm install pdfjs-dist @capacitor/filesystem @capacitor-community/http
</code></pre>



<p class="wp-block-paragraph">2. <strong>Component Code (Web en Mobile)</strong><br>Add the following code as a component in your Ionic Vue project:</p>



<pre class="wp-block-code"><code>&lt;template&gt;
  &lt;ion-page&gt;
    &lt;ion-header&gt;
      &lt;ion-toolbar&gt;
        &lt;ion-title&gt;PDF Viewer&lt;/ion-title&gt;
      &lt;/ion-toolbar&gt;
    &lt;/ion-header&gt;
    &lt;ion-content class="ion-padding"&gt;
      &lt;ion-button @click="downloadAndRenderPdf"&gt;Download PDF&lt;/ion-button&gt;
      &lt;!-- PDF.js rendering container --&gt;
      &lt;div v-if="pdfUrl"&gt;
        &lt;canvas ref="pdfCanvas" style="width: 100%;"&gt;&lt;/canvas&gt;
      &lt;/div&gt;
    &lt;/ion-content&gt;
  &lt;/ion-page&gt;
&lt;/template&gt;

&lt;script&gt;
import { defineComponent, watch } from "vue";
import { IonPage, IonHeader, IonToolbar, IonTitle, IonContent, IonButton } from "@ionic/vue";
import { Filesystem, Directory } from "@capacitor/filesystem";
import { CapacitorHttp } from "@capacitor/core";
import * as pdfjsLib from 'pdfjs-dist/legacy/build/pdf';

// Set the workerSrc to the imported worker
pdfjsLib.GlobalWorkerOptions.workerSrc = new URL(
  "pdfjs-dist/build/pdf.worker.min.mjs",
  import.meta.url
).toString();

import { Capacitor } from '@capacitor/core';

// Add detailed platform and path logging
const platform = Capacitor.getPlatform();
console.log('Platform detection:', {
  platform,
  isAndroid: platform === 'android',
  isWeb: platform === 'web'
});

export default defineComponent({
  name: "TestpdfPage",
  components: {
    IonPage,
    IonHeader,
    IonToolbar,
    IonTitle,
    IonContent,
    IonButton,
  },
  data() {
    return {
      pdfUrl: null, // URL of the PDF to be rendered
    };
  },
  methods: {
    // Method to download and render the PDF
    async downloadAndRenderPdf() {
      try {
        console.log("Starting PDF download process...");

        const pdfUrl = "https://example.com/sample.pdf";
        const fileName = "temp.pdf";
        const dirPath = "downloaded";
        const savedFilePath = `${dirPath}/${fileName}`;

        console.log("Downloading PDF using CapacitorHttp from:", pdfUrl);

        // Clean up the existing directory
        try {
          await Filesystem.rmdir({
            path: dirPath,
            directory: Directory.Data,
            recursive: true,
          });
          console.log("Cleaned up existing directory");
        } catch (e) {
          console.log("No existing directory to clean up");
        }

        // Download PDF using native HTTP
        const response = await CapacitorHttp.get({
          url: pdfUrl,
          responseType: "arraybuffer",
        });

        console.log("Download response:", response);

        // Check if response.data is a string (Base64) or an ArrayBuffer
        let base64Data;
        if (typeof response.data === 'string') {
          // Data is already Base64-encoded
          base64Data = response.data;
          console.log("Received data is a Base64 string");
        } else {
          // Convert ArrayBuffer to Base64
          base64Data = this.arrayBufferToBase64(response.data);
          console.log("Converted ArrayBuffer to Base64");
        }

        console.log("Base64 data length:", base64Data.length);

        // Save to device storage
        try {
          await Filesystem.mkdir({
            path: dirPath,
            directory: Directory.Data,
            recursive: true,
          });
          console.log("Created directory for PDF");

          await Filesystem.writeFile({
            path: savedFilePath,
            data: base64Data,
            directory: Directory.Data,
          });

          console.log("File saved locally");

          // Check if the file exists and get its size
          const fileStat = await Filesystem.stat({
            path: savedFilePath,
            directory: Directory.Data,
          });

          console.log("File exists:", fileStat.uri);
          console.log("File size in bytes:", fileStat.size);

          if (fileStat.size === 0) {
            console.error("Downloaded file is empty.");
            return;
          }

          // Set the PDF URL to display it
          this.pdfUrl = "data:application/pdf;base64," + base64Data;
        } catch (fsError) {
          console.error("Filesystem Error:", fsError);
          throw fsError;
        }
      } catch (error) {
        console.error("Operation Failed:", error);
      }
    },
    // Method to render the PDF on a canvas
    async renderPdf() {
      console.log("Starting PDF rendering process...");

      const canvas = this.$refs.pdfCanvas;
      if (!canvas) {
        console.error("Canvas element not found");
        return;
      }
      console.log("Canvas element found");

      const ctx = canvas.getContext("2d");
      if (!ctx) {
        console.error("Failed to get 2D context");
        return;
      }
      console.log("2D context obtained");

      try {
        const pdf = await pdfjsLib.getDocument(this.pdfUrl).promise;
        console.log("PDF document fetched successfully");

        const page = await pdf.getPage(1);
        console.log("Page 1 of PDF document fetched successfully");

        const viewport = page.getViewport({ scale: 1.5 });
        console.log("Viewport created with scale 1.5");

        canvas.width = viewport.width;
        canvas.height = viewport.height;
        console.log("Canvas dimensions set to width:", viewport.width, "height:", viewport.height);

        const renderContext = {
          canvasContext: ctx,
          viewport: viewport,
        };

        console.log("Starting PDF page render");
        await page.render(renderContext).promise;
        console.log("PDF rendered successfully");
      } catch (error) {
        console.error("Error rendering PDF:", JSON.stringify(error, Object.getOwnPropertyNames(error)));
      }
    },
    // Helper method to convert ArrayBuffer to Base64
    arrayBufferToBase64(buffer) {
      let binary = "";
      const bytes = new Uint8Array(buffer);
      const len = bytes.byteLength;
      for (let i = 0; i &lt; len; i++) {
        binary += String.fromCharCode(bytes&#91;i]);
      }
      return btoa(binary);
    },
  },
  watch: {
    // Watcher to render the PDF when the URL changes
    pdfUrl(newUrl) {
      if (newUrl) {
        this.$nextTick(() =&gt; {
          this.renderPdf();
        });
      }
    }
  }
});
&lt;/script&gt;
</code></pre>



<p class="wp-block-paragraph">3. <strong><strong>Explanation</strong></strong></p>



<ul class="wp-block-list">
<li><strong>HTTP Plugin</strong>: Safely downloads files on mobile devices.</li>



<li><strong>Filesystem Plugin</strong>: Saves files locally in the <code>Documents</code> directory, critical for Android/iOS.</li>



<li><strong>PDF.js</strong>: Responsible for rendering PDFs into a canvas element.</li>
</ul>



<p class="wp-block-paragraph">4. <strong><strong>Compatibility</strong></strong></p>



<ul class="wp-block-list">
<li><strong>Android/iOS</strong>: Ensure permissions are set for file access in <code>AndroidManifest.xml</code> and <code>Info.plist</code>.</li>



<li><strong>Web</strong>: PDF.js works directly with external URLs without requiring local storage.</li>
</ul>



<p class="wp-block-paragraph"></p>
<p>Het bericht <a href="https://www.utilewebsites.nl/en/knowledgebase/stappen-om-een-pdf-te-downloaden-en-weer-te-geven-in-een-ionic-vue-app-android-ios/">Steps to Download and Display a PDF in an Ionic Vue App (Android/iOS):</a> verscheen eerst op <a href="https://www.utilewebsites.nl/en/">Utilewebsites</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Realtime Console Log Reading for Testing on iPhone and iPad with Developer Tools</title>
		<link>https://www.utilewebsites.nl/en/knowledgebase/realtime-console-log-reading-for-testing-on-iphone-and-ipad-with-developer-tools/</link>
		
		<dc:creator><![CDATA[UtileWebsites]]></dc:creator>
		<pubDate>Thu, 29 Aug 2024 08:41:39 +0000</pubDate>
				<guid isPermaLink="false">https://www.utilewebsites.nl/knowledgebase/realtime-console-log-uitlezen-voor-testen-op-iphone-en-ipad-met-ontwikkelaarstools/</guid>

					<description><![CDATA[<p>Debugging mobile websites or applications is essential to ensure they work correctly on different devices. If you work with iPhones and iPads, Apple provides powerful tools to read the console log in real time. In this article, I will discuss how you can use these developer tools to read the console log from an iPhone or iPad during testing. Requirements To read the console log from an iPhone or iPad, you will need the following: Steps to Read the Console Log Step 1: Install Xcode If you haven’t installed Xcode yet, you can do so via the Mac App Store.&#160;<a href="https://www.utilewebsites.nl/en/knowledgebase/realtime-console-log-reading-for-testing-on-iphone-and-ipad-with-developer-tools/" class="read-more">Continue Reading</a></p>
<p>Het bericht <a href="https://www.utilewebsites.nl/en/knowledgebase/realtime-console-log-reading-for-testing-on-iphone-and-ipad-with-developer-tools/">Realtime Console Log Reading for Testing on iPhone and iPad with Developer Tools</a> verscheen eerst op <a href="https://www.utilewebsites.nl/en/">Utilewebsites</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Debugging mobile websites or applications is essential to ensure they work correctly on different devices. If you work with iPhones and iPads, Apple provides powerful tools to read the console log in real time. In this article, I will discuss how you can use these developer tools to read the console log from an iPhone or iPad during testing.</p>



<p class="wp-block-paragraph"><strong>Requirements</strong></p>



<p class="wp-block-paragraph">To read the console log from an iPhone or iPad, you will need the following:</p>



<ul class="wp-block-list">
<li>An iPhone or iPad with iOS/iPadOS</li>



<li>A MacBook with macOS</li>



<li>A Lightning or USB-C cable</li>



<li>Xcode (Apple's Integrated Development Environment)</li>
</ul>



<p class="wp-block-paragraph"><strong>Steps to Read the Console Log</strong></p>



<p class="wp-block-paragraph"><strong>Step 1: Install Xcode</strong></p>



<p class="wp-block-paragraph">If you haven’t installed Xcode yet, you can do so via the Mac App Store. Xcode contains essential developer tools needed to read the console log from an iPhone or iPad.</p>



<p class="wp-block-paragraph"><strong>Step 2: Enable Developer Mode on Your iPhone/iPad</strong></p>



<p class="wp-block-paragraph">Before you can read the console log, you need to activate developer mode on your device:</p>



<ol class="wp-block-list">
<li>Go to <strong>Settings > Privacy &amp; Security</strong> on your iPhone or iPad.</li>



<li>Scroll down and turn on <strong>Developer Mode</strong>.</li>



<li>Follow the prompts to restart your device and activate developer mode.</li>
</ol>



<p class="wp-block-paragraph"><strong>Step 3: Activate Web Inspector</strong></p>



<p class="wp-block-paragraph">Web Inspector is a tool that allows you to inspect and debug the HTML, CSS, and JavaScript of a website in real time:</p>



<ol class="wp-block-list">
<li>Open <strong>Settings > Safari > Advanced</strong> on your iPhone or iPad.</li>



<li>Toggle the switch for <strong>Web Inspector</strong> on.</li>
</ol>



<p class="wp-block-paragraph"><strong>Step 4: Connect Your iPhone/iPad to Your MacBook</strong></p>



<p class="wp-block-paragraph">Use a Lightning or USB-C cable to connect your iPhone or iPad to your MacBook. This allows your MacBook to monitor the activities on your device.</p>



<p class="wp-block-paragraph"><strong>Step 5: Open Safari on Your MacBook</strong></p>



<p class="wp-block-paragraph">To access the console log:</p>



<ol class="wp-block-list">
<li>Go to <strong>Safari > Preferences > Advanced</strong> on your MacBook.</li>



<li>Check the box for <strong>Show Develop menu in menu bar</strong>.</li>
</ol>



<p class="wp-block-paragraph"><strong>Step 6: Start the Web Inspector</strong></p>



<p class="wp-block-paragraph">You can now use Web Inspector to read the console log from your iPhone or iPad:</p>



<ol class="wp-block-list">
<li>Go to the menu bar in Safari and click on <strong>Develop</strong>.</li>



<li>You should see your iPhone or iPad listed under the Develop menu.</li>



<li>Hover over your device’s name and select the website or web page you are viewing on your iPhone or iPad.</li>



<li>This will open the Web Inspector, where you can view and analyze the console log in real time.</li>
</ol>



<p class="wp-block-paragraph"><strong>Conclusion</strong></p>



<p class="wp-block-paragraph">By following the steps above, you can easily read the console log from an iPhone or iPad during testing. This allows you to identify and resolve issues in real time, which is crucial for optimizing mobile websites and applications. Using the Web Inspector in Safari enables you to quickly identify and address errors, improving the overall quality of your developed software.Het debuggen van mobiele websites of applicaties is essentieel om ervoor te zorgen dat ze correct werken op v</p>
<p>Het bericht <a href="https://www.utilewebsites.nl/en/knowledgebase/realtime-console-log-reading-for-testing-on-iphone-and-ipad-with-developer-tools/">Realtime Console Log Reading for Testing on iPhone and iPad with Developer Tools</a> verscheen eerst op <a href="https://www.utilewebsites.nl/en/">Utilewebsites</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Key Programming Principles and Examples</title>
		<link>https://www.utilewebsites.nl/en/knowledgebase/key-programming-principles-and-examples-2/</link>
		
		<dc:creator><![CDATA[UtileWebsites]]></dc:creator>
		<pubDate>Thu, 29 Aug 2024 07:10:33 +0000</pubDate>
				<guid isPermaLink="false">https://www.utilewebsites.nl/knowledgebase/belangrijkste-programmeerprincipes-en-voorbeelden-2/</guid>

					<description><![CDATA[<p>Welcome to this guide where we explore some fundamental programming principles, supported by clear examples in PHP, JavaScript, and Python. Whether you're a beginner or looking to refresh your knowledge, this guide will help you better understand essential concepts. Tip: Code examples in this article can be run interactively in your favorite code editor. Experiment with the code to see how it works! 1. Variables and Data Types A variable is a name that refers to a memory location where a value is stored. Data types determine what kind of value a variable can hold, such as integers, strings, and&#160;<a href="https://www.utilewebsites.nl/en/knowledgebase/key-programming-principles-and-examples-2/" class="read-more">Continue Reading</a></p>
<p>Het bericht <a href="https://www.utilewebsites.nl/en/knowledgebase/key-programming-principles-and-examples-2/">Key Programming Principles and Examples</a> verscheen eerst op <a href="https://www.utilewebsites.nl/en/">Utilewebsites</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Welcome to this guide where we explore some fundamental programming principles, supported by clear examples in PHP, JavaScript, and Python. Whether you're a beginner or looking to refresh your knowledge, this guide will help you better understand essential concepts.</p>



<p class="wp-block-paragraph"><strong>Tip:</strong> Code examples in this article can be run interactively in your favorite code editor. Experiment with the code to see how it works!</p>



<h2 class="wp-block-heading">1. Variables and Data Types</h2>



<p class="wp-block-paragraph">A variable is a name that refers to a memory location where a value is stored. Data types determine what kind of value a variable can hold, such as integers, strings, and booleans.</p>



<h3 class="wp-block-heading">Example in PHP:</h3>



<pre class="wp-block-code"><code>$age = 25;  // Integer
$name = "John";  // String
$isStudent = true;  // Boolean</code></pre>



<h3 class="wp-block-heading">Example in JavaScript:</h3>



<pre class="wp-block-code"><code>let age = 25;  // Integer
let name = "John";  // String
let isStudent = true;  // Boolean</code></pre>



<h3 class="wp-block-heading">Example in Python:</h3>



<pre class="wp-block-code"><code>age = 25  # Integer
name = "John"  # String
is_student = True  # Boolean</code></pre>



<h2 class="wp-block-heading">2. Control Flow (If-Else, Loops)</h2>



<p class="wp-block-paragraph">Control flow statements determine the order in which the code is executed. This allows you to make decisions (if-else) and perform repeated actions (loops).</p>



<h3 class="wp-block-heading">Example in PHP:</h3>



<pre class="wp-block-code"><code>$score = 85;
if ($score &gt;= 90) {
    echo "A";
} elseif ($score &gt;= 80) {
    echo "B";
} else {
    echo "C";
}</code></pre>



<h3 class="wp-block-heading">Example in JavaScript:</h3>



<pre class="wp-block-code"><code>let score = 85;
if (score &gt;= 90) {
    console.log("A");
} else if (score &gt;= 80) {
    console.log("B");
} else {
    console.log("C");
}</code></pre>



<h3 class="wp-block-heading">Example in Python:</h3>



<pre class="wp-block-code"><code>score = 85
if score &gt;= 90:
    print("A")
elif score &gt;= 80:
    print("B")
else:
    print("C")</code></pre>



<h2 class="wp-block-heading">3. Functions</h2>



<p class="wp-block-paragraph">Functions are blocks of reusable code that can be called by name. They help organize code and avoid duplication.</p>



<h3 class="wp-block-heading">Example in PHP:</h3>



<pre class="wp-block-code"><code>function greet($name) {
    return "Hello, " . $name;
}
echo greet("Alice");  // Output: Hello, Alice</code></pre>



<h3 class="wp-block-heading">Example in JavaScript:</h3>



<pre class="wp-block-code"><code>function greet(name) {
    return "Hello, " + name;
}
console.log(greet("Alice"));  // Output: Hello, Alice</code></pre>



<h3 class="wp-block-heading">Example in Python:</h3>



<pre class="wp-block-code"><code>def greet(name):
    return "Hello, " + name

print(greet("Alice"))  # Output: Hello, Alice</code></pre>



<h2 class="wp-block-heading">4. Arrays and Lists</h2>



<p class="wp-block-paragraph">Arrays and lists are collections of values that can be accessed via indexes. They are useful for storing multiple pieces of data in a single variable.</p>



<h3 class="wp-block-heading">Example in PHP:</h3>



<pre class="wp-block-code"><code>$fruits = array("Apple", "Banana", "Cherry");
echo $fruits&#91;1];  // Output: Banana</code></pre>



<h3 class="wp-block-heading">Example in JavaScript:</h3>



<pre class="wp-block-code"><code>let fruits = &#91;"Apple", "Banana", "Cherry"];
console.log(fruits&#91;1]);  // Output: Banana</code></pre>



<h3 class="wp-block-heading">Example in Python:</h3>



<pre class="wp-block-code"><code>fruits = &#91;"Apple", "Banana", "Cherry"]
print(fruits&#91;1])  # Output: Banana</code></pre>



<h2 class="wp-block-heading">5. Object-Oriented Programming (OOP)</h2>



<p class="wp-block-paragraph">OOP is a programming paradigm based on the concept of "objects," which bundle data (attributes) and functions (methods). It helps structure complex programs.</p>



<h3 class="wp-block-heading">Example in PHP:</h3>



<pre class="wp-block-code"><code>class Car {
    public $color;
    public function __construct($color) {
        $this-&gt;color = $color;
    }
    public function honk() {
        return "Beep!";
    }
}
$myCar = new Car("red");
echo $myCar-&gt;honk();  // Output: Beep!</code></pre>



<h3 class="wp-block-heading">Example in JavaScript:</h3>



<pre class="wp-block-code"><code>class Car {
    constructor(color) {
        this.color = color;
    }
    honk() {
        return "Beep!";
    }
}
let myCar = new Car("red");
console.log(myCar.honk());  // Output: Beep!</code></pre>



<h3 class="wp-block-heading">Example in Python:</h3>



<pre class="wp-block-code"><code>class Car:
    def __init__(self, color):
        self.color = color
    
    def honk(self):
        return "Beep!"

my_car = Car("red")
print(my_car.honk())  # Output: Beep!</code></pre>



<h2 class="wp-block-heading">6. Modularity</h2>



<p class="wp-block-paragraph">Modularity involves dividing a program into smaller, self-contained components (modules). This promotes reuse and makes the code easier to understand and maintain.</p>



<h3 class="wp-block-heading">Example in PHP:</h3>



<pre class="wp-block-code"><code>// math_functions.php
function add($a, $b) {
    return $a + $b;
}

// main.php
include 'math_functions.php';
echo add(5, 10);  // Output: 15</code></pre>



<h3 class="wp-block-heading">Example in JavaScript:</h3>



<pre class="wp-block-code"><code>// mathFunctions.js
export function add(a, b) {
    return a + b;
}

// main.js
import { add } from './mathFunctions.js';
console.log(add(5, 10));  // Output: 15</code></pre>



<h3 class="wp-block-heading">Example in Python:</h3>



<pre class="wp-block-code"><code># math_functions.py
def add(a, b):
    return a + b

# main.py
from math_functions import add
print(add(5, 10))  # Output: 15</code></pre>



<h2 class="wp-block-heading">7. Debugging and Error Handling</h2>



<p class="wp-block-paragraph">Debugging is the process of identifying and fixing errors in the code. Error handling ensures that your program deals with errors in a controlled manner.</p>



<h3 class="wp-block-heading">Example in PHP:</h3>



<pre class="wp-block-code"><code>try {
    $result = 10 / 0;
} catch (Exception $e) {
    echo "Caught exception: " . $e-&gt;getMessage();
}</code></pre>



<h3 class="wp-block-heading">Example in JavaScript:</h3>



<pre class="wp-block-code"><code>try {
    let result = 10 / 0;
} catch (e) {
    console.log("Caught exception: " + e.message);
}</code></pre>



<h3 class="wp-block-heading">Example in Python:</h3>



<pre class="wp-block-code"><code>try:
    result = 10 / 0
except Exception as e:
    print("Caught exception:", str(e))</code></pre>



<h2 class="wp-block-heading">8. Recursion</h2>



<p class="wp-block-paragraph">Recursion is a programming technique where a function calls itself. It is often used to solve problems that can be broken down into smaller, similar problems.</p>



<h3 class="wp-block-heading">Example in PHP:</h3>



<pre class="wp-block-code"><code>function factorial($n) {
    if ($n === 0) {
        return 1;
    } else {
        return $n * factorial($n - 1);
    }
}
echo factorial(5);  // Output: 120</code></pre>



<h3 class="wp-block-heading">Example in JavaScript:</h3>



<pre class="wp-block-code"><code>function factorial(n) {
    if (n === 0) {
        return 1;
    } else {
        return n * factorial(n - 1);
    }
}
console.log(factorial(5));  // Output: 120</code></pre>



<h3 class="wp-block-heading">Example in Python:</h3>



<pre class="wp-block-code"><code>def factorial(n):
    if n == 0:
        return 1
    else:
        return n * factorial(n - 1)

print(factorial(5))  # Output: 120</code></pre>



<h2 class="wp-block-heading">9. DRY (Don't Repeat Yourself)</h2>



<p class="wp-block-paragraph">This principle emphasizes the importance of avoiding duplication in your code. Don't repeat logic; instead, use functions or modules to make code reusable.</p>



<h3 class="wp-block-heading">Example in PHP:</h3>



<pre class="wp-block-code"><code>// Define a function to avoid repetition
function calculateArea($width, $height) {
    return $width * $height;
}

$area1 = calculateArea(5, 10);
$area2 = calculateArea(7, 3);</code></pre>



<h3 class="wp-block-heading">Example in JavaScript:</h3>



<pre class="wp-block-code"><code>// Define a function to avoid repetition
function calculateArea(width, height) {
    return width * height;
}

let area1 = calculateArea(5, 10);
let area2 = calculateArea(7, 3);</code></pre>



<h3 class="wp-block-heading">Example in Python:</h3>



<pre class="wp-block-code"><code># Define a function to avoid repetition
def calculate_area(width, height):
    return width * height

area1 = calculate_area(5, 10)
area2 = calculate_area(7, 3)</code></pre>



<h2 class="wp-block-heading">10. KISS (Keep It Simple, Stupid)</h2>



<p class="wp-block-paragraph">Keep your code as simple as possible. Complex solutions are often harder to maintain and debug. By keeping your code simple, you minimize the chance of errors.</p>



<h3 class="wp-block-heading">Example in PHP:</h3>



<pre class="wp-block-code"><code>// A simple calculation without unnecessary complexity
function add($a, $b) {
    return $a + $b;
}
echo add(5, 10);</code></pre>



<h3 class="wp-block-heading">Example in JavaScript:</h3>



<pre class="wp-block-code"><code>// A simple calculation without unnecessary complexity
function add(a, b) {
    return a + b;
}
console.log(add(5, 10));</code></pre>



<h3 class="wp-block-heading">Example in Python:</h3>



<pre class="wp-block-code"><code># A simple calculation without unnecessary complexity
def add(a, b):
    return a + b

print(add(5, 10))</code></pre>



<h2 class="wp-block-heading">11. YAGNI (You Aren't Gonna Need It)</h2>



<p class="wp-block-paragraph">Only add functionality that is needed at the moment. Anticipating future needs can lead to unnecessary complexity and bloat in your code.</p>



<h3 class="wp-block-heading">Example in PHP:</h3>



<pre class="wp-block-code"><code>// Don't add unnecessary functions
function multiply($a, $b) {
    return $a * $b;
}
echo multiply(5, 10);</code></pre>



<h3 class="wp-block-heading">Example in JavaScript:</h3>



<pre class="wp-block-code"><code>// Don't add unnecessary functions
function multiply(a, b) {
    return a * b;
}
console.log(multiply(5, 10));</code></pre>



<h3 class="wp-block-heading">Example in Python:</h3>



<pre class="wp-block-code"><code># Don't add unnecessary functions
def multiply(a, b):
    return a * b

print(multiply(5, 10))</code></pre>



<h2 class="wp-block-heading">12. Documentation</h2>



<p class="wp-block-paragraph">Ensure that your code is well-documented so that others (or yourself in the future) can easily understand it. This includes not only comments in the code but also clear README files and architecture notes.</p>



<h3 class="wp-block-heading">Example in PHP:</h3>



<pre class="wp-block-code"><code>// Calculate the area of a rectangle
function calculateArea($width, $height) {
    return $width * $height;
}

// Usage examples
$area = calculateArea(5, 10);
echo $area;  // Output: 50</code></pre>



<h3 class="wp-block-heading">Example in JavaScript:</h3>



<pre class="wp-block-code"><code>// Calculate the area of a rectangle
function calculateArea(width, height) {
    return width * height;
}

// Usage examples
let area = calculateArea(5, 10);
console.log(area);  // Output: 50</code></pre>



<h3 class="wp-block-heading">Example in Python:</h3>



<pre class="wp-block-code"><code># Calculate the area of a rectangle
def calculate_area(width, height):
    return width * height

# Usage examples
area = calculate_area(5, 10)
print(area)  # Output: 50</code></pre>



<h2 class="wp-block-heading">13. Efficiency and Scalability</h2>



<p class="wp-block-paragraph">Code should not only be functional but also efficient and scalable. This includes avoiding unnecessary loops, optimizing memory management, and using techniques such as profiling to identify performance bottlenecks.</p>



<h3 class="wp-block-heading">Example in PHP:</h3>



<pre class="wp-block-code"><code>// Using an efficient loop
$numbers = range(1, 100);
$sum = array_sum($numbers);
echo $sum;  // Output: 5050</code></pre>



<h3 class="wp-block-heading">Example in JavaScript:</h3>



<pre class="wp-block-code"><code>// Using an efficient loop
let numbers = Array.from({length: 100}, (_, i) =&gt; i + 1);
let sum = numbers.reduce((acc, curr) =&gt; acc + curr, 0);
console.log(sum);  // Output: 5050</code></pre>



<h3 class="wp-block-heading">Example in Python:</h3>



<pre class="wp-block-code"><code># Using an efficient loop
numbers = range(1, 101)
sum = sum(numbers)
print(sum)  # Output: 5050</code></pre>



<p class="wp-block-paragraph"></p>

<p>Het bericht <a href="https://www.utilewebsites.nl/en/knowledgebase/key-programming-principles-and-examples-2/">Key Programming Principles and Examples</a> verscheen eerst op <a href="https://www.utilewebsites.nl/en/">Utilewebsites</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Belangrijkste Programmeerprincipes en Voorbeelden</title>
		<link>https://www.utilewebsites.nl/en/knowledgebase/belangrijkste-programmeerprincipes-en-voorbeelden/</link>
		
		<dc:creator><![CDATA[UtileWebsites]]></dc:creator>
		<pubDate>Thu, 29 Aug 2024 07:10:33 +0000</pubDate>
				<guid isPermaLink="false">https://www.utilewebsites.nl/knowledgebase/belangrijkste-programmeerprincipes-en-voorbeelden-2/</guid>

					<description><![CDATA[<p>Welkom bij deze gids waarin we enkele fundamentele programmeerprincipes verkennen, ondersteund met duidelijke voorbeelden in PHP, JavaScript en Python. Of u nu een beginner bent of uw kennis wilt opfrissen, deze gids helpt u om essentiële concepten beter te begrijpen. Tip: Codevoorbeelden in dit artikel kunnen interactief worden uitgevoerd in uw favoriete code-editor. Experimenteer met de code om te zien hoe deze werkt! 1. Variabelen en Datatypen Een variabele is een naam die verwijst naar een locatie in het geheugen waar een waarde is opgeslagen. Datatypen bepalen wat voor soort waarde een variabele kan bevatten, zoals integers, strings, en booleans. Voorbeeld&#160;<a href="https://www.utilewebsites.nl/en/knowledgebase/belangrijkste-programmeerprincipes-en-voorbeelden/" class="read-more">Continue Reading</a></p>
<p>Het bericht <a href="https://www.utilewebsites.nl/en/knowledgebase/belangrijkste-programmeerprincipes-en-voorbeelden/">Belangrijkste Programmeerprincipes en Voorbeelden</a> verscheen eerst op <a href="https://www.utilewebsites.nl/en/">Utilewebsites</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Welkom bij deze gids waarin we enkele fundamentele programmeerprincipes verkennen, ondersteund met duidelijke voorbeelden in PHP, JavaScript en Python. Of u nu een beginner bent of uw kennis wilt opfrissen, deze gids helpt u om essentiële concepten beter te begrijpen.</p>



<p class="wp-block-paragraph"><strong>Tip:</strong> Codevoorbeelden in dit artikel kunnen interactief worden uitgevoerd in uw favoriete code-editor. Experimenteer met de code om te zien hoe deze werkt!</p>



<h2 class="wp-block-heading">1. Variabelen en Datatypen</h2>



<p class="wp-block-paragraph">Een variabele is een naam die verwijst naar een locatie in het geheugen waar een waarde is opgeslagen. Datatypen bepalen wat voor soort waarde een variabele kan bevatten, zoals integers, strings, en booleans.</p>



<h3 class="wp-block-heading">Voorbeeld in PHP:</h3>



<pre class="wp-block-code"><code>$age = 25;  // Integer
$name = "John";  // String
$isStudent = true;  // Boolean</code></pre>



<h3 class="wp-block-heading">Voorbeeld in JavaScript:</h3>



<pre class="wp-block-code"><code>let age = 25;  // Integer
let name = "John";  // String
let isStudent = true;  // Boolean</code></pre>



<h3 class="wp-block-heading">Voorbeeld in Python:</h3>



<pre class="wp-block-code"><code>age = 25  # Integer
name = "John"  # String
is_student = True  # Boolean</code></pre>



<h2 class="wp-block-heading">2. Control Flow (If-Else, Loops)</h2>



<p class="wp-block-paragraph">Control flow statements bepalen de volgorde waarin de code wordt uitgevoerd. Dit maakt het mogelijk om beslissingen te nemen (if-else) en herhaalde acties uit te voeren (loops).</p>



<h3 class="wp-block-heading">Voorbeeld in PHP:</h3>



<pre class="wp-block-code"><code>$score = 85;
if ($score &gt;= 90) {
    echo "A";
} elseif ($score &gt;= 80) {
    echo "B";
} else {
    echo "C";
}</code></pre>



<h3 class="wp-block-heading">Voorbeeld in JavaScript:</h3>



<pre class="wp-block-code"><code>let score = 85;
if (score &gt;= 90) {
    console.log("A");
} else if (score &gt;= 80) {
    console.log("B");
} else {
    console.log("C");
}</code></pre>



<h3 class="wp-block-heading">Voorbeeld in Python:</h3>



<pre class="wp-block-code"><code>score = 85
if score &gt;= 90:
    print("A")
elif score &gt;= 80:
    print("B")
else:
    print("C")</code></pre>



<h2 class="wp-block-heading">3. Functies</h2>



<p class="wp-block-paragraph">Functies zijn blokken van herbruikbare code die kunnen worden aangeroepen met een naam. Ze helpen bij het organiseren van code en vermijden duplicatie.</p>



<h3 class="wp-block-heading">Voorbeeld in PHP:</h3>



<pre class="wp-block-code"><code>function greet($name) {
    return "Hello, " . $name;
}
echo greet("Alice");  // Output: Hello, Alice</code></pre>



<h3 class="wp-block-heading">Voorbeeld in JavaScript:</h3>



<pre class="wp-block-code"><code>function greet(name) {
    return "Hello, " + name;
}
console.log(greet("Alice"));  // Output: Hello, Alice</code></pre>



<h3 class="wp-block-heading">Voorbeeld in Python:</h3>



<pre class="wp-block-code"><code>def greet(name):
    return "Hello, " + name

print(greet("Alice"))  # Output: Hello, Alice</code></pre>



<h2 class="wp-block-heading">4. Arrays en Lijsten</h2>



<p class="wp-block-paragraph">Arrays en lijsten zijn verzamelingen van waarden die kunnen worden benaderd via indexen. Ze zijn handig om meerdere gegevens in één variabele op te slaan.</p>



<h3 class="wp-block-heading">Voorbeeld in PHP:</h3>



<pre class="wp-block-code"><code>$fruits = array("Apple", "Banana", "Cherry");
echo $fruits&#91;1];  // Output: Banana</code></pre>



<h3 class="wp-block-heading">Voorbeeld in JavaScript:</h3>



<pre class="wp-block-code"><code>let fruits = &#91;"Apple", "Banana", "Cherry"];
console.log(fruits&#91;1]);  // Output: Banana</code></pre>



<h3 class="wp-block-heading">Voorbeeld in Python:</h3>



<pre class="wp-block-code"><code>fruits = &#91;"Apple", "Banana", "Cherry"]
print(fruits&#91;1])  # Output: Banana</code></pre>



<h2 class="wp-block-heading">5. Objectgeoriënteerd Programmeren (OOP)</h2>



<p class="wp-block-paragraph">OOP is een programmeerparadigma gebaseerd op het concept van "objecten", die data (attributen) en functies (methoden) bundelen. Het helpt bij het structureren van complexe programma's.</p>



<h3 class="wp-block-heading">Voorbeeld in PHP:</h3>



<pre class="wp-block-code"><code>class Car {
    public $color;
    public function __construct($color) {
        $this-&gt;color = $color;
    }
    public function honk() {
        return "Beep!";
    }
}
$myCar = new Car("red");
echo $myCar-&gt;honk();  // Output: Beep!</code></pre>



<h3 class="wp-block-heading">Voorbeeld in JavaScript:</h3>



<pre class="wp-block-code"><code>class Car {
    constructor(color) {
        this.color = color;
    }
    honk() {
        return "Beep!";
    }
}
let myCar = new Car("red");
console.log(myCar.honk());  // Output: Beep!</code></pre>



<h3 class="wp-block-heading">Voorbeeld in Python:</h3>



<pre class="wp-block-code"><code>class Car:
    def __init__(self, color):
        self.color = color
    
    def honk(self):
        return "Beep!"

my_car = Car("red")
print(my_car.honk())  # Output: Beep!</code></pre>



<h2 class="wp-block-heading">6. Modulariteit</h2>



<p class="wp-block-paragraph">Modulariteit gaat over het opdelen van een programma in kleinere, zelfstandige onderdelen (modules). Dit bevordert hergebruik en maakt de code makkelijker te begrijpen en te onderhouden.</p>



<h3 class="wp-block-heading">Voorbeeld in PHP:</h3>



<pre class="wp-block-code"><code>// math_functions.php
function add($a, $b) {
    return $a + $b;
}

// main.php
include 'math_functions.php';
echo add(5, 10);  // Output: 15</code></pre>



<h3 class="wp-block-heading">Voorbeeld in JavaScript:</h3>



<pre class="wp-block-code"><code>// mathFunctions.js
export function add(a, b) {
    return a + b;
}

// main.js
import { add } from './mathFunctions.js';
console.log(add(5, 10));  // Output: 15</code></pre>



<h3 class="wp-block-heading">Voorbeeld in Python:</h3>



<pre class="wp-block-code"><code># math_functions.py
def add(a, b):
    return a + b

# main.py
from math_functions import add
print(add(5, 10))  # Output: 15</code></pre>



<h2 class="wp-block-heading">7. Debugging en Foutenafhandeling</h2>



<p class="wp-block-paragraph">Debugging is het proces van het identificeren en oplossen van fouten in de code. Foutenafhandeling zorgt ervoor dat uw programma op een gecontroleerde manier met fouten omgaat.</p>



<h3 class="wp-block-heading">Voorbeeld in PHP:</h3>



<pre class="wp-block-code"><code>try {
    $result = 10 / 0;
} catch (Exception $e) {
    echo "Caught exception: " . $e-&gt;getMessage();
}</code></pre>



<h3 class="wp-block-heading">Voorbeeld in JavaScript:</h3>



<pre class="wp-block-code"><code>try {
    let result = 10 / 0;
} catch (e) {
    console.log("Caught exception: " + e.message);
}</code></pre>



<h3 class="wp-block-heading">Voorbeeld in Python:</h3>



<pre class="wp-block-code"><code>try:
    result = 10 / 0
except Exception as e:
    print("Caught exception:", str(e))</code></pre>



<h2 class="wp-block-heading">8. Recursie</h2>



<p class="wp-block-paragraph">Recursie is een programmeertechniek waarbij een functie zichzelf aanroept. Het wordt vaak gebruikt voor het oplossen van problemen die kunnen worden opgedeeld in kleinere, vergelijkbare problemen.</p>



<h3 class="wp-block-heading">Voorbeeld in PHP:</h3>



<pre class="wp-block-code"><code>function factorial($n) {
    if ($n === 0) {
        return 1;
    } else {
        return $n * factorial($n - 1);
    }
}
echo factorial(5);  // Output: 120</code></pre>



<h3 class="wp-block-heading">Voorbeeld in JavaScript:</h3>



<pre class="wp-block-code"><code>function factorial(n) {
    if (n === 0) {
        return 1;
    } else {
        return n * factorial(n - 1);
    }
}
console.log(factorial(5));  // Output: 120</code></pre>



<h3 class="wp-block-heading">Voorbeeld in Python:</h3>



<pre class="wp-block-code"><code>def factorial(n):
    if n == 0:
        return 1
    else:
        return n * factorial(n - 1)

print(factorial(5))  # Output: 120</code></pre>



<h2 class="wp-block-heading">9. DRY (Don't Repeat Yourself)</h2>



<p class="wp-block-paragraph">Dit principe benadrukt het belang van het vermijden van duplicatie in uw code. Herhaal geen logica; gebruik in plaats daarvan functies of modules om code herbruikbaar te maken.</p>



<h3 class="wp-block-heading">Voorbeeld in PHP:</h3>



<pre class="wp-block-code"><code>// Definieer een functie om herhaling te voorkomen
function calculateArea($width, $height) {
    return $width * $height;
}

$area1 = calculateArea(5, 10);
$area2 = calculateArea(7, 3);</code></pre>



<h3 class="wp-block-heading">Voorbeeld in JavaScript:</h3>



<pre class="wp-block-code"><code>// Definieer een functie om herhaling te voorkomen
function calculateArea(width, height) {
    return width * height;
}

let area1 = calculateArea(5, 10);
let area2 = calculateArea(7, 3);</code></pre>



<h3 class="wp-block-heading">Voorbeeld in Python:</h3>



<pre class="wp-block-code"><code># Definieer een functie om herhaling te voorkomen
def calculate_area(width, height):
    return width * height

area1 = calculate_area(5, 10)
area2 = calculate_area(7, 3)</code></pre>



<h2 class="wp-block-heading">10. KISS (Keep It Simple, Stupid)</h2>



<p class="wp-block-paragraph">Houd uw code zo eenvoudig mogelijk. Complexe oplossingen zijn vaak moeilijker te onderhouden en te debuggen. Door uw code simpel te houden, minimaliseer u de kans op fouten.</p>



<h3 class="wp-block-heading">Voorbeeld in PHP:</h3>



<pre class="wp-block-code"><code>// Een eenvoudige berekening zonder onnodige complexiteit
function add($a, $b) {
    return $a + $b;
}
echo add(5, 10);</code></pre>



<h3 class="wp-block-heading">Voorbeeld in JavaScript:</h3>



<pre class="wp-block-code"><code>// Een eenvoudige berekening zonder onnodige complexiteit
function add(a, b) {
    return a + b;
}
console.log(add(5, 10));</code></pre>



<h3 class="wp-block-heading">Voorbeeld in Python:</h3>



<pre class="wp-block-code"><code># Een eenvoudige berekening zonder onnodige complexiteit
def add(a, b):
    return a + b

print(add(5, 10))</code></pre>



<h2 class="wp-block-heading">11. YAGNI (You Aren't Gonna Need It)</h2>



<p class="wp-block-paragraph">Voeg alleen functionaliteit toe die op dit moment nodig is. Het anticiperen op toekomstige behoeften kan leiden tot onnodige complexiteit en bloat in uw code.</p>



<h3 class="wp-block-heading">Voorbeeld in PHP:</h3>



<pre class="wp-block-code"><code>// Voeg geen onnodige functies toe
function multiply($a, $b) {
    return $a * $b;
}
echo multiply(5, 10);</code></pre>



<pre class="wp-block-code"><code>// Voeg geen onnodige functies toe
function multiply(a, b) {
    return a * b;
}
console.log(multiply(5, 10));</code></pre>



<h3 class="wp-block-heading">Voorbeeld in Python:</h3>



<pre class="wp-block-code"><code># Voeg geen onnodige functies toe
def multiply(a, b):
    return a * b

print(multiply(5, 10))</code></pre>



<h2 class="wp-block-heading">12. Documentatie</h2>



<p class="wp-block-paragraph">Zorg ervoor dat uw code goed gedocumenteerd is, zodat anderen (of jijzelf in de toekomst) het gemakkelijk kunnen begrijpen. Dit omvat niet alleen commentaar in de code, maar ook duidelijke README-bestanden en architectuurnotities.</p>



<h3 class="wp-block-heading">Voorbeeld in PHP:</h3>



<pre class="wp-block-code"><code>// Bereken het oppervlakte van een rechthoek
function calculateArea($width, $height) {
    return $width * $height;
}

// Gebruiksvoorbeelden
$area = calculateArea(5, 10);
echo $area;  // Output: 50</code></pre>



<h3 class="wp-block-heading">Voorbeeld in JavaScript:</h3>



<pre class="wp-block-code"><code>// Bereken het oppervlakte van een rechthoek
function calculateArea(width, height) {
    return width * height;
}

// Gebruiksvoorbeelden
let area = calculateArea(5, 10);
console.log(area);  // Output: 50</code></pre>



<h3 class="wp-block-heading">Voorbeeld in Python:</h3>



<pre class="wp-block-code"><code># Bereken het oppervlakte van een rechthoek
def calculate_area(width, height):
    return width * height

# Gebruiksvoorbeelden
area = calculate_area(5, 10)
print(area)  # Output: 50</code></pre>



<h2 class="wp-block-heading">13. Efficiëntie en Schaalbaarheid</h2>



<p class="wp-block-paragraph">Code moet niet alleen functioneel zijn, maar ook efficiënt en schaalbaar. Dit omvat het vermijden van onnodige loops, optimaliseren van geheugenbeheer, en het gebruik van technieken zoals profilering om prestatieknelpunten te identificeren.</p>



<h3 class="wp-block-heading">Voorbeeld in PHP:</h3>



<pre class="wp-block-code"><code>// Gebruik van een efficiënte loop
$numbers = range(1, 100);
$sum = array_sum($numbers);
echo $sum;  // Output: 5050</code></pre>



<h3 class="wp-block-heading">Voorbeeld in JavaScript:</h3>



<pre class="wp-block-code"><code>// Gebruik van een efficiënte loop
let numbers = Array.from({length: 100}, (_, i) =&gt; i + 1);
let sum = numbers.reduce((acc, curr) =&gt; acc + curr, 0);
console.log(sum);  // Output: 5050</code></pre>



<h3 class="wp-block-heading">Voorbeeld in Python:</h3>



<pre class="wp-block-code"><code># Gebruik van een efficiënte loop
numbers = range(1, 101)
sum = sum(numbers)
print(sum)  # Output: 5050</code></pre>



<p class="wp-block-paragraph"></p>
<p>Het bericht <a href="https://www.utilewebsites.nl/en/knowledgebase/belangrijkste-programmeerprincipes-en-voorbeelden/">Belangrijkste Programmeerprincipes en Voorbeelden</a> verscheen eerst op <a href="https://www.utilewebsites.nl/en/">Utilewebsites</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Belangrijkste Programmeerprincipes en Voorbeelden</title>
		<link>https://www.utilewebsites.nl/en/knowledgebase/belangrijkste-programmeerprincipes-en-voorbeelden/</link>
		
		<dc:creator><![CDATA[UtileWebsites]]></dc:creator>
		<pubDate>Thu, 29 Aug 2024 07:10:33 +0000</pubDate>
				<guid isPermaLink="false">https://www.utilewebsites.nl/knowledgebase/belangrijkste-programmeerprincipes-en-voorbeelden/</guid>

					<description><![CDATA[<p>Welkom bij deze gids waarin we enkele fundamentele programmeerprincipes verkennen, ondersteund met duidelijke voorbeelden in PHP, JavaScript en Python. Of u nu een beginner bent of uw kennis wilt opfrissen, deze gids helpt u om essentiële concepten beter te begrijpen. Tip: Codevoorbeelden in dit artikel kunnen interactief worden uitgevoerd in uw favoriete code-editor. Experimenteer met de code om te zien hoe deze werkt! 1. Variabelen en Datatypen Een variabele is een naam die verwijst naar een locatie in het geheugen waar een waarde is opgeslagen. Datatypen bepalen wat voor soort waarde een variabele kan bevatten, zoals integers, strings, en booleans. Voorbeeld&#160;<a href="https://www.utilewebsites.nl/en/knowledgebase/belangrijkste-programmeerprincipes-en-voorbeelden/" class="read-more">Continue Reading</a></p>
<p>Het bericht <a href="https://www.utilewebsites.nl/en/knowledgebase/belangrijkste-programmeerprincipes-en-voorbeelden/">Belangrijkste Programmeerprincipes en Voorbeelden</a> verscheen eerst op <a href="https://www.utilewebsites.nl/en/">Utilewebsites</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Welkom bij deze gids waarin we enkele fundamentele programmeerprincipes verkennen, ondersteund met duidelijke voorbeelden in PHP, JavaScript en Python. Of u nu een beginner bent of uw kennis wilt opfrissen, deze gids helpt u om essentiële concepten beter te begrijpen.</p>



<p class="wp-block-paragraph"><strong>Tip:</strong> Codevoorbeelden in dit artikel kunnen interactief worden uitgevoerd in uw favoriete code-editor. Experimenteer met de code om te zien hoe deze werkt!</p>



<h2 class="wp-block-heading">1. Variabelen en Datatypen</h2>



<p class="wp-block-paragraph">Een variabele is een naam die verwijst naar een locatie in het geheugen waar een waarde is opgeslagen. Datatypen bepalen wat voor soort waarde een variabele kan bevatten, zoals integers, strings, en booleans.</p>



<h3 class="wp-block-heading">Voorbeeld in PHP:</h3>



<pre class="wp-block-code"><code>$age = 25;  // Integer
$name = "John";  // String
$isStudent = true;  // Boolean</code></pre>



<h3 class="wp-block-heading">Voorbeeld in JavaScript:</h3>



<pre class="wp-block-code"><code>let age = 25;  // Integer
let name = "John";  // String
let isStudent = true;  // Boolean</code></pre>



<h3 class="wp-block-heading">Voorbeeld in Python:</h3>



<pre class="wp-block-code"><code>age = 25  # Integer
name = "John"  # String
is_student = True  # Boolean</code></pre>



<h2 class="wp-block-heading">2. Control Flow (If-Else, Loops)</h2>



<p class="wp-block-paragraph">Control flow statements bepalen de volgorde waarin de code wordt uitgevoerd. Dit maakt het mogelijk om beslissingen te nemen (if-else) en herhaalde acties uit te voeren (loops).</p>



<h3 class="wp-block-heading">Voorbeeld in PHP:</h3>



<pre class="wp-block-code"><code>$score = 85;
if ($score &gt;= 90) {
    echo "A";
} elseif ($score &gt;= 80) {
    echo "B";
} else {
    echo "C";
}</code></pre>



<h3 class="wp-block-heading">Voorbeeld in JavaScript:</h3>



<pre class="wp-block-code"><code>let score = 85;
if (score &gt;= 90) {
    console.log("A");
} else if (score &gt;= 80) {
    console.log("B");
} else {
    console.log("C");
}</code></pre>



<h3 class="wp-block-heading">Voorbeeld in Python:</h3>



<pre class="wp-block-code"><code>score = 85
if score &gt;= 90:
    print("A")
elif score &gt;= 80:
    print("B")
else:
    print("C")</code></pre>



<h2 class="wp-block-heading">3. Functies</h2>



<p class="wp-block-paragraph">Functies zijn blokken van herbruikbare code die kunnen worden aangeroepen met een naam. Ze helpen bij het organiseren van code en vermijden duplicatie.</p>



<h3 class="wp-block-heading">Voorbeeld in PHP:</h3>



<pre class="wp-block-code"><code>function greet($name) {
    return "Hello, " . $name;
}
echo greet("Alice");  // Output: Hello, Alice</code></pre>



<h3 class="wp-block-heading">Voorbeeld in JavaScript:</h3>



<pre class="wp-block-code"><code>function greet(name) {
    return "Hello, " + name;
}
console.log(greet("Alice"));  // Output: Hello, Alice</code></pre>



<h3 class="wp-block-heading">Voorbeeld in Python:</h3>



<pre class="wp-block-code"><code>def greet(name):
    return "Hello, " + name

print(greet("Alice"))  # Output: Hello, Alice</code></pre>



<h2 class="wp-block-heading">4. Arrays en Lijsten</h2>



<p class="wp-block-paragraph">Arrays en lijsten zijn verzamelingen van waarden die kunnen worden benaderd via indexen. Ze zijn handig om meerdere gegevens in één variabele op te slaan.</p>



<h3 class="wp-block-heading">Voorbeeld in PHP:</h3>



<pre class="wp-block-code"><code>$fruits = array("Apple", "Banana", "Cherry");
echo $fruits&#91;1];  // Output: Banana</code></pre>



<h3 class="wp-block-heading">Voorbeeld in JavaScript:</h3>



<pre class="wp-block-code"><code>let fruits = &#91;"Apple", "Banana", "Cherry"];
console.log(fruits&#91;1]);  // Output: Banana</code></pre>



<h3 class="wp-block-heading">Voorbeeld in Python:</h3>



<pre class="wp-block-code"><code>fruits = &#91;"Apple", "Banana", "Cherry"]
print(fruits&#91;1])  # Output: Banana</code></pre>



<h2 class="wp-block-heading">5. Objectgeoriënteerd Programmeren (OOP)</h2>



<p class="wp-block-paragraph">OOP is een programmeerparadigma gebaseerd op het concept van "objecten", die data (attributen) en functies (methoden) bundelen. Het helpt bij het structureren van complexe programma's.</p>



<h3 class="wp-block-heading">Voorbeeld in PHP:</h3>



<pre class="wp-block-code"><code>class Car {
    public $color;
    public function __construct($color) {
        $this-&gt;color = $color;
    }
    public function honk() {
        return "Beep!";
    }
}
$myCar = new Car("red");
echo $myCar-&gt;honk();  // Output: Beep!</code></pre>



<h3 class="wp-block-heading">Voorbeeld in JavaScript:</h3>



<pre class="wp-block-code"><code>class Car {
    constructor(color) {
        this.color = color;
    }
    honk() {
        return "Beep!";
    }
}
let myCar = new Car("red");
console.log(myCar.honk());  // Output: Beep!</code></pre>



<h3 class="wp-block-heading">Voorbeeld in Python:</h3>



<pre class="wp-block-code"><code>class Car:
    def __init__(self, color):
        self.color = color
    
    def honk(self):
        return "Beep!"

my_car = Car("red")
print(my_car.honk())  # Output: Beep!</code></pre>



<h2 class="wp-block-heading">6. Modulariteit</h2>



<p class="wp-block-paragraph">Modulariteit gaat over het opdelen van een programma in kleinere, zelfstandige onderdelen (modules). Dit bevordert hergebruik en maakt de code makkelijker te begrijpen en te onderhouden.</p>



<h3 class="wp-block-heading">Voorbeeld in PHP:</h3>



<pre class="wp-block-code"><code>// math_functions.php
function add($a, $b) {
    return $a + $b;
}

// main.php
include 'math_functions.php';
echo add(5, 10);  // Output: 15</code></pre>



<h3 class="wp-block-heading">Voorbeeld in JavaScript:</h3>



<pre class="wp-block-code"><code>// mathFunctions.js
export function add(a, b) {
    return a + b;
}

// main.js
import { add } from './mathFunctions.js';
console.log(add(5, 10));  // Output: 15</code></pre>



<h3 class="wp-block-heading">Voorbeeld in Python:</h3>



<pre class="wp-block-code"><code># math_functions.py
def add(a, b):
    return a + b

# main.py
from math_functions import add
print(add(5, 10))  # Output: 15</code></pre>



<h2 class="wp-block-heading">7. Debugging en Foutenafhandeling</h2>



<p class="wp-block-paragraph">Debugging is het proces van het identificeren en oplossen van fouten in de code. Foutenafhandeling zorgt ervoor dat uw programma op een gecontroleerde manier met fouten omgaat.</p>



<h3 class="wp-block-heading">Voorbeeld in PHP:</h3>



<pre class="wp-block-code"><code>try {
    $result = 10 / 0;
} catch (Exception $e) {
    echo "Caught exception: " . $e-&gt;getMessage();
}</code></pre>



<h3 class="wp-block-heading">Voorbeeld in JavaScript:</h3>



<pre class="wp-block-code"><code>try {
    let result = 10 / 0;
} catch (e) {
    console.log("Caught exception: " + e.message);
}</code></pre>



<h3 class="wp-block-heading">Voorbeeld in Python:</h3>



<pre class="wp-block-code"><code>try:
    result = 10 / 0
except Exception as e:
    print("Caught exception:", str(e))</code></pre>



<h2 class="wp-block-heading">8. Recursie</h2>



<p class="wp-block-paragraph">Recursie is een programmeertechniek waarbij een functie zichzelf aanroept. Het wordt vaak gebruikt voor het oplossen van problemen die kunnen worden opgedeeld in kleinere, vergelijkbare problemen.</p>



<h3 class="wp-block-heading">Voorbeeld in PHP:</h3>



<pre class="wp-block-code"><code>function factorial($n) {
    if ($n === 0) {
        return 1;
    } else {
        return $n * factorial($n - 1);
    }
}
echo factorial(5);  // Output: 120</code></pre>



<h3 class="wp-block-heading">Voorbeeld in JavaScript:</h3>



<pre class="wp-block-code"><code>function factorial(n) {
    if (n === 0) {
        return 1;
    } else {
        return n * factorial(n - 1);
    }
}
console.log(factorial(5));  // Output: 120</code></pre>



<h3 class="wp-block-heading">Voorbeeld in Python:</h3>



<pre class="wp-block-code"><code>def factorial(n):
    if n == 0:
        return 1
    else:
        return n * factorial(n - 1)

print(factorial(5))  # Output: 120</code></pre>



<h2 class="wp-block-heading">9. DRY (Don't Repeat Yourself)</h2>



<p class="wp-block-paragraph">Dit principe benadrukt het belang van het vermijden van duplicatie in uw code. Herhaal geen logica; gebruik in plaats daarvan functies of modules om code herbruikbaar te maken.</p>



<h3 class="wp-block-heading">Voorbeeld in PHP:</h3>



<pre class="wp-block-code"><code>// Definieer een functie om herhaling te voorkomen
function calculateArea($width, $height) {
    return $width * $height;
}

$area1 = calculateArea(5, 10);
$area2 = calculateArea(7, 3);</code></pre>



<h3 class="wp-block-heading">Voorbeeld in JavaScript:</h3>



<pre class="wp-block-code"><code>// Definieer een functie om herhaling te voorkomen
function calculateArea(width, height) {
    return width * height;
}

let area1 = calculateArea(5, 10);
let area2 = calculateArea(7, 3);</code></pre>



<h3 class="wp-block-heading">Voorbeeld in Python:</h3>



<pre class="wp-block-code"><code># Definieer een functie om herhaling te voorkomen
def calculate_area(width, height):
    return width * height

area1 = calculate_area(5, 10)
area2 = calculate_area(7, 3)</code></pre>



<h2 class="wp-block-heading">10. KISS (Keep It Simple, Stupid)</h2>



<p class="wp-block-paragraph">Houd uw code zo eenvoudig mogelijk. Complexe oplossingen zijn vaak moeilijker te onderhouden en te debuggen. Door uw code simpel te houden, minimaliseer u de kans op fouten.</p>



<h3 class="wp-block-heading">Voorbeeld in PHP:</h3>



<pre class="wp-block-code"><code>// Een eenvoudige berekening zonder onnodige complexiteit
function add($a, $b) {
    return $a + $b;
}
echo add(5, 10);</code></pre>



<h3 class="wp-block-heading">Voorbeeld in JavaScript:</h3>



<pre class="wp-block-code"><code>// Een eenvoudige berekening zonder onnodige complexiteit
function add(a, b) {
    return a + b;
}
console.log(add(5, 10));</code></pre>



<h3 class="wp-block-heading">Voorbeeld in Python:</h3>



<pre class="wp-block-code"><code># Een eenvoudige berekening zonder onnodige complexiteit
def add(a, b):
    return a + b

print(add(5, 10))</code></pre>



<h2 class="wp-block-heading">11. YAGNI (You Aren't Gonna Need It)</h2>



<p class="wp-block-paragraph">Voeg alleen functionaliteit toe die op dit moment nodig is. Het anticiperen op toekomstige behoeften kan leiden tot onnodige complexiteit en bloat in uw code.</p>



<h3 class="wp-block-heading">Voorbeeld in PHP:</h3>



<pre class="wp-block-code"><code>// Voeg geen onnodige functies toe
function multiply($a, $b) {
    return $a * $b;
}
echo multiply(5, 10);</code></pre>



<pre class="wp-block-code"><code>// Voeg geen onnodige functies toe
function multiply(a, b) {
    return a * b;
}
console.log(multiply(5, 10));</code></pre>



<h3 class="wp-block-heading">Voorbeeld in Python:</h3>



<pre class="wp-block-code"><code># Voeg geen onnodige functies toe
def multiply(a, b):
    return a * b

print(multiply(5, 10))</code></pre>



<h2 class="wp-block-heading">12. Documentatie</h2>



<p class="wp-block-paragraph">Zorg ervoor dat uw code goed gedocumenteerd is, zodat anderen (of jijzelf in de toekomst) het gemakkelijk kunnen begrijpen. Dit omvat niet alleen commentaar in de code, maar ook duidelijke README-bestanden en architectuurnotities.</p>



<h3 class="wp-block-heading">Voorbeeld in PHP:</h3>



<pre class="wp-block-code"><code>// Bereken het oppervlakte van een rechthoek
function calculateArea($width, $height) {
    return $width * $height;
}

// Gebruiksvoorbeelden
$area = calculateArea(5, 10);
echo $area;  // Output: 50</code></pre>



<h3 class="wp-block-heading">Voorbeeld in JavaScript:</h3>



<pre class="wp-block-code"><code>// Bereken het oppervlakte van een rechthoek
function calculateArea(width, height) {
    return width * height;
}

// Gebruiksvoorbeelden
let area = calculateArea(5, 10);
console.log(area);  // Output: 50</code></pre>



<h3 class="wp-block-heading">Voorbeeld in Python:</h3>



<pre class="wp-block-code"><code># Bereken het oppervlakte van een rechthoek
def calculate_area(width, height):
    return width * height

# Gebruiksvoorbeelden
area = calculate_area(5, 10)
print(area)  # Output: 50</code></pre>



<h2 class="wp-block-heading">13. Efficiëntie en Schaalbaarheid</h2>



<p class="wp-block-paragraph">Code moet niet alleen functioneel zijn, maar ook efficiënt en schaalbaar. Dit omvat het vermijden van onnodige loops, optimaliseren van geheugenbeheer, en het gebruik van technieken zoals profilering om prestatieknelpunten te identificeren.</p>



<h3 class="wp-block-heading">Voorbeeld in PHP:</h3>



<pre class="wp-block-code"><code>// Gebruik van een efficiënte loop
$numbers = range(1, 100);
$sum = array_sum($numbers);
echo $sum;  // Output: 5050</code></pre>



<h3 class="wp-block-heading">Voorbeeld in JavaScript:</h3>



<pre class="wp-block-code"><code>// Gebruik van een efficiënte loop
let numbers = Array.from({length: 100}, (_, i) =&gt; i + 1);
let sum = numbers.reduce((acc, curr) =&gt; acc + curr, 0);
console.log(sum);  // Output: 5050</code></pre>



<h3 class="wp-block-heading">Voorbeeld in Python:</h3>



<pre class="wp-block-code"><code># Gebruik van een efficiënte loop
numbers = range(1, 101)
sum = sum(numbers)
print(sum)  # Output: 5050</code></pre>



<p class="wp-block-paragraph"></p>
<p>Het bericht <a href="https://www.utilewebsites.nl/en/knowledgebase/belangrijkste-programmeerprincipes-en-voorbeelden/">Belangrijkste Programmeerprincipes en Voorbeelden</a> verscheen eerst op <a href="https://www.utilewebsites.nl/en/">Utilewebsites</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
