How to sync chrome extension options

In the (hopefully near) future, you’ll be You are now able to store stuff in chrome.storage.sync, and it will be synced automagically. Unless you need something right now, do consider putting all your configurations in an single object, sometime later you’ll be able to just sync it! Edit: now this is available in stable Chrome!

“select” on multiple Python multiprocessing Queues?

Actually you can use multiprocessing.Queue objects in select.select. i.e. que = multiprocessing.Queue() (input,[],[]) = select.select([que._reader],[],[]) would select que only if it is ready to be read from. No documentation about it though. I was reading the source code of the multiprocessing.queue library (at linux it’s usually sth like /usr/lib/python2.6/multiprocessing/queue.py) to find it out. With Queue.Queue … Read more

What is the purpose of passing parameter to synchronized block?

Because it doesn’t matter whether I pass String’s instance, Some random class’s instance to the synchronized block as the synchronized block works perfectly irrespective of the parameter being passed to the block. The purpose of the parameter is twofold: It makes it possible to synchronize other blocks on the same object, so that if you … Read more

increment a count value outside parallel.foreach scope

I like to beat dead horses! 🙂 The “lightest” way to increment the count from multiple threads is: Interlocked.Increment(ref count); But as others have pointed out: if you’re doing it inside Parallel.ForEach then you’re probably doing something wrong. I’m suspecting that for some reason you’re using ForEach but you need an index to the item … Read more

Nvidia graphics driver causing noticeable frame stuttering

… or is there something I can do to fix it other telling people to disable Threaded “Optimization”? Yes. You can create custom “Application Profile” for your game using NVAPI and disable “Threaded Optimization” setting in it. There is a .PDF file on NVIDIA site with some help and code examples regarding NVAPI usage. In … Read more

Is changing a pointer considered an atomic action in C?

As others have mentioned, there is nothing in the C language that guarantees this, and it is dependent on your platform. On most contemporary desktop platforms, the read/write to a word-sized, aligned location will be atomic. But that really doesn’t solve your problem, due to processor and compiler re-ordering of reads and writes. For example, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)