Introducing the Knowledge Graph: things, not strings – Inside Search

Search is a lot about discovery—the basic human need to learn and broaden your horizons. But searching still requires a lot of hard work by you, the user. So today I’m really excited to launch the Knowledge Graph, which will help you discover new information quickly and easily.

via Introducing the Knowledge Graph: things, not strings – Inside Search.

2′s complement representation in Java

Hello to everyone,

after a long time here is another post from a geek dad. I’d like to talk about how negative numbers are represented in Java so as to make bit manipulation easier. Let’s take into account integer data types (i’m not talking about Integer class, but about primitive types); from Java tutorial

http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html

integer primitive type is defines as “32-bit signed two’s complement integer”, which could have values from -2147483648 to 2147483647 (limits included). Since int is 4bytes (32 bits) you can calculate these values easily:

  1. Upper limit =  \frac{2^{32}}{2}- 1=2147483647
  2. Lower limit = -\frac{2^{32}}{2}=-2147483648
  3. General formula for non negative upper limit  \frac{2^{n}}{2}- 1  where n is the number of bits.
  4. General formula for negative lower limit  -\frac{2^{n}}{2}1  where n is the number of bits.
  5. If the primitive is unsigned the lower limit is 0, while the upper limit becomes {2^{n}}- 1

Ok, up to know it’s pretty simple, but what about 2′s complement? Or what 2′s complement is?

Wikipedia defines it as “The two’s complement of a binary number is defined as the value obtained by subtracting the number from a large power of two (specifically, from 2N for an N-bit two’s complement). The two’s complement of the number  behaves like the negative of the original number in most arithmetic, and it can coexist with positive numbers in a natural way.”

Practically is a useful way to represent negative numbers, since the arithmetical fundamental operations are the same, regardless whether the input or the output  is considered to be unsigned or signed. Continue reading

Do we really need expensive computers?

Commodore 64

A small and powerful old PC

I’m writing this post using my brand new Sony Vaio, with a nice hardware, a lot of RAM, a nice screen and a comfortable keyboard, but with a weird feeling: do I really need all this stuff? Well a lot of memory helps a lot, a powerful graphic card could be useful for photo/video editing, but what about a normal usage?

Common people mostly use this hardware for surfing the Internet, watching some video on YouTube, writing some document. These activities don’t need a lot of  resources and most of the power that brand new computers provide sometimes is useless. Unless you don’t edit videos, play 3D games or some other resource consuming stuff.

During old times, while I was using my Commodore C64,  32K of available RAM  was enough to do almost anything; what I think is that programmers lost their ability to use small resource to obtain the maximum. Now that RAM is not expensive, huge HDD are cheap they simply do not think about the impact that a power consuming thread could have on a user. So, now we have a lot stuff that uses a lot of our machine resources forcing us to buy new and more powerful computers.

But, have you ever thought about your old machine? What you’re going to do with that one? Are you simply throwing it away or are you going to use it in some other way? Regarding this I’d like to tell you that maybe to do usual office stuff, you could also use an obsolete machine with a small resource consuming OS such as Xubuntu, Damn small Linux or Puppy Linux; or if you don’t like it an old Win XP could be enough, so before thinking about buying a new computer start writing down some points:

  1. Do I need it to edit videos?
  2. Do I need to do professional photo editing?
  3. Do I play 3D games?
  4. Do I use it for surfing the Internet?
  5. Do I use it for office stuff?
  6. Am I a professional programmer?
  7. Am I a designer?

If the number of  ”Yes” answer are the majority, maybe you really need to buy a powerful computer, otherwise think about asking to one of your PC expert friend (everyone in the world has a PC expert friend ^_^ ) to help you refurbish your PC and save your money!!

 

Have fun!

 

Raspberry Pi – Britain’s smallest PC – Specs & Costs (Wired UK)

This is the real low cost pc… you can do almost anything with this and well…. read on!

 

Measuring just 85mm by 54mm and costing $25 (£16), the Raspberry Pi packs a punch. “It can do anything a PC can,” says engineer Eben Upton, one of six Cambridge-based creators. At its heart is a Broadcom system-on-a-chip, and with 128MB of RAM it can run a full version of Linux-based system Fedora 15 as powerfully as a Pentium II machine.

via Raspberry Pi – Britain’s smallest PC – Specs & Costs (Wired UK).

Wikipedia, the free encyclopedia has been shut down for today

Read carefully…

 

Imagine a World

Without Free Knowledge

For over a decade, we have spent millions of hours building the largest encyclopedia in human history. Right now, the U.S. Congress is considering legislation that could fatally damage the free and open Internet. For 24 hours, to raise awareness, we are blacking out Wikipedia.

via Wikipedia, the free encyclopedia.

Some useful Linux commands

Howdy!

What I’d like to share with you today, are some useful tips I’ve learned  while exploring  my Linux OS. First you have to know that, using a ‘nix’ system  will  lead you to use the terminal sooner or later, to install something or just use it because you want to be a smart ‘nix’ user!!! These systems have a lot of commands that you can use for almost everything,  from folder creation to file editing but what is a “shell”?

A shell is

  1. A program that interprets commands
  2. Something capable to execute scripts and user typed programs.
  3. An interface to the operating system

Most Linux systems replaced the standard shell /bin/sh with the Bourne Again Shell BASH,  which Continue reading

Create your own desktop slideshow on Ubuntu

Happy new year!!!

Tired of your usual desktop background? Do you have many new pictures you’re not able to choose from? Well, there is a solution to this: you could use a specific software or, if you want to learn something new, use my procedure. First of all, where are all my background images located? Open your terminal and type:

sudo nautilus /usr/share/backgrounds/

Now using navigator commands create a new folder and call it, for example, my_images, copy all the images you like inside this folder and create a new file, calling it background-1.xml.

Ok, you’re almost at the end! Open the file using your preferred text editor (e.g. gedit) and paste the following code

Continue reading

Big Endian or Little Endian?

Howdy!

I’m sure that most of the developers have met the terms “big endian” or “little endian”. Originally these two terms were used by Jonathan Swift in his Gulliver’s travels. Briefly people from Lilliput were cracking boiled eggs from the small end (little endians) while the inhabitans of the rival kingdom of Blefuscu were craking the eggs from the big end (big endians); but what do they mean in computing? They  describe the way data with a size bigger than 1 byte, is memorized.

A computer using big endian starts memorizing from the most significant byte to the least significant one, while little endian starts memorizing from the least significant byte and ends with the most significant one. Let’s make an example with the hexadecimal number 0x12AB:

Endianness Lowest address Highest address
Big endian 12 AB
Little endian AB 12

If we take into account a double word like 0×1234567 the order will be

Continue reading