greynode » Coding http://greynode.org ingénierie de tous les aspects de vie Fri, 15 Apr 2011 16:12:00 +0000 en hourly 1 http://wordpress.org/?v=3.1.1 HTTPService Over SSL Flex 4 http://greynode.org/2010/08/09/httpservice-over-ssl-flex-4/ http://greynode.org/2010/08/09/httpservice-over-ssl-flex-4/#comments Mon, 09 Aug 2010 22:23:28 +0000 enum http://blog.greynode.org/?p=240

Read the rest of this entry »

]]>
Using SSL for HTTPService communication and loading images is very easy in Flex 4. There are differences between using HTTPService over SSL and loading images over SSL, however neither is complicated.

Communication using HTTPService over SSL

  1. Host the flex 4 application on an SSL enabled host
  2. Ensure the application is loaded over SSL (i.e. the URL has https:// prefix)
  3. Make HTTPService.url a relative path to where the SWF is stored

Using SSL for mx:Image

Set the Image.source attribute to the full URL, including the https:// prefix, like so:

<mx:Image source="https://server.com/image.jpg"/>

]]>
http://greynode.org/2010/08/09/httpservice-over-ssl-flex-4/feed/ 0
Cartoon Shader using GLSL http://greynode.org/2010/05/14/cartoon-shader-using-glsl/ http://greynode.org/2010/05/14/cartoon-shader-using-glsl/#comments Fri, 14 May 2010 21:01:58 +0000 enum http://blog.greynode.org/?p=230

Read the rest of this entry »

]]>
Here is an example of a shader written in the OpenGL Shading Language (GLSL). It is very simple shader, only assigning 4 different color values, yet the result is pretty cool. I’ll post the link to the source code once I add it to my git repository.

For introductory material on GLSL, check out Lighthouse 3D (where I got this cartoon example). Also check out the orange book for more in-depth discussion and examples on shaders.

]]>
http://greynode.org/2010/05/14/cartoon-shader-using-glsl/feed/ 0
Ask comp.lang.c to Do Your Homework http://greynode.org/2010/05/11/ask-comp-lang-c-to-do-your-homework/ http://greynode.org/2010/05/11/ask-comp-lang-c-to-do-your-homework/#comments Wed, 12 May 2010 08:45:00 +0000 enum http://blog.greynode.org/?p=228 A funny post on comp.lang.c.

]]>
http://greynode.org/2010/05/11/ask-comp-lang-c-to-do-your-homework/feed/ 0
Why No Games on Linux? http://greynode.org/2010/05/11/why-no-games-on-linux/ http://greynode.org/2010/05/11/why-no-games-on-linux/#comments Tue, 11 May 2010 20:54:26 +0000 enum http://blog.greynode.org/?p=226 Thought I would share an interesting article on why there are no games on linux. Want more games on linux? Solve these problems!

]]>
http://greynode.org/2010/05/11/why-no-games-on-linux/feed/ 0
Python 2 to 3 http://greynode.org/2009/12/02/python-2-to-3/ http://greynode.org/2009/12/02/python-2-to-3/#comments Wed, 02 Dec 2009 18:11:12 +0000 enum http://greynode.org/?p=157

Read the rest of this entry »

]]>
Updating to Python 3? I found a nice cheat sheet by Mark Summerfield that shows a concise summary of the differences between Python 2 and Python 3, as well as some of the more common features of Python 3.

This document is freely available from InformIT’s website, but I have also mirrored it. Download the cheat sheet below.

Python2Python3.pdf from greynode.org

Python2Python3.pdf from InformIT’s site

]]>
http://greynode.org/2009/12/02/python-2-to-3/feed/ 0
Automake and Autoconf Made Simple http://greynode.org/2009/11/02/automake-and-autoconf-made-simple/ http://greynode.org/2009/11/02/automake-and-autoconf-made-simple/#comments Tue, 03 Nov 2009 08:15:14 +0000 enum http://greynode.org/?p=142

