Monday, December 12, 2011

Tel Aviv a bustling 24-hour metropolis

Tel Aviv is very different from the rest of Israel. Dubbed the 'bubble' because of its individuality, it is famed for its cosmopolitan attitudes and dubious living. Tel Aviv is both European and Asian. It is one of the few cities where west meets east. The best way to see Tel Aviv is to walk
on its many shaded streets and boulevards. A few years ago they completed the "Tayelet", or promenade from Yarkon park along the Yarkon River, to the beaches.
Tel Aviv offers a contrast between 4000 years of history and a bustling 24-hour metropolis. Starting a journey from the top, at the Azrieli Observatory in the middle of Tel Aviv, offers an opportunity to explorer Tel Aviv from the highest possible perspective. You get an incredible overview from the 49th floor. The Azrieli Observatory offers a 3D movie and an audio guide about Tel Aviv and the restaurant offers candlelight dinners. The Museum of Art in Tel Aviv is one of the biggest Museums. It holds a big amount of works and offers a representative and interesting view of Israeli art and its culture. The Museum was opened in the early 1932, before the state of Israel was founded.


Touring through Yaffo
offers many interesting experiences. Old Yaffo, with the Old Port, the markets, the restaurants and the unique atmosphere, is a real delight. Some claim that Yaffo needs an overall renovation but the charm of Yaffo is unbeatable. Don’t miss the flea market! Work your way down to the Old Port, where you can walk around on of the most ancient, yet still active, ports in the world.
Florentine neighborhood is yet another southern neighborhood which, in resemblance to
Yaffo, is charming but unable to overcome financial and social difficulties. Many cafes, bars and food joints have been opened. Visit the elaborately decorated house of Israel's most highly acclaimed poet, Haim Nachman Bialik, which is appropriately situated on Bialik Street.
Known as "the city that never stops", Tel Aviv is a late-night metropolis, which wakes
up at midnight and runs wild all night long. Roads jammed with heavy traffic and people waiting in line for a table at a bar, or admission to a night club, are common sights at the city's nightlife areas - even as late as 4am! Tel Aviv's nightlife focuses mostly on pubs, cafes and nightclubs, whose music is in one level with that on most European cities' clubs. The city gets amazingly
active every night of the week, but on weekends it's even more crowded. Major centers where
locals and visitors love to play all night are Allenby St and its surroundings. Doors to the clubs usually open at 23:00 (often cheaper before 24:00) but the parties really hit off at between 1 to 2 AM. Big parties often have reduced price tickets on sale beforehand (Shenkin St is the place to look). Dance bars start going at 23:00 and go till the last person stops dancing. Weapons of any
kind or anything that could be used as a weapon are not tolerated in clubs and security checks are mandatory, so think about what to leave at the hotel.


The best day for going out is usually Thursday, with younger crowds and longer queues. Saturdays usually host ‘after parties’ and even ‘after-after parties’. On a good weekend you can keep dancing from Thursday evening to Saturday afternoon, if you’re up to it! Tel Aviv is very much the polar opposite of Jerusalem. It is a secular, hedonistic city, more liberal in its politics than Jerusalem and a city which lives on the cutting edge of the here and now.

Jerusalem Old City Tour
The Old City of Jerusalem is a real must-see, being home to sites of key religious significance, including the Temple Mount, the Western (Wailing) Wall, the Church of the Holy Sepulchre, the Dome of the Rock and al-Aqsa Mosque. You can easily spend a full day here: place a prayer between the cracks of the huge stones that make up the Western Wall, browse the stalls in the narrow streets of the Old City bazaar, and visit the site of Jesus’ crucifixion. This will probably be your main tourist sightseeing day on your visit to Israel.

Dead Sea Tour
The Lowest Point on Earth is one special place to visit. If you need to chill out, and especially
if you’re feeling rundown, the Dead Sea is the ideal place in Israel to visit. Bring your newspaper along for that picture opportunity, smother some of that mineral rich Dead Sea mud on and then float on your back in the warm, salty sea. Just avoid diving in!


Diving in Eilat
A lot of divers don't notice the most special and beautiful spots when they lay underneath their
noses. So here are 2 diving spots:
- Dolphin Reef: It’s an ecological site unique in Israel and
throughout the world where visitors can enjoy a natural atmosphere, magical
views, together with the unusual opportunity of meeting and observing dolphins
in their natural habitat.
- The University: This site name has been given due to its location
along the beach of the interuniversity institute in Eilat. The underwater view
in this spot is one of the beautiful, which includes corals inhabitants that
worth seeing.

