Translate

Archive for November, 2007

Chavez – Sindrome de doble personalidad

Friday, November 30th, 2007

Sera que finalmente se arma la de San Quintin? Le tiraran un madrugonazo? Sera que finalmente se arrechan los Venezolanos y sacan al loco (loco pila que tiene mas billete que bill gates) ?

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

FrostWire is featured download of Cyber Monday on Download.com

Monday, November 26th, 2007

Simply thanks, we have no words to describe how cool this is.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

PyQt4: Using QMutex vs QMutexLocker.

Sunday, November 25th, 2007

Here’s some code for my future reference on how to use QMutex or QMutexLocker.

Lessons Learned:
* Use QMutex to protect data, not code. Try not to lock hughe amounts of code within a function with mutex.lock(), mutex.unlock(), if for any reason you forget to release the lock you’ll be in trouble. Use the mutex directly only when you know what it is that you want to protect concurrent access from.
* When you have a complex function and you don’t want to worry about what to protect and when to release the lock (on exceptions thrown, before returns,etc), you can create an instance of QMutexLocker and it should release the mutex lock upon destruction… this takes us to the next lesson
* When using a QMutexLocker, DO NOT make the QMutexLocker an attribute of your class, otherwise, the reference will live after the method finishes and the lock won’t be released.

Here’s some code.

from PyQt4.Qt import QObject, QMutex, QApplication, QThread, QMutexLocker
import sys

class MutexTestSubject(QObject):
	'''
	Class that uses a QMutex to synchronize
        access to its add(),substract() methods.

        This works perfectly fine.
	'''
	def __init__(self):
		QObject.__init__(self)
		self.MAX_LIMIT = 100
		self.MIN_LIMIT = 0
		self.counter = 50
		self.mutex = QMutex()

	def add(self):
		self.mutex.lock()
		if self.counter < self.MAX_LIMIT:
			self.counter = self.counter + 1
		self.mutex.unlock()

	def substract(self):
		self.mutex.lock()
		if self.counter > self.MIN_LIMIT:
			self.counter = self.counter - 1
		self.mutex.unlock()

	def printStatus(self,thread):
		print "Counter:",self.counter," - Thread:",id(thread)

		if self.counter > self.MAX_LIMIT+1 or self.counter < self.MIN_LIMIT:
			print "Stopping Threads, Max Surpassed, Not Thread Safe. Last Thread:",id(thread)
			sys.exit()

class MutexLockerTestSubject(QObject):
	'''
	Class that attemps to synchronize thread
 	access to its add(),substract() methods with
	the QMutexLocker object.
	'''
	def __init__(self):
		QObject.__init__(self)
		self.MAX_LIMIT = 100
		self.MIN_LIMIT = 0
		self.counter = 50
		self.mutex = QMutex()

	def add(self):
		#VIP: DO NOT MAKE mutexLocker an attribute of your class.
		#other wise it won't be destroyed and the lock will never be released.
		mutexLocker = QMutexLocker(self.mutex)
		if self.counter < self.MAX_LIMIT:
			self.counter = self.counter + 1

	def substract(self):
		mutexLocker = QMutexLocker(self.mutex)
		if self.counter > self.MIN_LIMIT:
			self.counter = self.counter - 1

	def printStatus(self,thread):
		print "Counter:",self.counter," - Thread:",id(thread)

		if self.counter > self.MAX_LIMIT+1 or self.counter < self.MIN_LIMIT:
			print "Stopping Threads, Max Surpassed, Not Thread Safe. Last Thread:",id(thread)
			sys.exit()

class AdderWorker(QThread):
	def __init__(self, mutexTestObject):
		self.mutexTestObject = mutexTestObject
		QThread.__init__(self)

	def run(self):
		while(True):
			self.mutexTestObject.add()
			self.mutexTestObject.printStatus(self)

class SubstractorWorker(QThread):
	def __init__(self, mutexTestObject):
		self.mutexTestObject = mutexTestObject
		QThread.__init__(self,mutexTestObject)

	def run(self):
		while(True):
			self.mutexTestObject.substract()
			self.mutexTestObject.printStatus(self)

if __name__ == "__main__":
	USE_MUTEX_LOCKER = True #switch this to use regular mutexes vd QMutexLocker
	app = QApplication(sys.argv)
	mutexTestObject = MutexTestSubject() if not USE_MUTEX_LOCKER else MutexLockerTestSubject()

	adderThread  = AdderWorker(mutexTestObject)
	substracterThread = SubstractorWorker(mutexTestObject)

	adderThread.start()
	substracterThread.start()

	sys.exit(app.exec_())
Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

FrostWire has been reviewed by CNET

Wednesday, November 21st, 2007

On November 20th, FrostWire gets a very positive review by CNET’s download.com, and makes it to the home page of download.com as the Killer Download of the Day

