Mental Ray CIE D Illuminant and Blackbody Radiator shaders

August 8th, 2009

Mental ray has a lot of hidden shaders that are really useful for all kinds of situations. Those shaders are not officially supported but that doesn’t mean that they don’t work! Few of those are Light Utilities shaders such as CIE D Illuminant and Blackbody Radiator. They can be used for several reasons but i find them really useful for the way they handle the light distribution. Here’s the example:

Here’s what you need to do in order to use them:

Inside your Program Files\Autodesk\3ds Max 2010\mentalray\shaders_standard\include are two files that we need: base.mi and base_max.mi. You need to edit them in order to use CIE D and Blackbody shaders.

The Light Utilities section of your base.mi file should look like this:

#——————————————– Light utils

declare shader

color “mib_cie_d” (

scalar “temperature”,

scalar “intensity”

)

version 1

apply light, texture

end declare

declare shader

color “mib_blackbody” (

scalar “temperature”,

scalar “intensity”

)

version 1

apply light, texture

end declare

#——————————————– Shadow

Then, in order for it to appear in 3dsmax 2010 you now need to open the base_max.mi file and that’s where you’ll actually unhide the cie_d & blackbody shaders. In the base_max.mi file scroll down to the GUI sections for both the cie_d & blackbody shaders and put a # in front of the word hidden. Should look like this when you’re done:

gui “gui_mib_cie_d” {

control “Global” “Global” (

# “hidden”

)

}

gui “gui_mib_blackbody” {

control “Global” “Global” (

# “hidden”

)

}

After doing that, you’ll find it’s available for use in 3ds Max 2010.

A quick studio setup with 2 mr Sky Portals/blackbody

Phenyl-piracetam (Phenotropil, Carphedon)

May 8th, 2009

What is it.

Although wildly sold in the East (especially Russia) as a general stimulant and “lifestyle” improvement “supplement” this is a real and proper drug. Phenotropil is a derivate of Piracetam designed in Russia by their space program. Phenotropil is Piracetam on steroids. It has proved itself in improvement of memory both short and long term, attention and concentration. It improves communication between the brain hemispheres and sustainability of brain tissue to hypoxic and toxic effects and, without going into too much detail, improves your mood. While regulations about Phenotropil around the world are different, it is universally banned in sport events by the World Anti-Doping Agency. This is because it improves physical performance but also because of it dangers.

Physical performance

Phenotropil has been confirmed in Russian biathlon Olympic silver medalist Olga Pyleva in the 2006 Winter Olympics, Russian steeplechase runner Roman Usov was pulled out of the Beijing Olympics and A former rider for Gerolsteiner, professional cyclist Danilo Hondo, tested positive to this banned substance in 2005. It is rumored to be used by athletes all over the world. It improves tolerance to the cold, motor reaction control and muscle blood flow. It allows athletes to stay focused in high physical and mental stress situations and is a very efficient sport drug.

Mental performance

The effects of Phenotropil as a work drug are unparalleled. You could easily be fooled into it not having an effect if you are just chilling around. It produces pure, clean focus without jitters of usual work drugs such as caffeine. You are able to hold extreme concentration on a single objective for long periods of time without any fluctuation in your tempo. It can be said that you almost feel robotized for work. You do not have additional stimulation in the “traditional” sense of the word. You simply sit down and start working and enjoy it. You Have to work. When used with a proper nutritional diet the effects of Phenotropil might seem subtle but they are constant and the results produced are disproportionally larger and speak for themselves. Simply Phenotropil is pure FOCUS and there’s no other word to describe it. It improves cognition in work, study and sports and therefore this article is quite short in describing different effects of it.

Sleep

Phenotropil produces a different type of insomnia than classic stimulants. You are actually able to fall to sleep if you try and you are really tired but on the other hand it allows you to easily pull all-nighters with constant attention. Do not take Phenotropil late in the day for it will not let you sleep until you are completely exhausted. Many people reported lucid dreams if they managed to fall asleep while under effect.

Dosage

Two 100mg tablets a day are prescribed by the Russian brand. You can easily take one and achieve the wanted effect. A 800mg/kg dose is reported as lethal.

