Skip to content

Instantly share code, notes, and snippets.

View samueleresca's full-sized avatar

Samuele Resca samueleresca

View GitHub Profile
//Controllo se il cookie esiste, e lo visualizzo
if(Request.Cookies["ultimaVisita"] != null){
Label1.Text=Server.HtmlEncode(Request.Cookies["ultimaVisita"].Value);
}else{
Label1.Text="No valore";
Request.QueryString["mkt"] //Parameter : mkt | Value: it-it
Request.QueryString["lang"] //Parameter : lang | Value: it-it
Requer.QueryString["q"] //Parameter: q | Value: prova
//Controllo che l'oggetto di sessione esista e lo visualizzo
if(Session["ultimaVisita"] !=null){
Label1.Text=((DateTime)Session["lastVisit"]).ToString();
}else{
Label1.Text="Nessun valore in session";
}
//Setto il valore per la sessione successiva
Session["ultimaVisita"]=DateTime.Now
<?php
$host = 'localhost:27017'; //Server
$dbname = 'myMongoDb'; //Db name
$colname = "emp"; //Collection Name
$EMP = array(
array("empno"=> 7369, "ename" => "SMITH", "job" => "CLERK",
"mgr" => 7902,"hiredate" => "17-DEC-80", "sal" => 800,
"deptno" => 20),
array("empno" => 7499, "ename" => "ALLEN", "job" => "SALESMAN",
<?php
$host = 'localhost:27017';
$dbname = 'myMongoDb';
$colname = "emp";
try {
//Istanzio la connessione all host
$conn= new MongoClient($host);
//Seleziono il database tramite il $dbname
$db=$conn->selectDB($dbname);
//Prendo tutti i record con i valore del field sal greater than($gt) del valore 2900
$cursor=$coll->find(array("sal"=>array('$gt'=>2900)));
// wurflSetup.php file
error_reporting ( E_ALL );
define ( "WURFL_DIR" , dirname ( __FILE__ ) . '/wurfl/WURFL/' );
define ( "RESOURCES_DIR" , dirname ( __FILE__ ) . "/wurfl/examples/resources/" );
require_once WURFL_DIR . 'Application.php';
function getWurflManager() {
$config_file = RESOURCES_DIR . 'wurfl-config.xml';
<?php
error_reporting ( E_ALL );
require_once 'wurflSetup.php';
$wurflManager = getWurflManager ();
//SIMULO IPHONE 4
$_SERVER["HTTP_USER_AGENT"] = "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7"
$device = $wurflManager->getDeviceForHttpRequest ( $_SERVER);
<?php
error_reporting(E_ALL);
require_once('wurflSetup.php');
$wurflManager= getWurflManager();
//SIMULO IPHONE 4
$_SERVER["HTTP_USER_AGENT"] = "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7";
$device= $wurflManager->getDeviceForHttpRequest($_SERVER);
$capability_groups= $wurflManager->getListOfGroups();
asort($capability_groups);
@model string[]
@{
ViewBag.Title = "Index";
Layout="~/Views/Common/_Layout.cshtml";
}
This is the list of the fruit name:
@section Header{
<div class="view">@foreach (string str in new[] { "Home", "List", "Edit" }) { @Html.ActionLink(str, str, null, new { sytle = "margin: 5px" }); }"</div>