Google here...OK enjoy>>>
Popular Posts
-
Computers have wedged themselves into every facet of our lives—they are what we would use as the symbolic representation of the modern worl...
-
The work on C++0x has entered a decisive phase. The ISO C++ committee aims for C++0x to become C++09. It follows that the standard must b...
-
Amazing song by "The wanted" UK Top 40 Singles Chart 24-10-2010 second position ... Enjoy...
-
More details about Microsoft's upcoming Windows 8 have apparently leaked onto the Web, revealing new surprises and some makeovers to ex...
-
To Kia Hua HD, Bilal Khan, Coke Studio, Season 4 Download: http://keepvid.com/?url=http%3A//www.youtube.com/watch%3Fv%3DcOfPDZSqXMk ...
-
A federal agency recently brought a complaint against a Connecticut medical-services company for allegedly firing an employee over a Faceb...
-
Traditionally, software has been written for serial computation: To be run on a single computer having a single Central Processing Unit...
-
We've seen robots that can slither up a tree and shimmy up telephone poles , and now engineers in Hong Kong have developed one that...
-
Super-fast and great-looking, Ubuntu is a secure, intuitive operating system that powers desktops, servers, netbooks and laptops. Ubuntu i...
Sunday, April 24, 2011
Ubuntu is a secure, intuitive operating system that powers desktops, servers, netbooks and laptops.
Also, while I was tempted to compare Vista's Aero interface to the Beryl window manager (which has a similar palette of visual effects), I decided that pretty graphics, while nice, had more to do with personal preference than efficiency. In addition, Beryl isn't installed by default in Ubuntu, and Aero isn't available on all PCs.
Saturday, April 23, 2011
New Version Of C++ " C++ 0X "
The work on C++0x has entered a decisive phase. The ISO C++ committee aims for C++0x to become C++09. It follows that the standard must be complete for ratification by the ISO member nations in 2008. The set of facilities offered will be chosen from those currently being considered. To finish in time, the committee has stopped looking for new proposals and concentrates on the ones already being considered.
This paper briefly outlines the guiding principles of the work on C++0x, presents a few examples of likely language extensions, and lists some proposed new standard libraries.
Design and Evolution of C++ -Bjarne Stroustrup(C++ In-venter) & Herb Sutter (Microsoft Crater of C++ 0X )
An Overview of the Coming C++ (C++0x) Standard
Language Features
Let�s see how code using new C++0x features might look:template<class T> using Vec = vector<T,My_alloc<T>>;
Vec<double> v = { 2.3, 1.2, 6.7, 4.5 };
sort(v);
for(auto p = v.begin(); p!=v.end(); ++p)
cout << *p << endl;
Each line except the last is illegal in C++98, and in C++98 we�d have to write more (error-prone) code to get the work done. I hope you can guess the meaning of this code without explanation, but let�s look each line individually.template<class T> using Vec = vector<T,My_alloc<T>>;
Here, we define Vec<T> to be an alias of vector<T,My_alloc<T>>. That is, we define a vector called Vec that works exactly like vector except that it uses my allocator (My_alloc) rather than the default allocator. The ability to define such aliases and to bind some but not all parameters of a template has been missing from C++. It has traditionally been referred to as a "template typedefs" because typedef is what we typically use for defining type aliases, but for technical reasons, we preferred using. One advantage of this syntax is that it introduces the name being defined where it is easy for the human reader to spot. Note also another detail. I didn�t writetemplate<class T> using Vec = vector< T,My_alloc<T> >;It will no longer be necessary to add that space between the terminating >'s. These two extensions have already been accepted in principle.
Next we define and initialize a
Vec:Vec<double> v = { 2.3, 1.2, 6.7, 4.5 };
Initializing a user-defined container (vector<double,My_allocator<double>>) with an initializer list is new. In C++98, we can only use such initializer lists for aggregates (arrays and classic structs). Exactly how this extension will be achieved is still being discussed, but the solution will most likely involve a new kind of constructor—a "sequence constructor". Allowing the above implies that C++ better meets one of its fundamental design criteria: support user-defined and built-in types equally well. In C++98 arrays have a notational advantage over vectors. In C++0x, that will no longer be the case.Next, we sort the vector:
sort(v);To do that within the framework of the STL we must overload
sort for containers and for iterators. For example:template<Container C> // sort container using <
void sort(C& c);
template<Container C, Predicate Cmp> // sort container using Cmp
where Can_call_with<Cmp,typename C::value_type>
void sort(C& c, Cmp less);
template<Random_access_iterator Ran> // sort sequence using <
void sort(Ran first, Ran last);
template<Random_access_iterator Ran, Predicate Cmp> // sort sequence using Cmp
where Can_call_with<Cmp,typename Ran::value_type>
void sort(Ran first, Ran last, Cmp less);
This illustrates the most significant proposed C++0x language extension that is likely to be accepted: concepts. Basically, a concept is the type of a type; it specifies the properties required of a type. In this case, the concept Container is used to specify that the two first versions of sort need an argument that meets the standard library container requirements. The where-clauses are used to specify the required relationship between the template arguments: that the predicates can be applied to the containers' element types. Given concepts we can provide far better error messages than is currently possible and distinguish between templates taking the same number of arguments, such assort(v, Case_insensitive_less()); // container and predicateand
sort(v.begin(), v.end()); // two random access iteratorsThe difficulty in the design of �concept� is to maintain the flexibility of templates so that we don�t require template arguments to fit into class hierarchies or require all operations to be accessed through virtual functions (as for Java and C# generics). In �generics�, an argument must be of a class derived from an interface (the C++ equivalent to �interface� is �abstract class�) specified in the definition of the generic. That means that all generic argument types must fit into a hierarchy. That imposes unnecessary constraints on designs requires unreasonable foresight on the part of developers. For example, if you write a generic and I define a class, people can't use my class as an argument to your generic unless I knew about the interface you specified and had derived my class from it. That's rigid.There are workarounds, of course, but they complicate code. Another problem is that you cannot use built-in types directly with generics, because built-in types, such as
int, are not classes and don't have the functions required by interfaces specified by a generic—you then have to make wrapper classes for holding built-in types and access elements indirectly through pointers. Also, the typical operation on a generic is implemented as a virtual function call. That can be very expensive (compared to just using a simple built-in operation, such as + or <). Implemented that way, generics are simply syntactic sugar for abstract classes.Given "concepts", templates will retain their flexibility and performance. There is still much work left before the committee can accept a specific and detailed concept design. However, concepts are a most likely extension because they promise significantly better type checking, much better error messages, and greater expressive power. That should lead to significantly better library interfaces, starting with the current standard containers, iterators, and algorithms.
Finally, consider the last line that outputs the elements of our vector:
for (auto p = v.begin(); p!=v.end(); ++p)
cout << *p << endl;
The difference from C++98 here is that we don�t have to mention the type of the iterator: auto means �deduce the type of the declared variable from the initializer�. Such uses of auto are far less verbose and also less error-prone than current alternatives, such as:for (vector< double, My_alloc<double> >::const_iterator p = v.begin(); p!=v.end(); ++p)
cout << *p << endl;
The new language features mentioned here are all aimed at simplifying generic programming. The reason is that generic programming has become so popular that it is seriously strains the language facilities. Many �modern� generic programming techniques border on �write only� techniques and threaten to isolate its users. To make generic programming mainstream, as object-oriented programming was made mainstream, we must make template code easier to read, write, and use. Many current uses are too clever for their own good. Good code is simple (relative to what it is trying to do), easy to check, and easy to optimize (i.e., efficient). This implies that a wide range of simple ideas can be expressed simply in C++0x and that the resulting code is uncompromisingly efficient. The former is not the case in C++98—at least not for a sufficiently large range of techniques relying on templates. Better type checking and more extensive use of type information to shorten code will make code shorter and clearer, and easier to maintain, as well as more likely to be correct.Library Facilities
Ideally, we�d leave the C++ language mostly unchanged and focus on adding standard libraries. However, libraries that are sufficiently general to be standard are not easy to design and the standards committee is—as usual—short of resources. We are a relatively small group of volunteers and all have �day jobs�. This puts unfortunate limits on how adventurous we can be with new libraries. On the other hand, the committee started early and a technical report on libraries ("The Library TR") was recently approved by vote. It provides several facilities that are directly useful to programmers:- Hash Tables
- Regular Expressions
- General Purpose Smart Pointers
- Extensible Random Number Facility
- Mathematical Special Functions
unordered_maps) available. In addition, the Library TR provides extensive facilities for builders of generic libraries building on the STL:- Polymorphic Function Object Wrapper
- Tuple Types
- Type Traits
- Enhanced Member Pointer Adaptor
- Reference Wrapper
- Uniform Method for Computing Function Object Return Types
- Enhanced Binder
In addition to these general-purpose libraries, the committee presented a library interface to the most basic level of hardware in its �Performance TR�. That TR is primarily aimed to help embedded systems programmers and to disprove myths about poor performance of C++ code and about C++ being unsuitable for low-level tasks.
Putting It All Together
�Drawing all shapes in an array� is a classical example of object-oriented programming (going back to the early Simula days). Using generic programming, we can generalize that to drawing each element of any container holding (pointers to) shapes:template<Container C>
void draw_all(C& c)
where Usable_as<typename C::value_type,Shape*>
{
for_each(c, mem_fun(&Shape::draw));
}
In C++0x, we hope to have Container as a standard concept and Usable_as as a standard predicate. The for_each algorithm is already in C++98, but the version that takes a container (rather than a pair of iterators) will have to wait for concepts in C++0x. The where-clause is a mechanism through which an algorithm can express requirements on its arguments. Here, draw_all() requires (obviously) that the elements of the container must be usable as (implicitly convertible to) Shape*. In this case, the where-clause gives us a degree of flexibility/generality not offered by simply requiring a container of Shape*'s. In addition to any container of Shape*'s, we can use any container with elements that can be used as Shape*'s, such as a list<shared_ptr<Shape*>>(where shared_ptr is a likely C++0x standard library class) or a container of pointers to a class derived from Shape*, such as deque<Circle*>.Assuming that we have points p1, p2, and p3, we can test draw_all() like thisvector<Shape*> v = {
new Circle(p1,20),
new Triangle(p1,p2,p3),
new Rectangle(p3,30,20)
};
draw_all(v);
list<shared_ptr<Shape*>> v2 = {
new Circle(p1,20),
new Triangle(p1,p2,p3),
new Rectangle(p3,30,20)
};
draw_all(v2);
The "draw all shapes" example is important because when you can do that well, you can do much of what�s key to object-oriented programming. As written here, the example demonstrates the power of multi-paradigm programming by also employing generic programming (concepts and templates), conventional programming (e.g. the free-standing standard-library function mem_fun()), and simple data abstraction (the function object returned by mem_fun()). Thus, this simple example opens the door to a host of elegant and efficient programming techniques.I hope that after looking a bit at this example, your reaction will be "How simple!" rather than "How clever! How advanced!" In my opinion, many people are trying too hard to be clever and advanced. The real aim of design and programming is to produce the simplest solution that does the job and express it in the clearest possible way. The aim of the C++0x design is to better support such simple solutions. Information Sources
My web pages (http://www.research.att.com/~bs) contain much useful information. There you will find information about my own work (books, articles, interviews, FAQs, etc.) and links to sources that I find most helpful, such as a list of interesting C++ applications, a list of C++ compilers, and links to useful libraries (e.g., BOOST). In connection with C++0x, you can find:- "Wish lists" for language features and library facilities
- The Standard: IOC/IEC 14882—International Standard for Information Systems�Programming Language C++
- The Performance TR: ISO/IEC PDTR 18015—Technical Report on C++ Performance.
- The Library TR: JTC1.22.19768 ISO/IEC TR 19768—C++ Library Extensions.
- A link to the WG21 (ISO C++ Standards Committee) site, where you can find all the proposals being considered
- A page with some of my proposals (including "concepts") to the committee. (Please remember that not all proposals are accepted and that essentially all proposals that are accepted incorporate major changes and improvements before acceptance.)
New Phone From Google Nexus|S
Nexus S is the first phone to run Gingerbread, the fastest version of Android yet.
Gingerbread builds on some of the most popular Android features like multi-tasking and Wi-Fi hotspot and adds a refreshed user interface, an improved keyboard, near field communication (NFC) support, and more.
Internet calling (VoIP/ SIP support)
Gingerbread allows Nexus S to place Internet calls with a SIP account. This allows for enhanced VoIP dialing to other SIP accounts and even phone numbers.
One-touch word selection and improved copy-paste
With Gingerbread, copying and pasting text is easier than ever. Use the new text selection tool to copy and paste when entering text or viewing a webpage.
One-touch word selection and improved copy-paste
With Gingerbread, copying and pasting text is easier than ever. Use the new text selection tool to copy and paste when entering text or viewing a webpage.
Saturday, February 5, 2011
Tuesday, November 9, 2010
Motion control shoot-out: Xbox 360 Kinect vs. PlayStation Move vs. Nintendo Wii Remote Plus
We compare the Microsoft Xbox 360 Kinect, Sony PlayStation Move, and Nintendo Wii Remote Plus to see which is the ultimate motion control game system
check its video...
check its video...
Yes, insults on Facebook can still get you fired....!!!
A federal agency recently brought a complaint against a Connecticut medical-services company for allegedly firing an employee over a Facebook post.
But it may not be wise to take that as carte blanche to go online and type in exactly what you think of your boss.
The general rule is that employers can still fire workers for off-color or unsavory things they say when blogging (or facebooking or tweeting) on the job or about their job.
"It would be a mistake for people to say that, 'Just because I'm on Facebook, I can say whatever I want,'" said Charles Cohen, senior counsel at the Morgan Lewis law firm in Washington, D.C. "That's the main point."
There are exceptions to that rule. Union employees with a contract are often protected from being fired without "just cause." Being fired because you disclosed your religion or sexual orientation on a blog is likely illegal.
Finally, organizing a union has long been protected under federal law--which is the right that the National Labor Relations Board is seeking to expand to social-media sites in its new complaint filed against American Medical Response.
The complaint says (PDF) that AMR employee Dawnmarie Souza "engaged in concerted activities with other employees by criticizing respondent's supervisor...on her Facebook page" on November 8, 2009. Souza was fired on December 1, 2009. (An administrative-law judge will hear the NLRB's allegations on January 25, 2011.)
Note the key phrase "concerted activities." That's a reference to a 1935 federal law called the National Labor Relations Act. Section 7 of the law says employees have the right to organize labor unions and "to engage in other concerted activities for the purpose of collective bargaining or other mutual aid or protection."
CNET has obtained copies of Souza's Facebook posts. In one, she called her supervisor a "dick." Another said "he's a scumbag as usual." One reply said: "I am sorry, hon! Chin up!"
Invoking scatological language when describing the relative merits of your job is, of course, a time-honored American tradition. So is firing employees who do it to your face. But is a Facebook post calling a supervisor a "scumbag" necessarily done "for the purpose of collective bargaining or other mutual aid or protection?"
Perhaps not. Or, at the very least, it may not be exactly what the drafters of that 1935 federal law--billed as promoting "the flow of commerce by removing certain recognized sources of industrial strife and unrest"--had in mind.
A 1978 Supreme Court case, Eastex v. NLRB (PDF), said employees could distribute a union newsletter (during nonwork hours) that took explicitly political positions. Federal law, a majority of the justices said, encompasses that newspaper distribution as a type of "concerted activity."
But the majority also acknowledge that "some concerted activity bears a less immediate relationship to employees' interests as employees than other such activity." That kind of activity, the justices said, "cannot fairly be deemed to come within the 'mutual aid or protection' clause" and could be legally punished by an employer.
"We're trying to adapt that law to the modern workplace," Tony Wagner, a representative of the NLRB for new media, told CNET. "This is really the first case we're aware of that directly involves a social-media component."
Complicating the complaint that the NLRB filed against the Connecticut company is that it's not just about a few Facebook posts: Souza allegedly requested union representation during an internal AMR disciplinary process and was refused. That dispute apparently is what led her to vent online.
The NLRB's complaint against the company stresses that point, alleging that AMR "has been discriminating in regard to the hire or tenure, or terms and conditions of employment, of its employees, thereby discouraging membership in a labor organization," in violation of the law.
For its part, AMR says the case is really unrelated to Facebook.
"The real issue here doesn't have anything to do with Facebook," said John Barr, a partner at the Jackson Lewis law firm who represents AMR.
Even in the absence of the Facebook posts, "the employee most likely would have been fired," anyway, because of repeated complaints about her "rude and discourteous behavior."
AMR doesn't monitor Facebook posts, Barr said. Instead, "the way AMR finds out about it is that one day, the supervisor has personnel from the fire department call him up and say, 'What's this on Facebook?'" Moreover, he added, AMR has not disciplined other employees for their out-of-school Facebook conversations.
"It's the company's position that the Facebook posting was not protected activity" under Section 7, Barr said.
While this appears to be the first time that the NLRB has taken action against an employer based on social media, it has addressed the topic before. In a memorandum sent to Sears in December 2009 (PDF), the agency said the company's Internet policy did not violate the law.
Sears' policy prohibited the "disparagement of company's or competitors' products, services, executive leadership, employees, strategy, and business prospects" through social media.
That's remarkably similar to AMR's Internet policy, which says: "Employees are prohibited from making disparaging, discriminatory, or defamatory comments when discussing the company or the employee's superiors, co-workers, and/or competitors."
This is hardly the first time someone was fired for Facebook comments made at work (or about the employer), and it won't be the last.
Last year, a U.K. employee was fired for saying her job was boring. So was a Swiss insurance worker who was fired after claiming that she was so sick, she couldn't use a computer but was caught logging on to Facebook from home.
Subscribe to:
Posts (Atom)