Read the rest of this entry »

]]>
Instead of randomly pasting configuration code from other projects when you decide you want to use automake/autoconf, just check out all you should really know about autoconf and automake. Albeit, it may not be comprehensive, but it should get you started.

]]>
http://greynode.org/2009/11/02/automake-and-autoconf-made-simple/feed/ 0
HTML 5 http://greynode.org/2009/10/30/html-5/ http://greynode.org/2009/10/30/html-5/#comments Sat, 31 Oct 2009 06:15:23 +0000 enum http://greynode.org/?p=137 Have you checked out HTML 5 yet? If not, here is a neat article explaining some of the basic ideas of HTML 5.

]]>
http://greynode.org/2009/10/30/html-5/feed/ 0
Ruby from Other Languages http://greynode.org/2009/10/25/ruby-from-other-languages/ http://greynode.org/2009/10/25/ruby-from-other-languages/#comments Mon, 26 Oct 2009 05:06:30 +0000 enum http://greynode.org/?p=134 I was just browsing around for some material on ruby and I found this page very helpful:

http://www.ruby-lang.org/en/documentation/ruby-from-other-languages/

It’s not a ruby bible or anything, but I think it is a good intro for experienced programmers.

]]>
http://greynode.org/2009/10/25/ruby-from-other-languages/feed/ 0
Prefixes for Binary Multiples http://greynode.org/2009/06/26/prefixes-for-binary-multiples/ http://greynode.org/2009/06/26/prefixes-for-binary-multiples/#comments Fri, 26 Jun 2009 21:57:47 +0000 enum http://greynode.org/?p=83

Read the rest of this entry »

]]>
I have become increasingly frustrated with people refusing to adopt the IEEE 1541-2002 standard. There is no real good reason why it should not be adopted. I think the most common argument I have heard against it is, “That’s stupid! The people who made that up are stupid! You’re stupid for using it!” That is to say, there are no very good arguments against it.

In fact the longer people continue to use the old terminology, the longer the hard drive manufacturers have to use the old terminology to rip off consumers. Did you ever wonder why your hard drive isn’t a full 80GiB? That’s because it said 80GB on the box.

Some argue that it makes no sense to have the extra terminology because computers operate using base 2. The problem with this argument is that the International Bureau of Weights and Measures published a paper in 1998 stating that SI prefixes should only be used with powers of 10.

I think anyone familiar with science understands the necessity for proper measurements. Without them, your data is bad. Let me present a quick example. Let’s say you were looking for a place to store copies of your digital movies. Your computer says they are 4.7GB (but it really means GiB), so you decide to get a 1TB hard drive in which you think you can store 1,000 / 4.7 = 212 full movies. However, the 1TB hard drive is really only 909GiB, which means you can only store about 193 movies. If you leave 20% free space to keep performance up, then that’s only 154 movies.

But the data on the hard drive box was not misrepresented, it was misunderstood. The reason it was misunderstood is because the neglect of the standard passes from the programmer to the average user via the software they use. There I said it, it is your fault programmers.

If you think you have a real reason why not to adopt it, please leave a comment.

A quick explanation of the standard, courtesy of wikipedia:

IEEE 1541 recommends:

  • a set of units to refer to quantities used in digital electronics and computing:
    • bit (symbol ‘b’), a binary digit;
    • byte (symbol ‘B’), a set of adjacent bits (usually, but not necessarily, eight) operated on as a group;
    • octet (symbol ‘o’), a group of eight bits;
  • a set of prefixes to indicate binary multiples of the aforesaid units:
    • kibi (symbol ‘Ki’), 2101024;
    • mebi (symbol ‘Mi’), 2201048576;
    • gibi (symbol ‘Gi’), 2301073741824;
    • tebi (symbol ‘Ti’), 2401099511627776;
    • pebi (symbol ‘Pi’), 2501125899906842624;
    • exbi (symbol ‘Ei’), 2601152921504606846976;
  • that the first part of the binary prefix is pronounced as the analogous SI prefix, and the second part is pronounced as bee;
  • that SI prefixes are not used to indicate binary multiples.
]]>
http://greynode.org/2009/06/26/prefixes-for-binary-multiples/feed/ 4
Multicore Programming Primer http://greynode.org/2009/06/26/multicore-programming-primer/ http://greynode.org/2009/06/26/multicore-programming-primer/#comments Fri, 26 Jun 2009 16:41:02 +0000 enum http://greynode.org/?p=79

Read the rest of this entry »

]]>
MIT has been offering free videos of various courses for quite a while now. Today I came across this video series on multicore programming. I haven’t watched but a few minutes of it so far, but I am hoping to watch all of them before the next semester starts if it proves to be useful in some way. It uses the PS3 framework — I am not sure if this poses an issue with using the videos yet.

]]>
http://greynode.org/2009/06/26/multicore-programming-primer/feed/ 0