Skip to content

opensolaris screenshot on flickr by Tinix

10-Dec-09

this is screenshot by opensolaris operating system and  then it very complete
I haven’t so  much say as respect only images…


Share on Facebook | Share on Twitter


Extract each word found in a block of code

12-Oct-09

This opportunity was trying to write a regular expression and we’ve probably write a better … what this function is to process a string that is word for word count every word in a block…

#!/usr/bin/ruby
#Extract each word found in a block of code

class String

    def word_count
    frecuencies = Hash.new(0)
    downcase.scan(/\w+/) { |word| frecuencies[word] += 1 }
    return frecuencies
    end
    end



Then you can loading under console prompt and testing funtion

>> load 'word_count.rb'
=> true
>> %{Tinix tinix tinix tinivella Tinivella}.word_count
=> {"tinivella"=>2, "tinix"=>3}
>>

that is all.....Tinix


Share on Facebook | Share on Twitter


Microsoft Patches Linux; Linus Responds…

28-Jul-09

Original link by http://www.linux-mag.com/cache/7439/1.html

Microsoft has released code for inclusion in the Linux kernel, but should it be accepted? Linus Torvalds gives his perspective.
Christopher Smart
Wednesday, July 22nd, 2009
Community Tools

You may have already heard, but the unthinkable has happened. That’s right, Microsoft, the self-proclaimed enemy of Linux and free software, has announced that they will be submitting some 20,000 lines of code to the Linux kernel. Come again? Yes, Microsoft wants to get its code into the Linux kernel. You read that right!

It is important to note that this code has not yet been included into the official Linux kernel. The code has also not yet been thoroughly scrutinized by the wider community to see what the code actually consists of. Is it all code, or does it rely on binary blobs? Will the quality of the code make the grade, or will the community be expected to clean it up and maintain it?

When approached by Linux Magazine as to whether he has even looked at the code, Linus Torvalds (the father of Linux) replied:

“I haven’t. Mainly because I’m not personally all that interested in driver code (it doesn’t affect anything else), especially when I wouldn’t use it myself.

So for things like that, I just trust the maintainers. I tend to look at code when bugs happen, or when it crosses multiple subsystems, or when it’s one of the core subsystems that I’m actively involved in (ie things like VM, core device resource handling, basic kernel code etc).

I’ll likely look at it when the code is actually submitted to me by the maintainers (Greg [Kroah-Hartman], in this case), just out of morbid curiosity.”

There has been a lot of noise about this since the announcement a few days ago, but what does it all really mean? Let’s start with the opening paragraph of the press release, which says:

“Today, in a break from the ordinary, Microsoft released 20,000 lines of device driver code to the Linux community. The code, which includes three Linux device drivers, has been submitted to the Linux kernel community for inclusion in the Linux tree. The drivers will be available to the Linux community and customers alike, and will enhance the performance of the Linux operating system when virtualized on Windows Server 2008 Hyper-V or Windows Server 2008 R2 Hyper-V.”

You can’t help but notice the very first line, “a break from the ordinary.” That’s right. Normally Microsoft is trying to destroy Linux and free software. They hate the GPL license which they call a virus, a cancer, the destroyer of intellectual property, and even anti-American. It’s also just that - a break. Nothing has changed in Redmond, the company still hates Linux and they still want to destroy it.

So why the patch? Well, it contains three drivers which will enhance the performance of Linux when virtualized as a guest under Microsoft’s virtualization product, Hyper-V. Ahh, now the truth starts to emerge. The purpose of the code has nothing to do with being generous, but rather it is to ensure that Linux will run well under their own virtualization technology. Microsoft has well realized that the world is moving towards free software and that users are implementing Linux in their infrastructure.

Even though the motivation is a purely selfish one, is there anything wrong with that? Microsoft certainly plans to “outsmart open source” and this move should be seen in that light, but at the end of the day they are doing the unthinkable - contributing to free software - and that’s a win.

