<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6624912763716461955</id><updated>2024-10-09T06:01:34.310-07:00</updated><category term="c"/><category term="c#"/><category term="crafty"/><category term="javascript"/><category term="pygame"/><category term="python"/><category term="xna"/><title type='text'>manifest code</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://manifestcode.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6624912763716461955/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://manifestcode.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>olladitan 2</name><uri>http://www.blogger.com/profile/06950117631390540553</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6624912763716461955.post-4379739035256119985</id><published>2012-08-19T19:17:00.000-07:00</published><updated>2014-11-22T04:40:39.031-08:00</updated><title type='text'>mysql : connecting to mysql database from windows command shell</title><content type='html'>in this code i connect to a mysql database using the command shell and xamp virtual server. 

Once i have xamp and the path to mysql.exe in my system path I can use: 

&lt;br /&gt;
&lt;pre class=&quot;brush:c&quot;&gt;mysql -h localhost -u oladitan
&lt;/pre&gt;
to connect my localhost database with the user name &quot;oladitan&quot;. From here I can perform various operations including database selection and querying.</content><link rel='replies' type='application/atom+xml' href='http://manifestcode.blogspot.com/feeds/4379739035256119985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://manifestcode.blogspot.com/2012/08/mysql-connecting-to-mysql-database-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6624912763716461955/posts/default/4379739035256119985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6624912763716461955/posts/default/4379739035256119985'/><link rel='alternate' type='text/html' href='http://manifestcode.blogspot.com/2012/08/mysql-connecting-to-mysql-database-from.html' title='mysql : connecting to mysql database from windows command shell'/><author><name>olladitan 2</name><uri>http://www.blogger.com/profile/06950117631390540553</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6624912763716461955.post-818776659877486567</id><published>2012-08-14T00:02:00.003-07:00</published><updated>2012-08-14T19:27:31.739-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="crafty"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><title type='text'>javascript : Crafty : sprite movement with keyboard input</title><content type='html'>&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;http://www.youtube.com/embed/qrujpBbmbIs&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;


&lt;h2&gt;index.html&lt;/h2&gt;
&lt;pre class=&quot;brush: html&quot;&gt;
&lt;!DOCTYPE HTML&gt;
&lt;html&gt;
&lt;head&gt;
 &lt;script type=&quot;application/javascript&quot; src =&quot;js/crafty.js&quot;&gt;&lt;/script&gt;
 &lt;script type =&quot;application/javascript&quot; src = &quot;js/craftyKeyInput.js&quot;&gt;&lt;/script&gt;
 &lt;title&gt;My Crafty Game&lt;/title&gt;
 &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;css/style1.css&quot;&gt;
&lt;/head&gt;
&lt;body onload=&quot;main()&quot;&gt;
&lt;/body&gt;
&lt;/html&gt;

&lt;/pre&gt;