Tel Aviv Some useful information

Weekends: Thursdays, Fridays and Saturdays

Food and Drink
Looking for restaurants in Tel Aviv, you should know that eating must not necessarily be expensive, and cheap food must not be fast food. As in many Middle East cities street food is very popular and should not be mixed up with fast food. It may not sound the most civilized way to eat but it’s a very common one. The most popular street food is falafel which is served within a pita.

things you should do:

  • Azrieli Observatory - Overview from the 49th floor
  • The Beaches – White sand, blue sea and plenty of sun
  • Old Yaffo – A unique city with 4000 years history
  • Nightlife – Endless spots for all tastes
  • Neve Tzedek – Museums, shop, restaurants
  • Tel Aviv Museum of Art – Israeli Art
  • Ha-Carmel Market – hustle bustle market of Tel Aviv’s most vibrant market.
  • Bauhaus Architecture – Stroll through the streets and see Bauhaus architecture.
  • Park Ha-Yarkon – outdoor activities and greenery
  • Suzanne Dellal Centre – Israeli and International artists

Monday, July 04, 2011

HTTP HEAD and OPTIONS

There are 2 other HTTP methods which are a part of a URI:

- HEAD: Retrieve a metadata-only representation
- OPTIONS: Check which HTTP methods a particular resource supports

HEAD:
- making a call to a resource to fetch metadata without downloading an entire collection
- a client can use HEAD to check if a resource exists, to find out other information about the resource without fetching it's entire representation. So we have the same functionality like a HTTP GET but now the call does not fetch data.

OPTIONS:
- The OPTIONS method lets the client to discover what it's allowed to do to a resource. The response to an OPTIONS request contains the HTTP Allow header, which lays out the subset of the uniform interface this resource supports.

E.g. : Allow: GET, HEAD

That means that the client can send a GET and HEAD request to this resource but the resource does not support any other methods - effectively, this resource is read-only.

Normal RESOURCE:


Advanced RESOURCE:

PUT vs. POST Creation Paradigm

To create a new “thing” shall I use PUT or POST?

There is a clear answer for this question:

- If the client is responsible for creating the ID of the “thing” use a PUT
E.g: “./users/roni” <- roni is unique and given by the client -this is a new URI!

- If the server is responsible for creating the ID of the “thing” use a POST
E.g. “./users/” and as a post key/value the client transfers username=roni and prob. to id would be an auto generated number.


The “thing” retrieval pattern

use GET and not POST

Why not POST?
–Overloaded POST: the not-so-RESTful pattern

–It’s overloaded because a single HTTP method is being used to signify any number of non-HTTP methods.

–By using POST it will happen very easy that we implement an RPC service. In a RPC service we are using post and the Action is one of it’s parameters: ”/orders?action=delete&id=13” That’s not REST!

it's as easy as that

GET vs. POST Retrieving Paradigm

To retrieve a “thing” from a Resource we have 2 options:

–The HTTP GET options:
•GET ./order/221
•GET ./order?id=221

–The HTTP POST option:
•POST /order
–id = 221 [key value] … add as much as you need!

RESTful from a conceptional view - Part 1

REST (Representational State Transfer) for 1 slide:

  • Web Services expose their data and functionality through resources identified by a unique URI
  • Uniform Interface Principle: Clients interact with resources through a fix set of verbs
    Example:
    - GET – read
    - PUT – update
    - DELETE – remove
    - POST – create
  • Multiple representations for the same resource
  • Hyperlinks model resource relationships and valid transfer state transitions for dynamic protocol description and discovery





Wednesday, March 02, 2011

a custom serialization test

works pretty fast

using System;
using System.IO;
using System.IO.Compression;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;