Microsoft has long claimed that Linux infringes on software patents in their portfolio. The company’s CEO Steve Ballmer went so far as to say that everyone who uses Linux has an unbalanced liability sheet and that Microsoft should be compensated for their intellectual property. Of course, when asked what these patent infringements were, Microsoft would never say - it’s part of their strategy to foster fear, uncertainty and doubt in the market. They have taken this a step further however, by suing GPS manufacturer TomTom claiming the VFAT implementation in the Linux kernel violated such patents.

Some are worried that this patch would place Microsoft patents directly into the Linux kernel - after all, they are drivers designed to work specifically with their own virtualization technology. The community needn’t worry too much however, as the code is released under the GNU GPLv2 which in Section 7 requires the authors to either provide royalty-free licenses, or cease distribution of the program completely. In short, Microsoft cannot sue over this code thanks to the GPL (although that might not stop them trying).

Then there’s the risk that this is a Trojan horse, but that is highly unlikely too. The code, should it enter the mainstream kernel, would be at the mercy of Linus and his minions who could just as easily take it back out should things turn nasty. No, this is something that Microsoft needs to do and something that they need to go well. For these reasons, Microsoft will have to play ball or run the risk of losing it altogether.

What it is.
A smart (and necessary) move on Microsoft’s half in order to help stifle the migration of their clients to Linux. Microsoft knows that their clients want to virtualize Linux servers and currently they can’t do that very well on Microsoft hosts using Hyper-V. So if Microsoft does nothing, their clients will start to move away from running Microsoft Windows as their host operating system.

What it is not.
It is not a change of heart. Microsoft has not embraced Linux, or the GPL, or free software. This move is purely a strategic one in order to remain in the virtualization race. Microsoft only does things which are in their own best interest (as with every corporation) and this is no exception. Microsoft’s “Open Source Technology Center” is nothing more than their attempt to stay on top of the free source phenomenon, to best position themselves to fight and destroy it. Much of their new found attention to open source has been a direct result of the European Commission’s Anti-trust case, which has forced them to open source certain products and release technical documentation.

Numerous articles have been saying that this is a validation of the GPL and that Microsoft is legitimizing it as a valid license to release technology under. But are they? Kernel developer and Novell employee Greg Kroah-Hartman, who was instrumental in convincing Microsoft to release the code, posts some interesting insights on his blog. Quoting a Microsoft statement, he writes that the reason Microsoft released the code under the GPL was because they “have utilized Linux code, [and so] Microsoft has an obligation to open source the device drivers. This is the process outlined by the Linux community.” It’s interesting to note that Microsoft is only releasing the code because they have to. This is not an endorsement of the GPL, it was simply a requirement in order to get their code into the kernel.

Having said all that, it is amazing that Microsoft would even consider releasing software under the GPL. Who would have thought even one year ago that they would ever contribute code to Linux, even if it was for their own benefit? So on that level it is amazing indeed. What this patch does show is that Linux and free software is gaining in power and popularity, so much so that Microsoft can no longer ignore it.

What should we do? Perhaps Linus should reject the code and keep Microsoft at bay. After all, why help them? Then again, anyone should be free to contribute code if it’s useful and the right quality.

We put this question to Linus, asking whether this patch was something he would be happy to include, even though it’s from Microsoft. He replied:

“Oh, I’m a big believer in “technology over politics”. I don’t care who it comes from, as long as there are solid reasons for the code, and as long as we don’t have to worry about licensing etc issues.

In fact, to some degree, I’d be more likely to include it because it’s from a new member of the community rather than less (again, I’d like to point out that drivers are special. They don’t impact other things, so they get merged much more easily than some core changes).

I may make jokes about Microsoft at times, but at the same time, I think the Microsoft hatred is a disease. I believe in open development, and that very much involves not just making the source open, but also not shutting other
people and companies out.

There are ‘extremists’ in the free software world, but that’s one major reason why I don’t call what I do ‘free software’ any more. I don’t want to be associated with the people for whom it’s about exclusion and hatred.”