&lt;h2&gt;craftyKeyInput.js&lt;/h2&gt;
&lt;pre class=&quot;brush:js&quot;&gt;
function main() {
 
    //start crafty
    Crafty.init(512, 512);
    //Crafty.canvas();

    //prepare the spritesheet for game use
    Crafty.sprite(64, &quot;images/spriteSheet.png&quot;, {
        player: [0, 0]
    });

    //loading screen that displays while assets are being loaded
    Crafty.scene(&quot;loading&quot;, function () {
        Crafty.load([&quot;images/spriteSheet.png&quot;], function () {
            Crafty.scene(&quot;main&quot;);
        });

        //white background with some loading text
        Crafty.background(&quot;#FFF&quot;);
        Crafty.e(&quot;2D, DOM, Text&quot;).attr({ w: 100, h: 20, x: 150, y: 120 })
                .text(&quot;Loading&quot;)
                .css({ &quot;text-align&quot;: &quot;center&quot; });
    });

    //automatically play the loading scene
    Crafty.scene(&quot;loading&quot;);  
    
    //
    Crafty.c(&#39;Ball&#39;, {
        Ball: function() {
                //setup animations
                this.requires(&quot;SpriteAnimation&quot;)
                .animate(&quot;walk_left&quot;, 1,0,1)
                .animate(&quot;walk_right&quot;, 0,0,0)
                .animate(&quot;walk_up&quot;, 2,0,2)
                .animate(&quot;walk_down&quot;, 3,0,3)
                //change direction when a direction change event is received
                .bind(&quot;NewDirection&quot;,
                    function (direction) {
                        if (direction.x &lt; 0) {
                            if (!this.isPlaying(&quot;walk_left&quot;))
                                this.stop().animate(&quot;walk_left&quot;, 10, -1);
                        }
                        if (direction.x &gt; 0) {
                            if (!this.isPlaying(&quot;walk_right&quot;))
                                this.stop().animate(&quot;walk_right&quot;, 10, -1);
                        }
                        if (direction.y &lt; 0) {
                            if (!this.isPlaying(&quot;walk_up&quot;))
                                this.stop().animate(&quot;walk_up&quot;, 10, -1);
                        }
                        if (direction.y &gt; 0) {
                            if (!this.isPlaying(&quot;walk_down&quot;))
                                this.stop().animate(&quot;walk_down&quot;, 10, -1);
                        }
                        if(!direction.x &amp;&amp; !direction.y) {
                            this.stop();
                        }
                })
            return this;
        }
    });
    
    Crafty.c(&quot;LeftControls&quot;, {
        init: function() {
            this.requires(&#39;Multiway&#39;);
        },
        
        leftControls: function(speed) {
            this.multiway(speed, {W: -90, S: 90, D: 0, A: 180})
            return this;
        }
        
    });

    Crafty.scene(&quot;main&quot;, function () {
        generateWorld();
        
        //create our player entity with some premade components
        var player1 = Crafty.e(&quot;2D, DOM, Ball, player, LeftControls&quot;)
                .attr({ x: 256, y: 256, z: 1 })
                .leftControls(1)
                .Ball();
    });
};
&lt;/pre&gt;


&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnLiqKRRGVugsBYLBjsuvsvxEZek0us9JexrEINi33CjvkXEtjVoS-qAZRvS6vBkJosws5TP938AdibH9xmBGw__yiCFroHki1n_0IWppg6ux8Qq1_HX8xlTZacQvanKKLxgcP8hNiujE/s1600/spriteSheet.png&quot; imageanchor=&quot;1&quot; style=&quot;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;64&quot; width=&quot;256&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnLiqKRRGVugsBYLBjsuvsvxEZek0us9JexrEINi33CjvkXEtjVoS-qAZRvS6vBkJosws5TP938AdibH9xmBGw__yiCFroHki1n_0IWppg6ux8Qq1_HX8xlTZacQvanKKLxgcP8hNiujE/s320/spriteSheet.png&quot; /&gt;&lt;/a&gt;



&lt;h2&gt;style.css&lt;/h2&gt;
&lt;pre class=&quot;brush:css&quot;&gt;
body, html {
 margin:0;
 padding: 0;
 overflow: hidden;
 font-family:Arial;
 font-size:20px;
}

#cr-stage{
 border:2px solid black;
 margin:5px auto;
 color:white
}

&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://manifestcode.blogspot.com/feeds/818776659877486567/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://manifestcode.blogspot.com/2012/08/javascript-crafty-sprite-movement-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6624912763716461955/posts/default/818776659877486567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6624912763716461955/posts/default/818776659877486567'/><link rel='alternate' type='text/html' href='http://manifestcode.blogspot.com/2012/08/javascript-crafty-sprite-movement-with.html' title='javascript : Crafty : sprite movement with keyboard input'/><author><name>olladitan 2</name><uri>http://www.blogger.com/profile/06950117631390540553</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/qrujpBbmbIs/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6624912763716461955.post-73128703668764364</id><published>2012-08-08T22:56:00.003-07:00</published><updated>2012-08-09T20:43:46.099-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="pygame"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>python 2.7 : pygame 1.9.1 : animating an image in pygame</title><content type='html'>&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;http://www.youtube.com/embed/OvKQKBhacvQ&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;
This is an example of animating an image using pygame:

&lt;h2&gt;image.py&lt;/h2&gt;
&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush:python&quot;&gt;&lt;![CDATA[ 

import sys, pygame
pygame.init()

size = width, height = 512, 256
speed = [1,1]
white = 255, 255, 255

count = 0

screen = pygame.display.set_mode(size)

logo = pygame.image.load(&quot;logo1.png&quot;)
colorkey = (255,0,255)
logo.set_colorkey(colorkey)
logoRect = logo.get_rect()

while True:
    count+=1
    
    for event in pygame.event.get():
        if event.type == pygame.QUIT: sys.exit()
    
    if count%5==0:
        logoRect = logoRect.move(speed)
        print(count)
    else:
        logoRect = logoRect.move((0,0))
        
    if logoRect.left &lt; 0 or logoRect.right&gt;width:
        speed[0] = -speed[0]
    if logoRect.top &lt; 0 or logoRect.bottom&gt; height:
        speed[1] = -speed[1]
        
    screen.fill(white)
    screen.blit(logo, logoRect)
    pygame.display.flip()

]]&gt;&lt;/script&gt;
&lt;br&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizzdrLXFYRic8tr5yg5bK2T7JN_dAyQ21T2HRAgCX6HSaCtd-kVBTJO7M9Q-efmMni6LPIsYf_D5pV4JfI5v-n2Ock3z1AXHIv-sR7VOdFsmfapgX9O88yLA_LEorZiZ7JT9zOcWbzgRo/s1600/logo1.png&quot; imageanchor=&quot;1&quot; style=&quot;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;22&quot; width=&quot;222&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizzdrLXFYRic8tr5yg5bK2T7JN_dAyQ21T2HRAgCX6HSaCtd-kVBTJO7M9Q-efmMni6LPIsYf_D5pV4JfI5v-n2Ock3z1AXHIv-sR7VOdFsmfapgX9O88yLA_LEorZiZ7JT9zOcWbzgRo/s320/logo1.png&quot; /&gt;&lt;/a&gt;


&lt;br&gt;

Theese lines import the sys and pygame modules if you have python and the compatible pygame installed:
&lt;br&gt;
&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush:python; first-line:1&quot;&gt;&lt;![CDATA[
import sys, pygame
pygame.init()
]]&gt;&lt;/script&gt;
&lt;br&gt;

The following lines of code initializes curicial game variables and set prefferences for our loaded images such as replacing a specified color with zero opacity:
&lt;br&gt;
&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush:python; first-line:4&quot;&gt;&lt;![CDATA[
size = width, height = 512, 256
speed = [1,1]
white = 255, 255, 255

count = 0

screen = pygame.display.set_mode(size)

logo = pygame.image.load(&quot;logo1.png&quot;)
colorkey = (255,0,255)
logo.set_colorkey(colorkey)
logoRect = logo.get_rect()
]]&gt;&lt;/script&gt;
&lt;br&gt;
the main loop of the game handles animation and refreshing the screen:
&lt;br&gt;
&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush:python; first-line:17&quot;&gt;&lt;![CDATA[

while True:
    count+=1
    
    for event in pygame.event.get():
        if event.type == pygame.QUIT: sys.exit()
    
    if count%5==0:
        logoRect = logoRect.move(speed)
        print(count)
    else:
        logoRect = logoRect.move((0,0))
        
    if logoRect.left &lt; 0 or logoRect.right&gt;width:
        speed[0] = -speed[0]
    if logoRect.top &lt; 0 or logoRect.bottom&gt; height:
        speed[1] = -speed[1]
        
    screen.fill(white)
    screen.blit(logo, logoRect)
    pygame.display.flip() 
]]&gt;&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://manifestcode.blogspot.com/feeds/73128703668764364/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://manifestcode.blogspot.com/2012/08/python-27-pygame-191-animating-image-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6624912763716461955/posts/default/73128703668764364'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6624912763716461955/posts/default/73128703668764364'/><link rel='alternate' type='text/html' href='http://manifestcode.blogspot.com/2012/08/python-27-pygame-191-animating-image-in.html' title='python 2.7 : pygame 1.9.1 : animating an image in pygame'/><author><name>olladitan 2</name><uri>http://www.blogger.com/profile/06950117631390540553</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/OvKQKBhacvQ/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6624912763716461955.post-7946392319151864217</id><published>2012-08-07T21:48:00.000-07:00</published><updated>2012-08-09T20:44:12.414-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="xna"/><title type='text'>C# : XNA 4.0: displaying an image to the screen</title><content type='html'>&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;http://www.youtube.com/embed/YweRKu-I4uk&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;
&lt;br&gt;
this code will enable you to display an image using C# XNA 4.0.