namespace serializationtest
{
internal enum SerializedType : ushort
{
ByteArray = 0,
Object = 1,
String = 2,
Datetime = 3,
Bool = 4,
//SByte = 5, //Makes no sense.
Byte = 6,
Short = 7,
UShort = 8,
Int = 9,
UInt = 10,
Long = 11,
ULong = 12,
Float = 13,
Double = 14,

CompressedByteArray = 255,
CompressedObject = 256,
CompressedString = 257,
}

internal class Serializer
{
public static byte[] Serialize(object value, out SerializedType type, uint compressionThreshold)
{
byte[] bytes;
if (value is byte[])
{
bytes = (byte[])value;
type = SerializedType.ByteArray;
if (bytes.Length > compressionThreshold)
{
bytes = compress(bytes);
type = SerializedType.CompressedByteArray;
}
}
else if (value is string)
{
bytes = Encoding.UTF8.GetBytes((string)value);
type = SerializedType.String;
if (bytes.Length > compressionThreshold)
{
bytes = compress(bytes);
type = SerializedType.CompressedString;
}
}
else if (value is DateTime)
{
bytes = BitConverter.GetBytes(((DateTime)value).Ticks);
type = SerializedType.Datetime;
}
else if (value is bool)
{
bytes = new byte[] { (byte)((bool)value ? 1 : 0) };
type = SerializedType.Bool;
}
else if (value is byte)
{
bytes = new byte[] { (byte)value };
type = SerializedType.Byte;
}
else if (value is short)
{
bytes = BitConverter.GetBytes((short)value);
type = SerializedType.Short;
}
else if (value is ushort)
{
bytes = BitConverter.GetBytes((ushort)value);
type = SerializedType.UShort;
}
else if (value is int)
{
bytes = BitConverter.GetBytes((int)value);
type = SerializedType.Int;
}
else if (value is uint)
{
bytes = BitConverter.GetBytes((uint)value);
type = SerializedType.UInt;
}
else if (value is long)
{
bytes = BitConverter.GetBytes((long)value);
type = SerializedType.Long;
}
else if (value is ulong)
{
bytes = BitConverter.GetBytes((ulong)value);
type = SerializedType.ULong;
}
else if (value is float)
{
bytes = BitConverter.GetBytes((float)value);
type = SerializedType.Float;
}
else if (value is double)
{
bytes = BitConverter.GetBytes((double)value);
type = SerializedType.Double;
}
else
{
//Object
using (MemoryStream ms = new MemoryStream())
{
new BinaryFormatter().Serialize(ms, value);
bytes = ms.ToArray();
type = SerializedType.Object;
if (bytes.Length > compressionThreshold)
{
bytes = compress(bytes);
type = SerializedType.CompressedObject;
}
}
}
return bytes;
}

private static byte[] compress(byte[] bytes)
{
using (MemoryStream ms = new MemoryStream())
{
using (DeflateStream gzs = new DeflateStream(ms, CompressionMode.Compress, false))
{
gzs.Write(bytes, 0, bytes.Length);
}
ms.Close();
return ms.ToArray();
}
}

private static byte[] decompress(byte[] bytes)
{
using (MemoryStream ms = new MemoryStream(bytes, false))
{
using (DeflateStream gzs = new DeflateStream(ms, CompressionMode.Decompress, false))
{
using (MemoryStream dest = new MemoryStream())
{
byte[] tmp = new byte[bytes.Length];
int read;
while ((read = gzs.Read(tmp, 0, tmp.Length)) != 0)
{
dest.Write(tmp, 0, read);
}
dest.Close();
return dest.ToArray();
}
}
}
}

public static object DeSerialize(byte[] bytes, SerializedType type)
{
switch (type)
{
case SerializedType.String:
return Encoding.UTF8.GetString(bytes);
case SerializedType.Datetime:
return new DateTime(BitConverter.ToInt64(bytes, 0));
case SerializedType.Bool:
return bytes[0] == 1;
case SerializedType.Byte:
return bytes[0];
case SerializedType.Short:
return BitConverter.ToInt16(bytes, 0);
case SerializedType.UShort:
return BitConverter.ToUInt16(bytes, 0);
case SerializedType.Int:
return BitConverter.ToInt32(bytes, 0);
case SerializedType.UInt:
return BitConverter.ToUInt32(bytes, 0);
case SerializedType.Long:
return BitConverter.ToInt64(bytes, 0);
case SerializedType.ULong:
return BitConverter.ToUInt64(bytes, 0);
case SerializedType.Float:
return BitConverter.ToSingle(bytes, 0);
case SerializedType.Double:
return BitConverter.ToDouble(bytes, 0);
case SerializedType.Object:
using (MemoryStream ms = new MemoryStream(bytes))
{
return new BinaryFormatter().Deserialize(ms);
}
case SerializedType.CompressedByteArray:
return DeSerialize(decompress(bytes), SerializedType.ByteArray);
case SerializedType.CompressedString:
return DeSerialize(decompress(bytes), SerializedType.String);
case SerializedType.CompressedObject:
return DeSerialize(decompress(bytes), SerializedType.Object);
case SerializedType.ByteArray:
default:
return bytes;
}
}
}
}

Shared Cache - .Net Caching made easy

All information about Shared Cache is available here: http://www.sharedcache.com/. Its free and easy to use, we provide all sources at codeplex.

Facebook Badge