So it’s highly likely that this code will be merged into the mainline kernel and that’s a good thing. Who knows, Microsoft might even see the light! Linus is dead right. We shouldn’t deny contributions from anyone based on who they are. It should be the quality of the contribution that matters.

Still, one can’t help but notice a pattern in Microsoft’s history, which jades their offer. Should that matter? IBM and other corporations have done similar things in the past. The only difference is that they are currently embracing Linux, rather than trying to extinguish it. Does that make them a more valuable contributor?

Linus states that this is how all open source code gets written, developers scratching an itch. The fact that this comes from Microsoft shouldn’t make any difference at all, saying:

“I agree that it’s driven by selfish reasons, but that’s how all open source code gets written! We all “scratch our own itches”. It’s why I started Linux, it’s why I started git, and it’s why I am still involved. It’s the reason for everybody to end up in open source, to some degree.

So complaining about the fact that Microsoft picked a selfish area to work on is just silly. Of course they picked an area that helps them. That’s the point of open source - the ability to make the code better for your particular needs, whoever the ‘your’ in question happens to be.

Does anybody complain when hardware companies write drivers for the hardware they produce? No. That would be crazy. Does anybody complain when IBM funds all the POWER development, and works on enterprise features because they sell into the enterprise? No. That would be insane.

So the people who complain about Microsoft writing drivers for their own virtualization model should take a long look in the mirror and ask themselves why they are being so hypocritical.”

Of course Microsoft’s code is designed to squarely benefit themselves, but so is all the other code contributed by corporations and often individuals. Think of Intel for example and the Moblin project. It is designed to keep Intel products on the forefront of technology and in part a preemptive attack on the ARM architecture which is bursting onto the netbook scene with a strong Linux history.

So yes, Microsoft’s code is a calculated and purely selfishly motivated move, but that’s nothing new to the free software world. Sure, we should remember who Microsoft are and what their goals are but as Linus puts it, this is how everyone gets into open source in the first place.

At the end of the day, even if these drivers do make it into the kernel, it will actually be up to distributions to include them. This means that even though Microsoft’s strategic move might appear to pay off now, it won’t necessarily work as they hope if companies like Red Hat, Novell and Ubuntu don’t include the drivers! It’s early days yet, so a lot of this remains to be seen.

Microsoft knows free software is not going away and it needs this code in the kernel to stay in the game. They must ensure that Linux will run on their products, else they run the risk of losing the lot. What Microsoft has yet to realize, is that they are fighting a losing battle. This is a prime example of that fact and should be a wake up call to the giant. So yes, let’s not forget who Microsoft is, but at the same time if they are contributing useful code then there’s no harm in adopting it and improving it.
Christopher Smart has been using Linux since 1999. In 2005 he created Kororaa Linux, which delivered the world’s first Live CD showcasing 3D desktop effects. He also founded the MakeTheMove website, which introduces users to free software and encourages them to switch. In his spare time he enjoys writing articles on free software.

Original link by http://www.linux-mag.com/cache/7439/1.html


mysql work from my server in my hosting

05-Jun-09

My Personal hosting only gives me two database but …
Can working with my database mysql from my server and redirecting in my hosting and that use this …
Then I could use more database mysql from my url…it’s great ..!!!

of course, you can use other dababase , for example sqlite3 , PostgreSQL .


Rails without welcome screen Aboard

30-Apr-09

First remove the file , public/index.html and add a route (to config/routes.rb) like:
then …
For example map.connect' ' :controller => 'Home', :action => ' index'

To specify the Controller and Action for the initial you application Rails.


Why Ruby…??? My Reasonable Question

27-Apr-09

