Rectangle 27 1

I start with the 'Hello World!', once I get that displaying in my browser I throw a phpinfo(); in there and you can see all of the things. Tells you which configurations are loaded, everything.

<?php
   echo 'Hello World!';

   phpinfo();

osx - Where is PHP.ini in Mac OS X Lion? Thought it was in /usr/local/...

osx php
Rectangle 27 1

YES it does, I created the base project then I right clicked on the project name and added a webservice file with the demo of hello world in it. If you view that file in the browser it works fine.

c# - Do standard webservices (asmx) work with MVC? - Stack Overflow

c# asp.net-mvc web-services asmx
Rectangle 27 0

Welcome to PHP [Hello World and intro]

<?php

/*

  Welcome to PHP

  I've created this document as a crash course.  This website, runnable.com is a great place
  for you to play with PHP without having to install anything on your local machine.

  Each section of this document will be separated by a horizontal line of stars.

  PHP is one of the most commonly used languages for web application development.  There is a
  large PHP community and thousands of resources online full of code examples and discussions.

  The PHP.NET website will be your source for any help on particular PHP functions.

  A simple google search like 'php foreach' will get you to the page on php.net where you will
  find help on how the foreach loop is used, with discussions and examples.

  http://php.net/manual/en/langref.php

*/



/************************************************************************************************
  BASIC SYNTAX
  http://php.net/manual/en/language.basic-syntax.phpmode.php
*************************************************************************************************/

  // PHP was written to play nice with HTML.  The two can be combined into a single document,
  //   making it perfect for creating advanced HTML document output.

  ?>
  <h1>Welcome to PHP</h1>
  <p>This is some standard HTML just like in any HTML document.</p>
  <?php

    echo 'This is text rendered by PHP <br>';
    echo 'This is 100 * 25 = ' . ( 100 * 25 );

  ?>
  <p>Now we are back in HTML mode...</p>
  <?php



/************************************************************************************************
  COMMENTS
  http://php.net/manual/en/language.basic-syntax.comments.php
*************************************************************************************************/

  // Comments are lines in code that are not interpreted by the compiler
  // Single line comments are started with a '//' or a '#' and end at the end of the line
  /*
    Comment bounds allow for multi-line comments and start with a '/*'
      and then with a reversed * /
  */

  echo 'Comments can exist on the same line with commands'; /* How Simple! */
  echo '<br>'; // Lets print an HTML <BR> break for readability later



/************************************************************************************************
  INSTRUCTION SEPARATION
  http://php.net/manual/en/language.basic-syntax.instruction-separation.php
*************************************************************************************************/

  /*
    In PHP, all definitions or commands end with a semicolon ';'
    Definitions can take place over multiple lines, and will continue until a semi-colon is found
  */

  echo "This is a string printed by the ECHO function <br>";
  echo "This is also a string printed by the ECHO function existing over multiple lines...
          But it will print on the same line in the browser... <br>";



/************************************************************************************************
  EXPRESSIONS
  http://php.net/manual/en/language.expressions.php
*************************************************************************************************/

  /*
    The basic building block for any application, expressions are logical concepts that can
      be anything from a simple assignment to a complex multi-dimensional operation.
  */

  // Simple expressions
  // Here we are assigning the numeric value 5 to variable $myFirstVar

    $myFirstVar = 5;

  // Encapsulating logic for repeated use later
  // Here we are creating a function named foo() that returns the string 'Bar'

    function foo(){
      return 'Bar';
    }

  // Comparing something, and then performing different actions based on the result.
  // Here we are checking if the result of foo() matches value 'Bar' and printing either "Yes" or "No"

    if( foo() == 'Bar' ){
      echo 'Yes';
    }
    else {
      echo 'No';
    }

  // Using built-in functions to interract with core PHP operations
  // Here we use the DEFINE function to set a CONSTANT for use later.

    define('NEW_LINE', '<BR>');