DANGERS

Phenotropil has teratogenic, mutagenic, carcinogenic properties. It is now possible that it might be associated with increased development of a number of encephalopathy conditions, including lesions of cerebral blood pathways and certain types of glioma. If true or not it doesn’t matter. It is a drug with not enough public medical research and taking it you are AT YOUR OWN RISK. If you get any skin rash when using it contact your doctor fast. There is a small chance of skin allergy.

Phenotropil makes you work extremely hard. As with other nootropics, if not used with proper food and supplements and adequate amounts of sleep it will produces usual side-effects such as headache, nervousness, tiredness but unable to sleep…


Project Free Input - Introduction

February 14th, 2009

For sure, CS is one science that does not work good with it’s legacy. One of the most obvious examples are input devices and their support. So obvious is the poorness of input device software and their “diversity” that we all accept it as imminent. Surely this is the way it must be? Well.. NO. This is the way it was built to be, not the way it should be.

XGeek.org proudly presents to you, from the depths of low-level programming, driver architecture, multi-language wrappers and windows hacking, Project Free Input, a series of articles on using input technologies to improve productivity while sitting at your beloved PC.

First and an irreplaceable piece of hardware that we all have is our keyboard. Not only have we had it for as long as we have got our hands on a PC but we have also as much accepted it as it is.

The History of keyboard

 

Human race first came in contact with a keyboard as a typewriter. First, Remington, typewriter came out in 1872.  The first layout was alphabetic. Not only inefficient, this layout also soon became a big problem because letters used frequently in consecutive order in the English language layed very close together. This produced a lot of jamming as soon as people started typing at, what is now know, as intermediate speeds. In 1974. a new layout came out. It was the oh so famous .. QWERTY. This layout is probably the one you have in front of you with slight changes. It is named by the first 6 letters at the top-left of the letter layout. This layout was specifically designed to separate consecutively used letters as far apart as possible. This actually means you get slowed down. Let me repeat that for you. You keyboard is designed to slow you down. Not only is this layout bad in traditional language writing, it is as bad for special features (shortcuts..). For example, the first keyboards were all CAPS but the “SHIFT” key existed for moving the carriage. So.. it stayed as an “implementation” on the regular keyboard. For another similar example, ask yourself when was the last time you actually pressed “CAPS LOCK” and decided to type all capital letters. This button actually occupies a spot on the base row (the row where your fingers rest, which you can reach fastest). In 1878. Remington no.2 hit the shelf, with both upper and lower keys, but still with the “SHIFT” key. In 1932. already an attempt was made to change things around and the Dvorak layout came out taking into consideration letter groups in the English language. It never caught up and we are still using the layout that was invented BEFORE the keyboard.

Do not despair for whether you are on Win, Linux or Mac you can “kinda” easily change your keyboard layout into another .. more appropriate one.

Much more about layouts will be covered in later articles. (changing, choosing layouts..)

How smart is your keyboard?

 

The answer is.. it’s not. Why? Because it is cheaper to overwhelm you with fake advertisements and features than to actually pay developers to provide you with additional software that will liberate your keyboard into an actual 100+ key input device. This is one of the biggest and most contra productive problems of the today’s keyboard. Take a look at two general keys. Minus and plus. These two keys can be: volume keys, scrolling keys (horizontal/vertical), focused value increase/decrease keys, application switches.. and who knows what else if they were programmable. The point is. Your keyboard is STUPID. And the “brain” of any device is it’s driver. So… XGeek.org brings you a Programmable Keyboard Driver project as the first subproject of Free Input.

 

PS in case you are wondering about ergonomics this will also be covered in later articles.

PHP singleton util class for checking and returning valid boolean value for use in AMFPHP

February 6th, 2009

Seasoned Flash developers should note that PHP booleans are converted to strings as follows: true -> “1″, false -> “”. This can cause some confusion when inserting Flash booleans into a database; a simple workaround is $bool ? "true" : "false".

Taken from http://amfphp.org/docs/datatypes.html

As I had this problem with my Flex+AMFPHP project, I decided to write util class that will deal with this issue.

<?php
 