&lt;h2&gt;Game1.cs&lt;/h2&gt;
&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush:csharp&quot;&gt;&lt;![CDATA[
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace WindowsGame1
{
    /// &lt;summary&gt;
    /// This is the main type for your game
    /// &lt;/summary&gt;
    public class Game1 : Microsoft.Xna.Framework.Game
    {
        // import your texture image
        Texture2D manifestCodeLogo1;

        GraphicsDeviceManager graphics;
        SpriteBatch spriteBatch;


        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = &quot;Content&quot;;

            //resize the screen dimensions
            graphics.PreferredBackBufferHeight = 512;
            graphics.PreferredBackBufferWidth = 512;
        }

        /// &lt;summary&gt;
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// &lt;/summary&gt;
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            base.Initialize();
        }

        /// &lt;summary&gt;
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// &lt;/summary&gt;
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // load your image
            manifestCodeLogo1 = Content.Load&lt;Texture2D&gt;(@&quot;Images/manifestCodeLogo1&quot;);

            // TODO: use this.Content to load your game content here
        }

        /// &lt;summary&gt;
        /// UnloadContent will be called once per game and is the place to unload
        /// all content.
        /// &lt;/summary&gt;
        protected override void UnloadContent()
        {
            // TODO: Unload any non ContentManager content here
        }

        /// &lt;summary&gt;
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;gameTime&quot;&gt;Provides a snapshot of timing values.&lt;/param&gt;
        protected override void Update(GameTime gameTime)
        {
            // Allows the game to exit
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                this.Exit();

            // TODO: Add your update logic here

            base.Update(gameTime);
        }

        /// &lt;summary&gt;
        /// This is called when the game should draw itself.
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;gameTime&quot;&gt;Provides a snapshot of timing values.&lt;/param&gt;
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.White);

            // TODO: Add your drawing code here
                        
            spriteBatch.Begin();

            // draw you image once
            spriteBatch.Draw(manifestCodeLogo1,
                new Vector2(
                    (Window.ClientBounds.Width/2-manifestCodeLogo1.Width/2),
                    (Window.ClientBounds.Height/2-manifestCodeLogo1.Height/2)),
                Color.White);
            spriteBatch.End();

            base.Draw(gameTime);
        }
    }
}

]]&gt;&lt;/script&gt;

&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidfirH2H9-l0bmuSriBc1Z79sk2vIK-Hx5ASBuSfjTsOvIRBCKIwwFQ3-ZsE2-9uzira8VR3xQpLhxuSGqsh3FwkDPHoltjDk-UOLvTYbrCUORtB-HXptHstuFkH_nkErly5_d7TPfVUI/s1600/manifestCodeLogo1.png&quot; imageanchor=&quot;1&quot; style=&quot;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;40&quot; width=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidfirH2H9-l0bmuSriBc1Z79sk2vIK-Hx5ASBuSfjTsOvIRBCKIwwFQ3-ZsE2-9uzira8VR3xQpLhxuSGqsh3FwkDPHoltjDk-UOLvTYbrCUORtB-HXptHstuFkH_nkErly5_d7TPfVUI/s320/manifestCodeLogo1.png&quot; /&gt;&lt;/a&gt;
&lt;br&gt;

Most of this code is generated by microsoft visual studio when you create your XNA game project in the Game1.cs file. The following includes some code not included in the template that create the final result.
&lt;br&gt;