/************************************************************************************************
  VARIABLES and DATA TYPES
  http://php.net/manual/en/language.types.intro.php
*************************************************************************************************/

  /*

    Variables (or "pseudo-types") are containers for storing data during the execution of a script.

    Variables have a "Scope", meaning that they are only available after being defined and
      from within the same function.

    GLOBAL Variables are variables that have a GLOBAL scope, and should be used sparingly
      to prevent a variable from accidentally overwriting another.

    Variable names are CASE-SENSITIVE.

    A good practice for variable naming is to use a consistent format, like words separated
      with underscores '_', or using CamelCase

    CamelCase is the practice of writing compound words or phrases such that each next word
      or abbreviation begins with a capital letter.
      eg: iPhone, varName, FirstName, Person_FirstName

    Variables all start with a money symbol and can include letters, numbers, and underscore.
      eg: $logVar, $my_variable, $_firstName

    Variable assignment is made using the equal '=' symbol, followed by the value and a semi-colon.

  */

  // STRINGS

    // What is the difference in Single vs Double quote strings?
    // http://stackoverflow.com/questions/3446216/what-is-the-difference-between-single-quoted-and-double-quoted-strings-in-php

    $LiteralString_Value    = 'single quotes';              // Assign a literal string
    $InterpretString_Value  = "double quotes";              // Assign a intepreted string

  // NUMBERS

    $Numeric_Value          = 100;                          // Assign a number
    $NumericFromEval_Value  = (100 * 5);                    // Assign a evaluated result
    $FloatingPoint_Value    = 360.10;                       // Assign a floating-point value

  // BOOLEAN (1 / 0 - TRUE / FALSE)

    $BooleanTrue_Value     = TRUE;                          // Assign a BOOLEAN TRUE value
    $BooleanFalse_Value    = FALSE;                         // Assign a BOOLEAN FALSE value

  // ARRAYS

    // A basic array (or stack) is a lists of values

    $StackArray_Value     = array('David', 'Daniel', 'Katie', 'Kayla');

    // The values of a basic array are referenced using the numeric index, starting at ZERO '0'

    echo $StackArray_Value[1];                              // This will print the second key 'Daniel'
    echo '<br>';

    // A associative array is a set of key => value pairs, separated by a comma ','

    $AssocArray_Values    = array(
                              'Key1'    => 'David',
                              'Key2'    => 'Daniel',
                              'Key3'    => 'Katie',
                              'Key4'    => 'Kayla'
                              );

    // The values of an associative array are reference using the literal key name

    echo $AssocArray_Values['Key3'];                        // This will print the value 'Katie'
    echo '<br>';

    // You can get the keys

  // Objects

    // Objects are dynamic containers that combine storage and function unto packages called 'Classes'
    // We will learn more about classes in the future.  For now we will look at the basic syntax for
    //   creating a new instance of a class, then accessing a property on that object.

    $Object_Value         = new stdClass();                 // stdClass() is a built-in empty class

    // To access properties and methods on an object, we use the rocket '->' identifier

    $Object_Value->MyName = "David";                        // This assigns "David" to the property "MyName"
    echo $Object_Value->MyName;                             // This pulls the "MyName" proerty value to be printed by echo
    echo '<br>';



/************************************************************************************************
  CONSTANTS
  http://php.net/manual/en/language.constants.php
*************************************************************************************************/

  /*
    Constants are like special variables that can only be defined once and cannot be changed.
    Constants are commonly written in ALL CAPS to help easily identify them within your code.
  */

  // Here we define a constant

    define('MY_CONSTANT', 'Yabba dabba doo');

  // Here we echo the value of our constant.
  // Notice that the constant does have a money symbol prefix like variables do

    echo MY_CONSTANT;
    echo '<br>';

  // If we want to check whether a constant exists, we use the DEFINED function.

    if( defined('MY_CONSTANT') ){
      echo "MY_CONSTANT is defined...";
      echo '<br>';
    }

  // Now that we undestand CONSTANTS, we will use the NEW_LINE constant we created earlier.

    echo NEW_LINE;