/**
 * This class is singleton class for checking and returning valid boolean value
 * for use in AMFPHP (or other remoting services).
 *
 * For more info on this problem refer to: http://amfphp.org/docs/datatypes.html
 *
 * Use Example:
 * $stringBool = BoolUtil::getInstance()->getBool(false,true); //returns "false"
 * $stringBool = BoolUtil::getInstance()->getBool(true,true); //returns "true"
 * $stringBool = BoolUtil::getInstance()->getBool(0,true); //returns "false"
 * $stringBool = BoolUtil::getInstance()->getBool("off",true); //returns "false"
 * $stringBool = BoolUtil::getInstance()->getBool("True",true); //returns "true"
 *
 *
 * @author Marko Kecman <mkecman[at]gmail.com>
 */
class BoolUtil {
 
    /** Checks a variable to see if it should be considered a boolean true or false.
     *     Also takes into account some text-based representations of true of false,
     *     such as 'false','N','yes','on','off', etc.
     * @author Samuel Levy <sam+nospam@samuellevy.com>
     * @modified by Marko Kecman <mkecman[at]gmail.com>
     * @param mixed $value The variable to check
     * @param bool $strict If set to false, consider everything that is not false to be true.
     * @return string The string representation of boolean equivalent or null
     */
    function getBool($value, $strict=false)
    {
        $out = null;
        // if not strict, we only have to check if something is false
        if (in_array($in,array('false', 'False', 'FALSE', 'no', 'No', 'n', 'N', '0', 'off','Off', 'OFF', false, 0, null), true))
        {
            $out = "false";
        }
 
        if ($strict)
        {
            // if strict, check the equivalent true values
            if (in_array($value,array('true', 'True', 'TRUE', 'yes', 'Yes', 'y', 'Y', '1','on', 'On', 'ON', true, 1), true))
            {
                $out = "true";
            }
        }
        else
        {
            // not strict? let the regular php bool check figure it out (will largely default to true)
            $out = ( $value ? "true" : "false" );
        }
        return $out;
    }
 
    function &getInstance ()
    // this implements the 'singleton' design pattern.
    {
        static $instance;
 
        if (!isset($instance)) {
            $c = __CLASS__;
            $instance = new $c;
        } // if
 
        return $instance;
 
    } // getInstance
 
}
?>

There is also problem with converting string to boolean in ActionScript. Check this example for classic string to boolean casting (as you would expect to work correctly):

 var test:Boolean = Boolean("false"); //returns true
var test:Boolean = Boolean("0"); //returns true
var test:Boolean = Boolean(""); //returns false

In order to avoid this issue, I wrote util class for ActionScript 3 that will do valid String to Boolean convert.

package org.xgeek.markokecman.business.util
{
	public class BoolUtil
	{
		public static function StringToBoolean ( value:String ) : Boolean
		{
			if ( value.toLowerCase() == "false" )
			{
				return false;
			}
			else
			if ( value.toLowerCase() == "true" )
			{
				return true;
			}
			else
			{
				return null;
			}
		}
 
	}
}

In next version, I’ll expand this class to something similar to PHP version above.

ActionScript 3 class to convert file size (in bytes) to human readable format

February 4th, 2009

Examples: 

FileSizeUtil.GetHumanFileSize(252163); //returns 264,56 KB

FileSizeUtil.GetHumanFileSize(4455290); //returns 4,24 MB

 

//////////////////////////////////////////////////

package org.xgeek.markokecman.business.util
{
	import mx.formatters.NumberFormatter; 
 
	public class FileSizeUtil
	{
		/**
		 * Function that converts file size (in bytes) to human readable format
		 *
		 *
		 */
		public static function GetHumanFileSize(value:Number):String
		{
			var s:Array = new Array('B', 'KB', 'MB', 'GB', 'TB');
	        if(value < 0){
	            return "0 " + s[0];
	        }
	        var con:Number = 1024;
	        var e:Number = logBase(value,con); 
 
	        var numberFormatter:NumberFormatter = new NumberFormatter();
	        numberFormatter.precision = 2;
	        numberFormatter.decimalSeparatorTo = ",";
	        numberFormatter.thousandsSeparatorTo = "."; 
 
	        var humanSize:String = numberFormatter.format(value/Math.pow(con,Math.floor(e))); 
 
	        return humanSize + ' ' + s[Math.floor(e)];
		} 
 
		/**
		 * Logarithm function with base parameter support
		 *
		 */
		private static function logBase (num:Number, base:Number):Number
		{
			if (base < 1) base = Math.E;
			return Math.log (num) / Math.log (base);
		}		
 
	}
}