This line of code creates a Texture2D object named &quot;manifestCodeLogo1&quot; 
&lt;br&gt;
&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush:csharp; first-line:19&quot;&gt;&lt;![CDATA[
// import your texture image
Texture2D manifestCodeLogo1;
]]&gt;&lt;/script&gt;
&lt;br&gt;
These lines of code change the screen resolution of the application. In this case I have chosen to have a 512x512 resolution application.
&lt;br&gt;
&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush:csharp; first-line:31&quot;&gt;&lt;![CDATA[
//resize the screen dimensions
graphics.PreferredBackBufferHeight = 512;
graphics.PreferredBackBufferWidth = 512;
]]&gt;&lt;/script&gt;
&lt;br&gt;
this line of code loads the image from this projects Content Library:
&lt;br&gt;
&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush:csharp; first-line:58&quot;&gt;&lt;![CDATA[
// load your image
manifestCodeLogo1 = Content.Load&lt;Texture2D&gt;(@&quot;Images/manifestCodeLogo1&quot;);
]]&gt;&lt;/script&gt;
&lt;br&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxFuB_n6Ie2DLkPTJ8ICuB9dZQcCjFtcj-LISxZwDRqVoaiaA7yLqn1sQ8XvcTDJy4xp-lIqOZE4tm4MN_zyp5uPapUnAQnubG5aSSAdDaq6S9tYSKytIKb4gqmHGwkf85RDyVC-XdoGI/s1600/solutionExplorer_1.png&quot; imageanchor=&quot;1&quot; style=&quot;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;274&quot; width=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxFuB_n6Ie2DLkPTJ8ICuB9dZQcCjFtcj-LISxZwDRqVoaiaA7yLqn1sQ8XvcTDJy4xp-lIqOZE4tm4MN_zyp5uPapUnAQnubG5aSSAdDaq6S9tYSKytIKb4gqmHGwkf85RDyVC-XdoGI/s320/solutionExplorer_1.png&quot; /&gt;&lt;/a&gt;
&lt;br&gt;
this code is responsible for drawing manifestCodeLogo1 and positioning it in the center of the application window:
&lt;br&gt;
&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush:csharp; first-line:99&quot;&gt;&lt;![CDATA[
  spriteBatch.Begin();

            // draw you image once
            spriteBatch.Draw(manifestCodeLogo1,
                new Vector2(
                    (Window.ClientBounds.Width/2-manifestCodeLogo1.Width/2),
                    (Window.ClientBounds.Height/2-manifestCodeLogo1.Height/2)),
                Color.White);
            spriteBatch.End();
]]&gt;&lt;/script&gt;
&lt;br&gt;</content><link rel='replies' type='application/atom+xml' href='http://manifestcode.blogspot.com/feeds/7946392319151864217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://manifestcode.blogspot.com/2012/08/c-xna-displaying-image-to-screen.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6624912763716461955/posts/default/7946392319151864217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6624912763716461955/posts/default/7946392319151864217'/><link rel='alternate' type='text/html' href='http://manifestcode.blogspot.com/2012/08/c-xna-displaying-image-to-screen.html' title='C# : XNA 4.0: displaying an image to the screen'/><author><name>olladitan 2</name><uri>http://www.blogger.com/profile/06950117631390540553</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/YweRKu-I4uk/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6624912763716461955.post-4646990209497870479</id><published>2012-07-29T21:16:00.001-07:00</published><updated>2012-08-09T20:43:58.453-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="c"/><title type='text'>c programming : Hello World</title><content type='html'>&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;http://www.youtube.com/embed/yI19GAYi6Mk&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;
&lt;/br&gt;
This is an example of a c console application written and compiled using visual studio 2010:
&lt;h2&gt;HelloWorld.c&lt;/h2&gt;
&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush:c&quot;&gt;&lt;![CDATA[
#include &lt;stdio.h&gt;
int main()
{
  printf(&quot;Hello World!&quot;);
  getchar();
  return 0;
}
]]&gt;&lt;/script&gt;
&lt;br&gt;
this program begins with a call to include the header file resource &quot;stdio.h&quot; in order to enable the compiler to comprehend the syntax used.
&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush:c&quot;&gt;&lt;![CDATA[
#include &lt;stdio.h&gt;
]]&gt;&lt;/script&gt;
&lt;br&gt;
the next line of code in this program indicates the begining of the &quot;main&quot; function. every c program needs to have a main function that is automatically the first function called:
&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush:c; first-line:2&quot;&gt;&lt;![CDATA[
int main()
{
]]&gt;&lt;/script&gt;
&lt;br&gt;
line &quot;2&quot; also indicates that this function will return an integer value.
the open and closed parentheses with nothing between them indicates that this function does not require values called &quot;arguments&quot; to be initialized. The curly brace on line &quot;3&quot; indicates the beginning of the function body.
&lt;br&gt;
the following code prints user defined text to the system console, and then waits for the user to enter a key before exiting:
&lt;br&gt;
&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush:c; first-line:4&quot;&gt;&lt;![CDATA[ 
  printf(&quot;Hello World!&quot;);
  getchar();
  return 0;
}
]]&gt;&lt;/script&gt;
&lt;br&gt;
because this function returns an integer value, line &quot;6&quot; is necessary to satisfy that requirement by returning an integer value of &quot;0&quot;.</content><link rel='replies' type='application/atom+xml' href='http://manifestcode.blogspot.com/feeds/4646990209497870479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://manifestcode.blogspot.com/2012/07/c-programming-hello-world.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6624912763716461955/posts/default/4646990209497870479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6624912763716461955/posts/default/4646990209497870479'/><link rel='alternate' type='text/html' href='http://manifestcode.blogspot.com/2012/07/c-programming-hello-world.html' title='c programming : Hello World'/><author><name>olladitan 2</name><uri>http://www.blogger.com/profile/06950117631390540553</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/yI19GAYi6Mk/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry></feed>