/************************************************************************************************
  OPERATORS
  http://php.net/manual/en/language.operators.php
*************************************************************************************************/

  /*
    Operators are control characters that take one or more expressions and yeilds a value.
  */

  // (+) Additions

    echo ( 100 + 50 );    // yeilds 150
    echo NEW_LINE;

  // (-) Subtraction

    echo ( 100 - 50 );    // yeilds 50
    echo NEW_LINE;

  // (*) Multiplication

    echo ( 100 * 50 );    // yeilds 5000
    echo NEW_LINE;

  // (/) Division

    echo ( 100 / 50 );    // yeilds 2
    echo NEW_LINE;

  // (%) Modulus

    echo ( 100 % 50 );    // yeild 0 - remainder of 100 / 50
    echo NEW_LINE;

  // (=) Assignment

    $val = 100;           // assign 100 to $val variable
    echo $val;
    echo NEW_LINE;

  // (+=) Addition Assignment

    $val += 10;           // add 10 to the value of $val, then assign the result to $val
    echo $val;
    echo NEW_LINE;

  // (*=) Multiplication Assignment

    $val *= 10;           // multiple the value of $val by 10, then assign the result to $val
    echo $val;
    echo NEW_LINE;

  // (/=) Division Assignment

    $val /= 10;           // divide the value of $val by 10, then assign the result to $val
    echo $val;
    echo NEW_LINE;

  // (%=) Modulis Assignment

    $val %= 10;           // get the remainder from the value of $val divided by 10, then assign the result to $val
    echo $val;
    echo NEW_LINE;

  // (.=) Concatenation Assignment

    $val .= ' total';     // append ' total' to the value of $val, then assign the result to $val
    echo $val;
    echo NEW_LINE;

  // (=&) Reference assignment
  // References allow two variable to control the same data store in memory.
  // Any change made to either variable will affect the value of both variables.
  // Using references for large datasets can help reduce the memory footprint of an script.

    $mirror_val =& $val;  // link the value of $val to the variable $mirror_val
    echo $mirror_val;
    echo NEW_LINE;

    // Now, if we modify the mirror value

      $mirror_val = 100;

    // When we echo $val it will have the same new value

      echo $val;
      echo NEW_LINE;

  // Bitwise operators - used for binary operations, rarely in basic web applications
  // http://php.net/manual/en/language.operators.bitwise.php
  // A basic understanding of how binary translates to numbers / characters can be found here:
  // http://www.codemastershawn.com/library/tutorial/hex.bin.numbers.php

    // Here we assign the numeric value 1 and print the binary representation
    // We then print a line that shows the value and the binary representation

      $binary = 1;
      echo sprintf( '%1$d or %1$08b', $binary );
      echo NEW_LINE;

    // Here we bit-shift the numeric value 1 to the left (same as multiplication by 2)

      $binary = 1;
      $shift  = 1;
      echo sprintf( '%1$d or %1$08b', ($binary << $shift) );
      echo NEW_LINE;

    // Here we bit-shift the numeric value 2 to the left (same as multiplication by 4)

      $binary = 1;
      $shift  = 2;
      echo sprintf( '%1$d or %1$08b', ($binary << $shift) );
      echo NEW_LINE;



/************************************************************************************************
  CONTROL STRUCTURES
  http://php.net/manual/en/language.control-structures.php
*************************************************************************************************/

  /*
    Control structures are the basic, built-in operational statements of PHP (and most
    programming languages) from which the order of operation is defined for the application.
  */



















/************************************************************************************************
  FUNCTIONS
  http://php.net/manual/en/language.types.intro.php
*************************************************************************************************/

  // The number of values in an array can be determined using the count() function

  // echo count($StackArray_Value);                          // This will print '4'
  // echo '<br>';




/************************************************************************************************
  Example Usage
*************************************************************************************************/

?>
<ul>
  <li><a href="form-submission.php">Form Submission</a>
</ul>
PHP Hello World intro
Rectangle 27 0

NodeSchool.io's Express.js course, available in your browser [Node.j...

Brought to you by FreeCodeCamp.com

Start by typing the following into the terminal below and pressing enter:

and choosing the first challenge. It will output the challenge's instructions in your terminal. You may have to scroll to read them all. Modify the code in program.js. Then run your program by typing this into the terminal:

This will show your program's output. If it looks like you expect, type this into the terminal:

You can try this as many times as necessary until you can get your JavaScript to pass. Then type this command:

and select the next challenge. Good luck!

Node.js express.js nodeschool FreeCodeCamp
Rectangle 27 0

This will create a cookie named "foobar" with the value of "Hello, world!", and will expire when the browser closes.

Also, make sure you set cookies before any HTML output otherwise it won't be created.

To check it's value, do on a following page.

Thank you, but i have two questions, 1. How can i change the expiration time? 2. By "making sure you set cookies before any HTML output otherwise it won't be created", do you mean that i shoudld put the cookie script before the <head> tags?

To change the expiration there are multiple ways to do it, but if you wanted it to last 24 hours, do time() + (60 * 60 *24). --- Put the PHP code before the HTML tag if possible, but yes, definitely before the HEAD tag.