Why would any self-respecting Java developer care about Ruby? Ruby is a general-purpose scripting language created 10 years ago in Japan. Contrary to popular belief, it is a pure object-oriented language. Unlike Java technology, Ruby has no scalars, so everything, including integers, are first-class objects. Ruby’s syntax borrows heavily from Smalltalk, Python, and Ada. Like the Java programming language, Ruby is a single inheritance language, but it offers some advanced features that Java technology does not, such as closures (think anonymous inner classes on steroids) and mix-ins (similar to interfaces, but less tightly bound to the class). Ruby is also highly portable, running on all major operating systems.

Ruby is also red-hot right now. People are starting to use it for the types of applications where it excels. Because it is interpreted and uses dynamic typing, you can do all sorts of magic tricks at run time that are very difficult in Java. One of the surprising capabilities enabled by dynamic typing and expressive syntax is the ability to create domain-specific languages in Ruby that allow you to work at a higher level of abstraction, away from the “raw” syntax of the language. Ruby on Rails is a framework for creating Web applications backed by databases that shows this elegance. Rake, Ruby’s version of Make and Ant rolled into one, is another example of this powerful use of the language.

The other reason to start playing with Ruby is that all the cool kids are doing it. Many of the people who recognized that Java technology was going to be important back in 1996 (like Glenn Vanderburg, Bruce Tate, and Martin Fowler) are heavily involved in Ruby now. Even if you aren’t going to change all your development efforts to Ruby, maybe it’s time you took a look at this language.

One of the main limiting factors to widespread development in Ruby is a good development environment (for those who don’t want to learn Emacs). The RDT changes that. What better way to experiment with Ruby than in your favorite IDE, Eclipse?

My favorite IDE is EMACS and you ?
Tinix./


Ruby delete file

23-Apr-09

Delete a file is very simple..for example…Watch this script

require ‘fileutils’
FileUtils.touch ” example.rb”
File.exists? “example.rb”
File.delete “example.rb”
File.exists? “example.rb”

Only delete a file…


Beginning with Scala

17-Apr-09

Scala is a general purpose programming language designed to express common programming patterns in a concise, elegant, and type-safe way. It smoothly integrates features of object-oriented and functional languages, enabling Java and other programmers to be more productive. Code sizes are typically reduced by a factor of two to three when compared to an equivalent Java application.

Many existing companies who depend on Java for business critical applications are turning to Scala to boost their development productivity, applications scalability and overall reliability.

For example, at Twitter, the social networking service, Robey Pointer moved their core message queue from Ruby to Scala. This change was driven by the companies need to reliably scale their operation to meet fast growing Tweet rates, already reaching 5000 per minute during the Obama Inauguration. Robeys thinking behind the Twitter Kestrel project is explained in the developers live journal. His concise 1500 lines of Scala code can be seen as he has generously made them available as an open source project.

Many top-notch programmers and industry leaders have already been captivated by Scala. They have become quite vocal encouraging others, creating a growing range of books on Scala and an almost endless supply of tips for Java programmers new to Scala, some of which are collected in “Java to Scala with the help of experts”. While here on the scala-lang site, there is a broad range of material too, from introductory Scala tutorials to advanced language research topics, or look at some Scala code examples, or just get started by installing Scala now.


Locos x Rails second part…

14-Apr-09

This is video by  locos x rails Conference Buenos Aires Argentina

We are in the Video  Juan Ayup and Me
Tinix./

Ruby-debugger Second part

07-Apr-09
The package needed is the ruby1.8-dev ...then install

tinix@Creek:/#sudo gem install ruby-debug
Building native extensions.  This could take a while...
Building native extensions.  This could take a while...
Successfully installed linecache-0.43
Successfully installed ruby-debug-base-0.10.3
Successfully installed ruby-debug-0.10.3
3 gems installed
Installing ri documentation for linecache-0.43...
Installing ri documentation for ruby-debug-base-0.10.3...
Installing ri documentation for ruby-debug-0.10.3...
Installing RDoc documentation for linecache-0.43...
Installing RDoc documentation for ruby-debug-base-0.10.3...
Installing RDoc documentation for ruby-debug-0.10.3...
tinix@Creek:/#

see you...Tinix./