Krishnamurti San Diego Talk

December 13th, 2008

“So, how are you to look at yourself - please do listen to this, it is quite absorbing. It demands a great deal of intelligence, it is great fun, much more fun than any book, than any religious entertainment, than any philosophy.” 

Krishnamurti San Diego 1970 Talk 1 :|

text

Piracetam II (Nootropics, part 2.5)

November 22nd, 2008

Piracetam and sleep

Although it has been mentioned many times that Piracetam affects sleep this can be rather misleading. In most cases taking Piracetam in the afternoon hours will expand considerably your awake time. Piracetam and most other nootropics actually work with your thought process and not your physical/metabolic systems. What does this mean in practice? It means that it is not coffee. By taking it if you actually need to be awake longer you will find it easier and will be much better focused during this time than without Piracetam. If you don’t actually need to stay awake you might be able to go to sleep. I’m saying might. Because, if you are already properly rested and took Piracetam in the last couple of hours it doesn’t matter if it’s night if you go to bed you will spend your time lying with your mind racing 100mph. If on the other hand you are tired, have no urgent reason to stay awake and go and lay down you could easily fall asleep. Xgeek team has tested this multiple times. Sleeping under effects of Piracetam is also a new cognitive experience. There is drastic increase in both recollection of dreams and lucid dreaming. Also since your brain is more active there is a big chance you will wake up as soon as you finish a needed number of sleep cycles. So the fact is don’t take Piracetam late if you don’t need it. Get your good night’s sleep and pick your battles.

Additional substance list

When taking any nootropic , as I said before, you should have a healthy extensive diet providing you with all the stuff your brain needs. With Piracetam a good idea is addition of B Vitamin complex and Choline. We will be talking much more about stacking but I will just mention that Piracetam is one of the most classical stack ingredients. I will not provide you with quick information about another nootropic for a synergy effect because each one has its own side-effects.

this article is part II of this one

Piracetam (Nootropics, part 2)

November 18th, 2008

Although my first encounters with nootropics come from a long time ago, my first contact with Piracetam is kind of fresh. While I have read absolutely everything there is about it, it took me a while to find it branded here at home. When I finally brought it in 400mg pills to the rest of the crew we were just off to the movies. Not a bad place to test a new drug, ey? A standard minimum dose (so we read) is 800mg, so we each took 2 pills and went on. By the time the movie was beginning so were the effects. Although an average, Hollywood, movie, the experience of it was completely new. The ability to follow the movie and laugh with it and at the same time fully and utterly absorb the multimillion budget breaking sound and video effects was astonishing. I remember every single moment of the movie even now (story-wise) but at the same time I can recall all the awesome scenes full of effects and sound.

The regular trip

If you heard of nootropics than you’ve heard of Piracetam. As a matter of fact, Piracetam is the original nootropic.  The first brand of Piracetam was/is named Nootropil and from there the whole category of “smart drugs” got its modern name. The name actually tells us a lot. It comes from Greek “noos” which means “mind” and “tropic” meaning “affecting”. It truly is mind-affecting when you take Piracetam. There are noticeable effects. While you will find all over the Internet comments like “.. is said to .. “, “..might be helping with..” and similar, I suspect the main reason for this is the fact that we don’t truly know how Piracetam works in full detail. One thing is for sure. Empirically tested, Piracetam does improve our cognitive abilities. This is not something way too drastic but it is more than enough to be measurable.  You will discover on regular basis after taking Piracetam that you will have increased focus and ability to analyze. There is also a barely noticeable, but consistent, increase in short term memory. All these effects are increasing during a two week, classic, regime.