How to make a cookie with PHP - Stack Overflow

php cookies setcookie
Rectangle 27 0

YES it does, I created the base project then I right clicked on the project name and added a webservice file with the demo of hello world in it. If you view that file in the browser it works fine.

c# - Do standard webservices (asmx) work with MVC? - Stack Overflow

c# asp.net-mvc web-services asmx
Rectangle 27 0


I wrote a println function that determines whether a \n or a <br /> should be appended to the line depending on whether it's being executed in a shell or a browser window. People have probably thought of this before but I thought I'd post it anyway - it may help a couple of people.

<?php
function println ($string_message) {
$_SERVER['SERVER_PROTOCOL'] ? print "$string_message<br />" : print "$string_message\n";
}
?>

Examples:

Running in a browser:

<?php println ("Hello, world!"); ?>
Output: Hello, world!<br />

Running in a shell:

<?php println ("Hello, world!"); ?>
Output: Hello, world!\n
Rectangle 27 0

NodeSchool.io's Learn-to-NPM course, running in your browser [Node.j...

Hello world in Node.js

Node.js Hello World
Rectangle 27 0

var http = require('http');

// Configure our HTTP server to respond with Hello World to all requests.
var server = http.createServer(function (request, response) {

  response.writeHead(200, {"Content-Type": "text/html"});
  response.end("<a href=\"http://www.tagesschau.de/\">ARD Tagesschau</a>\n");
});

// Listen on port 8000, IP defaults to 127.0.0.1
server.listen(8000);

// Put a friendly message on the terminal
console.log("Server running at http://127.0.0.1:8000/");

Check the difference in your firebug or dev tools to understand how browser interprets differently based on Header Content-Type.

javascript - HTML code from node js not interpreted as such by the bro...

javascript html node.js webserver
Rectangle 27 0

If you just want the log, you can use the fdb command line tool [similar to gdb] (located in the bin folder of the Flex SDK you are working with). You will still need some instance of an swf running to see the output. So you will either need the Standalone Flash debugger or the one in your browser.

mxmlc -debug=true hello.as
fdb hello.swf

From there you will see a trace ... in this case

[trace] Hello world

Add breakpoints to step through if you want or bunch up commands in a bash script. The full list of commands are in the docs.

hello world in actionscript on linux - Stack Overflow

linux actionscript-3 actionscript
Rectangle 27 0

It's probably because of browser same origin security restriction - socket.io client library doesn't come from the server you connect to.

I don't know about rather ancient 0.6.9, but newer versions of socket.io serve socket.io client automatically, so you should use /socket/socket.io.js instead of file:// URL you currently use. Check the documentation for exact URL.

cygwin - making hello world application with socke.io and Learning - S...

cygwin node.js socket.io
Rectangle 27 0

So the issue might be related to cross-domain XMLHttpRequests. You can either add an header Access-Control-Allow-Origin or disable these security checks in your browser for developing purposes (in Chrome via --disable-web-security).

Access-Control-Allow-Origin fixed it! I'm still confused about what exactly caused this to be blocked; is it still cross-domain from local to local?

javascript - Basic hello world server and Xmlhttprequest client -- Sta...

javascript node.js xmlhttprequest
Rectangle 27 0

The AIR app won't work in a browser. For the web version, you would use Flex and for the desktop version you would use AIR. Both applications can be written in Actionscript 3 however, unlike Flex apps, AIR apps can also be written in HTML/JS. If you write your apps in Actionscript 3, your Flex and AIR apps could use almost identical code. Obviously, there are a few classes which can only be used in AIR as these related to desktop functionality. If you look at the Actionscript 3 reference (http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/), you can see which of the classes are AIR only and which can be used in both Flex and AIR.

AIR files are exported as .air files while Flex file are exported as regular Flash .swf files.