Click here to read

Their review makes us very happy, at the same time, it pushes us to include new killer features that LimeWire may not be able to have in the near future, however if you follow LimeWire’s code base, it seems they’re working hard to release a web based Music Store that will be included on an embedded browser inside their client, probably in the fashion of the online iTunes store, but probably powered by P2P (we hope, if they stick to their p2p philosophy and hopefully without DRM so that files can be shared or bought, at least this worked beautifully for Radiohead).

It’d probably be a smart move by the LimeWire store to include the possibility to buy their music from outside their site (with commissions on sales of course), that way, other music sites could trigger purchases based on search, as well as other p2p clients such as FrostWire.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

The Internet Quiz – I scored 96% and you?

Tuesday, November 20th, 2007

free dating sites

Philadelphia Dating

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Episodio 071 – ANDROID pone a Symbian a temblar

Thursday, November 15th, 2007

Agrega a iTunes Agreganos a tu iTunes | Descarga en MP3 | Suscribete a este podcast | Skypeanos

Dale Play aqui mismo



Guarda TODOS tus archivos gratis en MyBloop.com!



Noticias

Patrocinantes de este Episodio

MacKinando.com

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Por que no te callas? (version en paso doble)

Monday, November 12th, 2007

Con la melodia de “Y Viva Espana”, demasiado comico.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Hugo Chavez, the worse threat to the Western Hemisphere

Sunday, November 4th, 2007

A few things about effing Hugo Chavez and why the US should take this guy as a threat worse than Al-Qaeda:
– Openly hates and resents the US and has insulted the Bush administration in every way possible
– Recently Spent over USD $3 billion in weapons
– Friends of Fidel Castro, Iran, China
– Helps the FARC infiltrate back to Colombia with Air Support (might be planning a war against Colombia to destabilize the region)
– Allows Al-Qaeda terrorist cells to operate freely in the country
– Legislates at his own will in over 50 matters (by decree)
– Recently trying to change the constitution to have infinite re-election
– Nationalized Oil, Electricity, and Telecommunications industries.
– Controls the media (shutdown RCTV), and is about to launch another TV Channel by the government
– Has a direct air traffic bridge from Caracas-Teheran with IranAir, flying known islamic terrorists and printing venezuelan IDs for them, which later allow them to obtain American Visas and enter the US legally
– Has lobbyists in Washington which he controls by offering profits from the Venezuelan oil industry
– Antisemitic
– 1 venezuelan is murdered every 30 minutes (crime related and violence related deaths, there is no security in Venezuela)

and the list goes on and on…

Embed this video on your blog or send this article to all your friends, the truth about this danger to the western hemisphere should be known. My country has no future unless this regime disapears completely, freedom for Venezuela.

<embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=5911805686509043935&hl=en" flashvars=""> &;t;/embed>
Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

How to Enter the Sims 2 Cheat Codes on the Xbox 360

Sunday, November 4th, 2007

So after spending like 2 hours, I finally figured out some missing information from all the pages out there that tell you how to enter cheat codes on the Xbox 360 if you use a compatible Xbox Game

The xbox 360 controller lacks the white and black buttons (this is explained everywhere), so on the cheat codes when they refer to the Black button, this means you gotta hit the Right Bumper (which is the button right above the Right Trigger).

Now, what they don’t tell you is, that when they say “Left” or “Right”, they mean “Left Trigger” and “Right Trigger”, sons of bitches.

Here are all the Cheat Codes, you can enter them during regular Game Play, meaning, when your Sim is walking around.

When you enter a Cheat Code correctly you will hear the voice of a woman Yawning, if you enter the same cheat code again, you will hear a “Uh-Uh” voice with a negative sound to it.

Once a first code is entered, you’ll see a small white pole in the front of your property, this is called the “Cheat Gnome“.

So remember:

Left -> Left Trigger
Right -> Right Trigger
White -> Left Bumper
Black -> Right Bumper

When they say D-Pad, they mean the Directional pad on the center of your Xbox 360, the one that looks like the good old directional pad of the old NES.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)


  • Categories

  • February 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • August 2011
  • June 2011
  • May 2011
  • April 2011
  • March 2011
  • February 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010
  • August 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • October 2009
  • September 2009
  • July 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2007
  • March 2007
  • February 2007
  • January 2007
  • December 2006
  • November 2006
  • October 2006
  • September 2006
  • August 2006
  • July 2006
  • June 2006
  • May 2006
  • April 2006
  • March 2006
  • February 2006
  • January 2006
  • December 2005
  • November 2005
  • October 2005
  • September 2005
  • August 2005
  • July 2005
  • June 2005
  • May 2005
  • April 2005
  • March 2005
  • February 2005
  • January 2005
  • December 2004
  • November 2004
  • October 2004