Xgeek has found on multiple occasions that Piracetam affects levels of creativity. While not an easily quantifiable effect we all agree that the drug has proven its self for brainstorming, music learning and appreciation and other creative work.

Mechanism of action

On an enormous amount of websites older than a year you will find suggestions that Piracetam mostly affects cognition due to its ability to increase oxygen and blood supply to the brain. It is now more than obvious that the blood flow is mostly a side-effect of increased brain activity. It is shown in newer studies that Piracetam affects general excitability of neurons without effects on synaptic action and with low toxicity. You will find many explanations for this. Action on ion channels, electron transport, effects on membrane permeability. All of these come from different studies, so there is no general conclusion. One fact, though, is same. All double-blinded, placebo-controlled, studies have shown positive effects of Piracetam. It is now being sold all over the world and more and more students are using it for studying. For all this, Piracetam has been called “a drug in need of a diseases”. This demonstrates directly how wrong our accepting of nootropics is. We are still under the impression we should only help our self be as smart as the general, minimum, requirement. It is ok to prescribe a person with brain function problems a nootropic, but healthy people should not even know anything about it and should not take it. Aaah.. why??

Actual dangers

Sure, Piracetam is not toxic. I have even seen people taking 3g on the internet without problems. But, this doesn’t mean you can just shove it into yourself. While Piracetam, chemically, is not so dangerous for you, there is still a need for CAUTION. Taking any nootropic, like Piracetam and living an unhealthy life will drive your motor (brain) into excessive over burn. If you do not provide your brain all time with enough fuel and service, as well as upgrades, to be able to perform at this new level, you will wear it down. You can expect aggravation, irritation, lowered comprehension, loss of will to work.. simply all the mechanisms you use should be used properly or they will stop working. Proper regulation of food, sleep and mental rest should be carried with much greater, increased, care than normally when using nootropics.

continue reading Piracetam, part 2.

 

Why?

November 15th, 2008

Why? Why do we do all this you might ask your self? Well, the general answer for everyone doesn’t exist.  We are here to help you understand this vast world. I know why I am here. I am here to provide you with a new state of mind which will provide you with a new better future. I am not here to make you feel good. Not for a short time, certainly not for a long time. I am here to show you the path. Unfortunately no one can be told what the true way is. You have to see it, to believe it. If there is an itch bothering you. A silent presence of disturbance. Something that pulls you forward but makes you feel like you wish you are not moving. If you feel this way than don’t suppress it. Don’t think it’s not true. Let it go. There is more of us. And together we can make a global difference. But more importantly you can make your own difference. Once you are the one to help yourself than you can truly be happy. First you got to do YOUR job. If you were meant in this life to paint and you actually love to paint then.. paint. If you can paint but love to sing.. then draw your songs and make us cry. Don’t stop your growth. Don’t think it’s enough. The melancholia will burn you to death long before you are dead. Let yourself be free. Laugh at borders and smile at limits for they make the life just a little bit more interesting. There is no fear but your own and there is no stopping until you stop. Understand your space. Expand it. Create it. Be your master. Fight for the right of you and people similar to you. Allow for a new world to open. It is nothing but a second. Once you say to yourself - “ I am never going back. ” – you will never be the same. Maybe the world will look at you the same at first but everything requires effort. You cannot change the nature of things at the moment you wish it but you can change it by wishing it and doing it. If you have ever felt alone this is because you did not accept yourself. If you can’t accept yourself change who you are. GROW. Never be afraid to learn. Never be afraid to explore. Let your mind extend to new limits that need to be passed. If you ever allow yourself to think that it is too hard you haven’t even tried properly. For once you truly dedicate yourself. You will see. It is easy. It is the actual way to happiness. True happiness. No bitterness. No hidden regrets. Sure you will still get angry and sad and aggravated but it is up to you how you will handle it.  You should be happy who you are. It is all part of you. You cannot fight evil before you accept it’s there. You cannot grow before you accept you are small.

Brain enhancement Nootropics gallery

November 14th, 2008

 

A collection of Russian and Serbian brand Piracetam and a stimulant/Nootropic, Phenotropil (Phenylpiracetam)