As far as, "C++ (which is Air) and i could use PHP (which is Flex)", that is sort of right. AIR is a replacement for C++ in that you can write desktop apps with both. However, because of the AIR runtime, you do not have to write different versions for different operating systems. the one AIR app will work on Windows, Mac, Linux and now Android phones. With C++, you'd have to modify your codebase for all of these environments. Flex is not like PHP however, it's client side so is more like a more-powerful Javascript. You can have a Flex app talking to a PHP backend (using AMFPHP or Zend_AMF to communicate) which handles all the server-side stuff like retrieving data from a database and sending it back to the Flex app running in the browser on the client. Flex is sort of like a collection of components (it's officially an SDK) to make writing web apps easier. So, for example, there's drop-down menus, date-pickers, datagrids, trees, video displays, etc, plus everything else that's available in Flash. IMO, the best thing about Flex development over HTML/JS development is the layout model. You can make some very complex fluid layouts very easily in Flex which adapt to different screen sizes. You also don't have to do much in the way of cross-browser testing - it looks the same in all browsers on all OSes as long as the user has the approriate Flash Player. It's also very fast when handling lots of data and makes it easy to mix many different multimedia components, video, audio, etc, in the same app. Some good apps written in Flex are Aviary, Photoshop.com and Buzzword. Some good AIR apps are the eBay desktop client, Feedalizr, Seesmic Desktop, etc.

Thanks for breaking it in to details, its a good information to make the choice as a new person (coming from pascal/c/c++/c#), reading 500 pages only to make choice for air/flex/flash seems crazy to me. Thanks a lot.

flex - Adobe Air - How to make a hello world? - Stack Overflow

flex air
Rectangle 27 0

if (Request.Browser.Cookies)
 {
       Response.Write("Welcome To Hello World Cookies Accepted by the browser");
 }
 else
 {
                Response.Write("Good Bye To Hello World. Cookie diabled in your browser. Enable cookies and Try again... Cool..");

 }

Check cookies in asp.net - Stack Overflow

asp.net cookies
Rectangle 27 0

This line: @app.route("/") will register the function as the handler for the '/' route. When the browser queries '/' (the root), the application responds "Hello World!".

The @ syntax is called Decorators.

python - In Flask, why does this hello world app work? - Stack Overflo...

python flask
Rectangle 27 0

I think you're approaching things the wrong way. If your end goal is to write something to a browser, you shouldn't be using console.log at all. All you would need in my_file.js is module.exports = 'Hello World';

This isn't PHP where you would write things out in a file, then include that file to include it in the output to the browser.

var http = require('http');
var content = require('./my_file.js');

http.createServer(function(req, res) {
  res.end(content);
}).listen(port);
var content = '';
// build content here
module.exports = content;

javascript - Nodejs execute node file and get its output - Stack Overf...

javascript node.js
Rectangle 27 0

I think you should give Restlet, a lightweight rest framework a try. The tutorial shows you how to start a local webserver, and by that deliver a "Hello World" through the browser within minutes (no joke!), and there's plenty of extensions for any kind of need.

In combination with Java Web Start by which you can deploy and start the application to the local host this should be what you need.

mysql - How to deliver a Java program locally through a browser - Stac...

java mysql jdbc browser language-features
Rectangle 27 0

NodeSchool.io's LearnYouNode course, available in your browser [Node...

Brought to you by Free Code Camp

Start by running

and choosing the first challenge. Modify the code in program.js. Then run

to see whether your code passes. Then run

again and select the next challenge. Good luck!

Node.js nodeschool FreeCodeCamp
Rectangle 27 0

NodeSchool.io's Functional Programming in JavaScript course, availab...

Brought to you by FreeCodeCamp.com

Start by typing the following into the terminal below and pressing enter:

and choosing the first challenge. It will output the challenge's instructions in your terminal. You may have to scroll to read them all. Modify the code in program.js. Then run your program by typing this into the terminal:

This will show your program's output. If it looks like you expect, type this into the terminal:

You can try this as many times as necessary until you can get your JavaScript to pass. Then type this into the terminal:

and select the next challenge. Good luck!

Node.js functional-programming JavaScript nodeschool FreeCodeCamp
Rectangle 27 0

NodeSchool.io's Promise It Won't Hurt Promises course, available in ...

Brought to you by FreeCodeCamp.com

Start by typing the following into the terminal below and pressing enter:

and choosing the first challenge. It will output the challenge's instructions in your terminal. You may have to scroll to read them all. Modify the code in program.js. Then run your program by typing this into the terminal:

This will show your program's output. If it looks like you expect, type this into the terminal:

You can try this as many times as necessary until you can get your JavaScript to pass. Then type this command:

and select the next challenge. Good luck!

Node.js JavaScript promises nodeschool FreeCodeCamp