<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>variable &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://wordpress.com/tag/variable/</link>
	<description>Feed of posts on WordPress.com tagged "variable"</description>
	<pubDate>Sun, 07 Sep 2008 23:09:41 +0000</pubDate>

	<generator>http://wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Değişkenler (Variables)]]></title>
<link>http://pythonileprogramlama.wordpress.com/?p=18</link>
<pubDate>Sun, 07 Sep 2008 09:53:23 +0000</pubDate>
<dc:creator>rimbi</dc:creator>
<guid>http://pythonileprogramlama.wordpress.com/?p=18</guid>
<description><![CDATA[Python&#8217;da değişken tanımlamak oldukça basit:
&gt;&gt;&gt; x = 3
Bu şekilde x değişkenin]]></description>
<content:encoded><![CDATA[<p>Python'da değişken tanımlamak oldukça basit:</p>
<blockquote><p>&#62;&#62;&#62; x = 3</p></blockquote>
<p>Bu şekilde x değişkenine atama yaptığımız anda değişken tipini de  tam sayı (integer) olarak belirlemiş oluyoruz. Söylediğimizi doğrulayalım:</p>
<blockquote><p>&#62;&#62;&#62; print x.__doc__<br />
int(x[, base]) -&#62; integer</p>
<p>Convert a string or number to an integer, if possible.  A floating point<br />
argument will be truncated towards zero (this does not include a string<br />
representation of a floating point number!)  When converting a string, use<br />
the optional base.  It is an error to supply a base when converting a<br />
non-string. If the argument is outside the integer range a long object<br />
will be returned instead.</p></blockquote>
<p>Python'da tam sayı (integer), kayan-noktalı sayı (floating point number), <a href="http://pythonileprogramlama.wordpress.com/2008/09/07/karakter-dizileri-strings/" target="_self">karakter dizileri (strings)</a> gibi bazı temel veri tipleri dışında çok kullanılan liste (list), sözlük (dictionary) ve tuple veri tipleri de mevcuttur. Ama bunlar başka yazıların konuları.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Día 18 "Variables no inicializadas en Python"]]></title>
<link>http://programacionpython.wordpress.com/?p=130</link>
<pubDate>Wed, 03 Sep 2008 18:50:31 +0000</pubDate>
<dc:creator>crizur</dc:creator>
<guid>http://programacionpython.wordpress.com/?p=130</guid>
<description><![CDATA[En Python, la primera operación sobre una variable debe ser la asignación de un valor. No se puede]]></description>
<content:encoded><![CDATA[<p>En Python, la primera operación sobre una variable debe ser la asignación de un valor. No se puede usar una variable a la que no se ha asignado previamente un valor.</p>
<p>Como puedes ver, se genera una excepción <strong>NameError</strong>, es decir, de “error de nombre”.</p>
<p>El texto explicativo precisa aún más lo sucedido “el nombre a no esta definido”.</p>
<p>La asignación de un valor inicial se denomina inicialización de la variable. Entonces <strong>en Python no es posible usar variables no inicializadas.</strong></p>
<p><code>&#62;&#62;&#62; a+2</code></p>
<p><code>Traceback (most recent call last):</p>
<p>  File "&#60;pyshell#0&#62;", line 1, in -toplevel-</p>
<p>    a+2</p>
<p></code></p>
<p><code>NameError: name 'a' is not defined</code></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Día 17 "Asignaciones con operador en Python"]]></title>
<link>http://programacionpython.wordpress.com/?p=124</link>
<pubDate>Tue, 02 Sep 2008 16:08:29 +0000</pubDate>
<dc:creator>crizur</dc:creator>
<guid>http://programacionpython.wordpress.com/?p=124</guid>
<description><![CDATA[Hola a todos quienes siguen este blog, he regresado, después de 2 meses sin post, he vuelto!!
Hoy h]]></description>
<content:encoded><![CDATA[<div>Hola a todos quienes siguen este blog, he regresado, después de 2 meses sin post, he vuelto!!</div>
<div>Hoy hablaremos sobre las asignaciones con operador.</div>
<div>Fíjate en la sentencia i=i+1 ; aplica un incremento unitario al contenido de la variable i.</div>
<div>Incrementar el valor de una variable en una cantidad cualquiera es tan frecuente que existe una forma compacta en Python. El incremento de i puede denotarse así:</div>
<div>&#62;&#62;&#62;<code> i+=1</code></div>
<div>No puede haber ningún espacio alguno entre el + y el = , Se puede incrementar una variable con cualquier cantidad, incluso con una que resulte de evaluar una expresión.</div>
<div><code>  </p>
<div>&#62;&#62;&#62; a=3</div>
<div>&#62;&#62;&#62; b=2</div>
<div>&#62;&#62;&#62; a+=4*b</div>
<div>&#62;&#62;&#62; a</div>
<div>11</div>
<p></code> </div>
<div>Todos los operadores aritméticos tienen su asignación con operador asociada.</div>
<div style="text-align:center;">z+=2</div>
<div style="text-align:center;">z-=2</div>
<div style="text-align:center;">z*=2</div>
<div style="text-align:center;">z/=2</div>
<div style="text-align:center;">z%=2</div>
<div style="text-align:center;">z**=2</div>
<div>Te informo que estas formas compactas no aportan en nada nuevo, salvo quizás alguna comodidad para algunos programadores más experimentados, así que no te preocupes de aprender todas estas formas compactas, incluso para que no te confundas ignóralas por el momento.</div>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Boxing and Unboxing in C Sharp (ver. 2.0 &amp; 3.0)]]></title>
<link>http://momuno.wordpress.com/2008/09/01/boxing-and-unboxing-in-c-sharp-ver-20-30/</link>
<pubDate>Mon, 01 Sep 2008 05:19:02 +0000</pubDate>
<dc:creator>aikea</dc:creator>
<guid>http://momuno.wordpress.com/2008/09/01/boxing-and-unboxing-in-c-sharp-ver-20-30/</guid>
<description><![CDATA[Boxing and Unboxing are the operations used to convert a value type to and from a reference type.
Bo]]></description>
<content:encoded><![CDATA[<p>Boxing and Unboxing are the operations used to convert a value type to and from a reference type.</p>
<p>Boxing operations create a new object then copy the value of the source variable into it.</p>
<p style="background:#f2f2f2;margin-left:28pt;"><span style="font-family:Courier New;"><span style="font-size:10pt;"><span style="color:blue;">int</span> i = 9;<br />
<span style="color:blue;">object</span> o = i; <span style="color:green;">// boxing</span></span><br />
<span style="font-size:10pt;">i = (<span style="color:blue;">int</span>) o; <span style="color:green;">// unboxing</span></span><br />
</span></p>
<p>Object o is an object contains value of 9. In background, during boxing operation, the system uses two different memory management methods to manage value type and reference type. All value types are placed "on the stack" and all reference types are placed "on the heap". After boxing each variable will have its own memory location. Change the value of one of them will new affect the value of the other, as illustrated in following example.</p>
<p style="background:#f2f2f2;margin-left:28pt;"><span style="font-size:10pt;font-family:Courier New;"><span style="color:blue;">int</span> i = 9;<br />
<span style="color:blue;">object</span> o = i;<br />
i = 10;<br />
<span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">"The value of variable i: {0}"</span>, i);<br />
<span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">"The value of variable o: {0}"</span>, o);<br />
<span style="color:green;">// outputs:<br />
// The value of variable i: 10<br />
// The value of variable o: 9<br />
</span></span></p>
<p>As variable o is an object, it inherits all characteristics of a reference type.</p>
<p>Unboxing conversion converts a reference type to its value type. The operation must be explicit and the reference type must be compatible with the target value type, an additional step has to be performed to check the type of the variable being converted.</p>
<p style="background:#f2f2f2;margin-left:28pt;"><span style="font-size:10pt;font-family:Courier New;"><span style="color:blue;">int</span> i = 9;<br />
<span style="color:blue;">object</span> o = i;<br />
<span style="color:blue;">int</span> j = 0;<br />
<span style="color:green;">// if o is an int type<br />
</span><span style="color:blue;">if</span> ( o <span style="color:blue;">is</span><br />
<span style="color:blue;">int</span>) j = (<span style="color:blue;">int</span>) o;<br />
<span style="color:#2b91af;">Console</span>.WriteLine(j);<br />
<span style="color:green;">// outputs: 9</span><br />
</span></p>
<p>Attempting to unbox a "null" or an incompatible type will cause an "InvalidCastException".</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Nullable Types in C Sharp (ver. 2.0 &amp; 3.0)]]></title>
<link>http://momuno.wordpress.com/2008/09/01/nullable-types-in-c-sharp-ver-20-30/</link>
<pubDate>Mon, 01 Sep 2008 04:59:32 +0000</pubDate>
<dc:creator>aikea</dc:creator>
<guid>http://momuno.wordpress.com/2008/09/01/nullable-types-in-c-sharp-ver-20-30/</guid>
<description><![CDATA[Nullable types are basicly the value types which are enabled to contain a null value.
Two ways to de]]></description>
<content:encoded><![CDATA[<p>Nullable types are basicly the value types which are enabled to contain a null value.</p>
<p>Two ways to define a nullable type:</p>
<p style="background:#f2f2f2;margin-left:28pt;"><span style="font-size:10pt;font-family:Courier New;">Nullable&#60;<span style="color:blue;">int</span>&#62; i;<br />
</span></p>
<p>Or:</p>
<p style="background:#f2f2f2;margin-left:28pt;"><span style="font-size:10pt;font-family:Courier New;"><span style="color:blue;">int</span>? i;<br />
</span></p>
<p>Both methods will create a nullable "int" variable. We can assign this variable's value to null or to any value with in the range of an "int" data type.</p>
<p style="background:#f2f2f2;margin-left:28pt;"><span style="font-size:10pt;font-family:Courier New;"><span style="color:blue;">int</span>? i;<br />
i = 1000; <span style="color:green;">// assign an integer value<br />
</span>i = <span style="color:blue;">null</span>; <span style="color:green;">// assign null</span><br />
</span></p>
<p>Nullable variables will have their "HasValue" property set to "true" when assigned a value other than null. We can use either "HasValue" or a simple equal comparation to determine whether a nullable variable is "null"</p>
<p style="background:#f2f2f2;margin-left:28pt;"><span style="font-size:10pt;font-family:Courier New;"><span style="color:blue;">int</span>? i;<br />
i = <span style="color:blue;">null</span>;<br />
<span style="color:blue;">if</span> ( i.HasValue) <span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">"Has value"</span>);<br />
<span style="color:blue;">if</span> ( i == <span style="color:blue;">null</span>) <span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">"Variable is null"</span>);<br />
<span style="color:green;">// outputs: Variable is null</span><br />
</span></p>
<p>Once we have determined that a nullable variable contains a value other than "null", we can use either the variable's "Value" property or just the variable itself to extract its value.</p>
<p style="background:#f2f2f2;margin-left:28pt;"><span style="font-size:10pt;font-family:Courier New;"><span style="color:blue;">int</span>? i = 10;<br />
<span style="color:blue;">if</span> ( i.HasValue)<br />
{<br />
<span style="color:#2b91af;"> Console</span>.WriteLine(i); <span style="color:green;">// outputs: 10<br />
</span><span style="color:#2b91af;"> Console</span>.WriteLine(i.Value); <span style="color:green;">// outputs: 10<br />
</span>}<br />
</span></p>
<p>Using a nullable variable without assigning it a value will always produce a compilation error in Visual Studio.</p>
<p style="background:#f2f2f2;margin-left:28pt;"><span style="font-size:10pt;font-family:Courier New;"><span style="color:blue;">int</span>? i;<br />
<span style="color:blue;">if</span> ( i.HasValue) <span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">"Has value"</span>);<br />
<span style="color:blue;">if</span> ( i == <span style="color:blue;">null</span>) <span style="color:#2b91af;">Console</span>.WriteLine(<span style="color:#a31515;">"Variable is null"</span>);<br />
<span style="color:red;">Compilation Error: Use of unassigned local variable "i"<br />
</span></span></p>
<p>A nullable variable has one important method which is "GetValueOrDefault()". It returns the value of the variable if the variable is not null or if the variable is null it returns the default value of the variable's underlying data type.</p>
<p style="background:#f2f2f2;margin-left:28pt;"><span style="font-size:10pt;font-family:Courier New;"><span style="color:blue;">int</span>? i = <span style="color:blue;">null</span>;<br />
<span style="color:green;">// the default value of int data type is: 0<br />
</span><span style="color:#2b91af;">Console</span>.WriteLine(i.GetValueOrDefault()); <span style="color:green;">// outputs: 0<br />
</span>i = 10;<br />
<span style="color:#2b91af;">Console</span>.WriteLine(i.GetValueOrDefault()); <span style="color:green;">// outputs: 10</span><br />
</span></p>
<p>When a boolean value is made nullable, it is capable of having three values: true, false and null. This is very useful in some situations. However, nullable boolean variables can not be used in conditional operations, it has to be casted to non-nullable boolean type first. When casting if the nullable boolean variable contains value "null", the casting will fail and produce an "InvalidOperationException". It is a good practice to always check the variable's "HasValue" property before casting.</p>
<p style="background:#f2f2f2;margin-left:28pt;"><span style="font-size:10pt;font-family:Courier New;"><span style="color:blue;">bool</span>? b = <span style="color:blue;">null</span>;<br />
<span style="color:green;">// check whether b is null<br />
</span><span style="color:blue;">if</span> ( b.HasValue)<br />
{<br />
<span style="color:green;">// before conditional operation<br />
// cast b to non-nullable boolean type<br />
</span><span style="color:blue;">if</span> ( (<span style="color:blue;">bool</span>) b)<br />
{<br />
<span style="color:green;">// execute this code block when b is true<br />
</span>}<br />
}<br />
<span style="color:blue;">else<br />
</span>{<br />
<span style="color:green;">// execute this code block when b is null<br />
</span>}<br />
</span></p>
<p>A nullable variable is actually a package. The content of the package is the underlying data type of the  variable. The wrapper of the package is a class which contains the underlying data type and provides nullable operations to the variable. When a nullable variable is boxed or unboxed it is its underlying data type that participates the boxing and unboxing operation, only the content not the whole package.</p>
<p>This does not make much difference when boxing and unboxing a variable. We can just use the variable as it is whether it is nullable or not. The only thing need to keep in mind is that when the nullable variable is "null", the boxing operation will create a new object and assign the object with value "null".</p>
<p style="background:#f2f2f2;margin-left:28pt;"><span style="font-size:10pt;font-family:Courier New;"><span style="color:blue;">bool</span>? b = <span style="color:blue;">null</span>;<br />
<span style="color:blue;">object</span> o = b; <span style="color:green;">// boxing<br />
</span>b = (<span style="color:blue;">bool</span>?) o; <span style="color:green;">// unboxing</span></span></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Un texte de 32 767 caractères passé au crible]]></title>
<link>http://thesasreference.wordpress.com/?p=448</link>
<pubDate>Mon, 01 Sep 2008 04:00:13 +0000</pubDate>
<dc:creator>The SAS Reference</dc:creator>
<guid>http://thesasreference.wordpress.com/?p=448</guid>
<description><![CDATA[La quantité d&#8217;espace alloué pour une observation dans un data set SAS peut aller jusqu]]></description>
<content:encoded><![CDATA[<p>La quantité d'espace alloué pour une observation dans un data set SAS peut aller jusqu'à 32 767 octets (<em>byte </em>en anglais). Pour m'amuser, j'ai voulu tester. Pour ce faire, j'ai procédé en trois étapes :</p>
<ul>
<li>J'ai créé une variable de 32 767 caractères et j'ai imprimé sa seule valeur dans un fichier .TXT.</li>
<li>Puis, j'ai voulu voir comment se déroulait le passage de 32 767 caractères d'un fichier .TXT dans une seule observation d'un data set SAS.</li>
<li>Enfin, pour visualiser le tout, j'ai imprimé cette observation dans un fichier .RTF.</li>
</ul>
<p><strong>Note </strong>: La longueur (<em>length</em>) est le mot utilisé en SAS pour parler de la quantité d'espace alloué à une observation. Seules les variables de type caractères (<em>character</em>) peuvent avoir jusqu'à 32 767 octets. Les variables numériques en ont, en effet, 8 au maximum.  Un octet permet de stocker un caractère d'une variable texte. Pour plus de précisions sur l'octet, reportez-vous à l'article "<a href="http://thesasreference.wordpress.com/2008/07/28/byte/">9 points autour de la notion d'octet</a>".</p>
<p><strong>Note</strong> : La longueur allouée est identique pour toutes les observations d'une même variable. Par défaut, seuls 8 octets sont attribués. Cette valeur est changeable. Il s'agit de modifier l'attribut LENGTH d'une variable donnée dans un data step. La valeur est définie soit à l'instruction LENGTH, soit à l'instruction ATTRIB.</p>
<p><strong><span style="color:#ff6600;">1. Imprimer 32 767 caractères dans un fichier .TXT</span></strong></p>
<p>Dans l'exemple ci-dessous, un fichier .TXT est créé. Il contient 32 767 caractères venant d'une seule et même observation.</p>
<p><strong>Une instruction LENGTH définissant le type et la longueur de la variable</strong> : Dans cet exemple, une variable TEST_VAR est créée. Il s'agit d'une variable caractère. Une longueur de 32 767 lui est assignée avec l'instruction LENGTH. Elle pourra donc contenir jusqu'à 32 767 octets par record.</p>
<p><strong>Taper plus de 32 000 caractères, c'est long mais il y a la fonction REPEAT pour nous sauver</strong> : La valeur prise par le premier record de la variable TEST_VAR est donnée. J'ai choisi de répéter la lettre a 32 766 fois. Je dis bien 32 766 fois et non 32 765 fois car la fonction REPEAT ajoute à la valeur initiale 'a' 32 765 autres 'a', soit 32 765 + 1.</p>
<p><strong>Ajouter un dernier caractère à notre valeur</strong> : A ces 32 766 lettres 'a', j'ai ajouté la lettre 'b' en faisant une concaténation grâce aux deux barres verticales. De cette manière, il sera possible de visualiser l'absence de coupure faite par SAS.</p>
<p><span style="font-family:Courier New;"><span style="color:#0000ff;">filename</span> lgth_max <span style="color:#800080;">'C:/sasref/lgth_max.txt'</span>;</span><br />
<span style="font-family:Courier New;"><strong><span style="color:#000080;">data</span></strong> _null_;<br />
   <span style="color:#0000ff;">file</span> lgth_max;<br />
   <span style="color:#0000ff;">length</span> test_var $ <span style="color:#008080;"><strong>32767</strong></span>;<br />
   test_var=repeat(<span style="color:#800080;">'a'</span>,<span style="color:#008080;"><strong>32765</strong></span>)&#124;&#124;<span style="color:#800080;">'b'</span>;<br />
   <span style="color:#0000ff;">put</span> test_var;<br />
<span style="color:#000080;"><strong>run</strong></span>;</span><br />
<span style="font-family:Courier New;"><span style="color:#0000ff;">filename</span> lgth_max clear;</span></p>
<p><strong>Ecrire le contenu de la variable dans un fichier externe</strong> : pour écrire les 32 767 caractères dans un fichier externe, SAS a besoin de trois instructions.</p>
<ul>
<li><strong>Ecrire du texte avec l'instruction PUT</strong> : L'instruction PUT est exécutée pour chaque observation de la variable TEST_VAR, c'est-à-dire une fois dans notre cas.</li>
<li><strong>Diriger un texte vers une autre destination que la log avec l'instruction FILE</strong> : La valeur prise par la variable TEST_VAR est écrite dans un autre fichier. Cet autre fichier est désigné de manière indirecte dans l'instruction FILE. Je dis de manière indirecte car seul un nom figure dans l'instruction FILE, un nom désignant un fichier préalablement défini. On parle de FILEREF.</li>
<li><strong>Caractériser un fichier de destination avec l'instruction FILENAME</strong> : Le FILEREF désignant la destination du texte à imprimer est défini dans l'instruction FILENAME. A la fin du programme, ce nom servant d'intermédiaire est supprimé pour pouvoir resservir et ainsi désigner un autre fichier ou chemin d'accès.</li>
</ul>
<p><strong>Pas besoin de créer un data set SAS ici</strong> : Dans le cas présent, nous avons besoin d'une étape DATA pour exécuter ce code mais nous n'avons pas besoin de créer un data set. Pour épargner la tâche de création d'un data set, le nom _NULL_ remplace le nom d'un data set.</p>
<p><strong><span style="color:#ff6600;">2. Créer un data set SAS</span></strong></p>
<p><strong>Lire les données contenues dans un fichier externe</strong> : Une variable TEST_NEW est créée dans un data set nommé TEST_DS. Elle est de type caractère comme l'indique le symbole dollar ($) présent dans l'instruction INPUT.</p>
<p>Avant d'entrer une valeur dans cette variable, la longueur maximale autorisée est définie dans l'instruction LENGTH. Comme il s'agit d'une variable caractère, il faut ajouter le dollar.</p>
<p>Au lieu de saisir manuellement les valeurs dans le data step en introduisant le mot DATALINES, une instruction INFILE désigne le fichier où sont stockées les données.</p>
<p><span style="font-family:Courier New;"><strong><span style="color:#000080;">data</span></strong> test_ds;<br />
   <span style="color:#0000ff;">infile</span> <span style="color:#800080;">'C:/sasref/lgth_max.txt'</span>;<br />
   <span style="color:#0000ff;">length</span> test_new $ <span style="color:#008080;"><strong>32767</strong></span>;<br />
   <span style="color:#0000ff;">input</span> test_new $;<br />
<strong><span style="color:#000080;">run</span></strong>;</span></p>
<p><strong>Vérifier la valeur prise par l'attribut LENGTH de la variable TEST_NEW</strong> :  La procédure PROC CONTENTS donnera un aperçu des caractéristiques des variables du data set TEST. Bref, cette procédure donnera accès aux méta données (<strong>metadata</strong> ou données sur les données). Cela comprend la longueur allouée à la variable TEST_NEW et le type de la variable (caractère dans ce cas précis).</p>
<p><span style="font-family:Courier New;"><strong><span style="color:#000080;">proc contents</span></strong> <span style="color:#0000ff;">data</span>=test_ds;<br />
<strong><span style="color:#000080;">run</span></strong>;</span></p>
<p><strong><span style="color:#ff6600;">3. Visualiser le data set dans un fichier .RTF</span></strong></p>
<p>Seuls les 128 premiers caractères sont imprimables dans la fenêtre OUTPUT. Par contre, vous pouvez envisager d'autres destinations comme un fichier .RTF. Dans l'exemple, on joue avec les instructions ODS (Output Delivery System).</p>
<ul>
<li>D'une part, la redirection vers la fenêtre output est stoppée le temps de l'impression, via les instructions ODS LISTING.</li>
<li>D'autre part, les 32 767 caractères sont envoyés dans un fichier .RTF grâce aux instructions ODS RTF.</li>
</ul>
<p><span style="font-family:Courier New;"><span style="color:#0000ff;">ods listing close</span>;<br />
<span style="color:#0000ff;">ods rtf</span> <span style="color:#0000ff;">file</span>=<span style="color:#800080;">'C:/sasref/lgth_max.rtf'</span>;<br />
<span style="color:#000080;"><strong>proc print</strong> </span><span style="color:#0000ff;">data</span>=test_ds;<br />
<strong><span style="color:#000080;">run</span></strong>;<br />
<span style="color:#0000ff;">ods rtf close</span>;<br />
<span style="color:#0000ff;">ods listing</span>;</span></p>
<p><strong><span style="color:#ff6600;">Pours les curieux</span></strong> : Changez la longueur pour 32 768 et expérimentez en direct les limites de SAS.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[SQL SERVER - 2008 - Introduction to Table-Valued Parameters with ...]]></title>
<link>http://sqlzosup.wordpress.com/?p=9</link>
<pubDate>Sun, 31 Aug 2008 13:48:46 +0000</pubDate>
<dc:creator>sqlzosup</dc:creator>
<guid>http://sqlzosup.wordpress.com/?p=9</guid>
<description><![CDATA[Table-Valued Parameters is a new feature introduced in SQL SERVER 2008. In earlier versions of SQL S]]></description>
<content:encoded><![CDATA[<p>Table-Valued Parameters is a new feature introduced in SQL SERVER 2008. In earlier versions of SQL SERVER it is not possible to pass a table variable in stored procedure as a parameter, but now in SQL SERVER 2008 we can use Table-Valued ...<br>blog.sqlauthority.com</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Known bugs in TOW 0.3.0 alpha 1]]></title>
<link>http://traconwindows.wordpress.com/?p=43</link>
<pubDate>Thu, 28 Aug 2008 05:20:30 +0000</pubDate>
<dc:creator>yeoupooh</dc:creator>
<guid>http://traconwindows.wordpress.com/?p=43</guid>
<description><![CDATA[So far known bugs in TOW 0.3.0 alpha 1 is listed here.

Another Python installation may conflict err]]></description>
<content:encoded><![CDATA[<p>So far known bugs in TOW 0.3.0 alpha 1 is listed here.</p>
<ul>
<li>Another Python installation may conflict error. (reported from LEE Munyoung)<br />
=&#62; Solution: Use PYTHONHOME variable instead of PYTHON_HOME.</li>
<li>Error in add-perm, list-perm, remove-perm scripts. (reported from kermi)<br />
=&#62; Solution: Edit scripts like below</li>
</ul>
<p style="padding-left:30px;"><strong>Fixed add-perm.bat file</strong></p>
<blockquote><p><span style="color:#000000;">@echo off</span></p>
<p>call set-tow.bat</p>
<p>if "%3"=="" goto usage</p>
<p>call trac-admin %1 permission add %2 %3 %4 %5 %6 %7 %8 %9</p>
<p>goto end</p>
<p>:usage<br />
call lang ADD_REMOVE_PERM_USAGE %0</p>
<p>:end</p></blockquote>
<p style="padding-left:30px;"><strong>Fixed list-perm.bat file<br />
</strong></p>
<blockquote><p>@echo off</p>
<p>call set-tow.bat</p>
<p>if "%1"=="" goto usage</p>
<p>call trac-admin %1 permission list %2 %3 %4 %5 %6 %7 %8 %9</p>
<p>goto end</p>
<p>:usage<br />
call lang LIST_PERM_USAGE %0</p>
<p>:end</p></blockquote>
<p style="padding-left:30px;"><strong>Fixed remove-perm.bat file<br />
</strong></p>
<blockquote><p>@echo off</p>
<p>call set-tow.bat</p>
<p>if "%3"=="" goto usage</p>
<p>call trac-admin %1 permission remove %2 %3 %4 %5 %6 %7 %8 %9</p>
<p>goto end</p>
<p>:usage<br />
call lang ADD_REMOVE_PERM_USAGE %0</p>
<p>:end</p></blockquote>
<p>This bugs will be fixed in next release.<br />
Thank you reporters.</p>
<blockquote>
<p style="padding-left:90px;">
</blockquote>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Jugando con jBPM #10 - Variables Instances]]></title>
<link>http://salaboy.wordpress.com/?p=217</link>
<pubDate>Wed, 27 Aug 2008 17:22:22 +0000</pubDate>
<dc:creator>salaboy</dc:creator>
<guid>http://salaboy.wordpress.com/?p=217</guid>
<description><![CDATA[Este post tiene como objetivo profundizar sobre la customizacion de almacenamiento de variables de p]]></description>
<content:encoded><![CDATA[<p>Este post tiene como objetivo profundizar sobre la customizacion de almacenamiento de variables de procesos.</p>
<p>(Documentación oficial: <a title="Custom Variable Persistence" href="http://docs.jboss.com/jbpm/v3.2/userguide/html/context.html#customizingvariablepersistence" target="_blank">http://docs.jboss.com/jbpm/v3.2/userguide/html/context.html#customizingvariablepersistence</a>)</p>
<p>La primer pregunta que nos surge es, <strong>cuando necesitamos customizar como se almancenan las variables en jBPM?</strong></p>
<p>A decir verdad, es una buena pregunta. Vamos a empezar haciendo referencia a la documentación oficial en cuanto a las variables que dicen estar soportadas por jBPM para su almacenamiento automático:</p>
<div class="itemizedlist">
<ul type="disc">
<li><tt class="literal">java.lang.String</tt></li>
<li><tt class="literal">java.lang.Boolean</tt></li>
<li><tt class="literal">java.lang.Character</tt></li>
<li><tt class="literal">java.lang.Float</tt></li>
<li><tt class="literal">java.lang.Double</tt></li>
<li><tt class="literal">java.lang.Long</tt></li>
<li><tt class="literal">java.lang.Byte</tt></li>
<li><tt class="literal">java.lang.Short</tt></li>
<li><tt class="literal">java.lang.Integer</tt></li>
<li><tt class="literal">java.util.Date</tt></li>
<li><tt class="literal">byte[]</tt></li>
<li><tt class="literal">java.io.Serializable</tt></li>
<li><tt class="literal">classes that are persistable with hibernate</tt></li>
</ul>
<p>Supuestamente estos tipos de variable son fácilmente persistibles por jBPM y no debemos cambiar ninguna configuración para que las variables simplemente se persistan.</p></div>
<div class="itemizedlist">De los tipos basicos de datos (String, Boolean, Float, Double, Long, Byte, Short, Integer, Date y byte[]) podemos pensar que hibernate los resuelve directamente fijandose en los mapeos de los tipos de datos especificos para cada base de datos en particular. Y de los dos ultimos tipos (java.io.Serializable y hibernate classes) podemos pensar que vamos a necesitar alguna configuracion especial.</div>
<div class="itemizedlist">Pero no, ya que el motor de jBPM  para todos los tipos de variable va a revisar el archivo jbpm.varmappings.xml y transformara los objetos de usuario (todos los de la lista anterior) a objetos de tipo VariableInstance, que son objetos que actualmente se encuentran mapeados con Hibernate (mediante un hbm).</div>
<div class="itemizedlist">Para esta transformación se necesitan dos cosas importantes, los matchers y los converters. (JbpmTypeMatcher, Converter dos interfaces importantes en el paquete: org.jbpm.context.exe)</div>
<div class="itemizedlist">Estas dos interfaces (JbpmTypeMatcher, Converter) deben ser implementadas en el caso que necesitemos algun tipo nuevo de VariableInstance para nuestro caso particular. Como vemos en la documentacion oficial, los tipos de VariableInstance que tenemos por defecto son los siguientes:</div>
<div class="itemizedlist">
<div class="itemizedlist">
<ul type="disc">
<li><tt class="literal">DateInstance</tt> (with one java.lang.Date        field that is mapped to a <tt class="literal">Types.TIMESTAMP</tt> in the        database)</li>
<li><tt class="literal">DoubleInstance</tt> (with one java.lang.Double        field that is mapped to a <tt class="literal">Types.DOUBLE</tt> in the        database)</li>
<li><tt class="literal">StringInstance</tt> (with one java.lang.String        field that is mapped to a <tt class="literal">Types.VARCHAR</tt> in the        database)</li>
<li><tt class="literal">LongInstance</tt> (with one java.lang.Long       field that is mapped to a <tt class="literal">Types.BIGINT</tt> in the        database)</li>
<li><tt class="literal">HibernateLongInstance</tt> (this is used for        hibernatable types with a long id field. One java.lang.Object field is mapped        as a reference to a hibernate entity in the database)</li>
<li><tt class="literal">HibernateStringInstance</tt> (this is used for        hibernatable types with a string id field. One java.lang.Object field is mapped        as a reference to a hibernate entity in the database)</li>
<li>ByteArrayInstance que misteriosamente no aparece en la documentacion</li>
</ul>
</div>
<div class="itemizedlist">Por lo tanto si empezamos a ver como es la secuencia de funcionamiento, llegamos a la conclusion de que cuando llamamos al metodo <strong>setVariable</strong>, el objeto de usuario va a ser opcionalmente convertido con el converter apropiado segun el matcher que coincida en el archivo jbpm.varmappings.xml. Cuando nostros estemos customizando este archivo, tenemos que tener cuidado porque el mismo se revisa en orden secuencial, por lo tanto, hay que ver que nuestro tipo custom no matchee con ningun otro matcher antes que el nuestro.</div>
<div class="itemizedlist">Toda esta interaccion de matchers y converters ocurre dentro de la clase VariableInstance y el metodo createVariableInstance que es invocado cada vez que se llama el metodo <strong>setVariable</strong> mensionado anteriormente.</div>
<div class="itemizedlist">public static VariableInstance createVariableInstance(Object value) {<br />
VariableInstance variableInstance = null;</p>
<p>Iterator iter = JbpmType.getJbpmTypes().iterator();<br />
while ( (iter.hasNext())<br />
&#38;&#38; (variableInstance==null) ){<br />
JbpmType jbpmType = (JbpmType) iter.next();</p>
<p>if (jbpmType.matches(value)) {<br />
variableInstance = jbpmType.newVariableInstance();<br />
}<br />
}</p>
<p>if (variableInstance==null) {<br />
variableInstance = new UnpersistableInstance();<br />
}</p>
<p>return variableInstance;<br />
}</p></div>
<div class="itemizedlist">Otro clase que juega un papel importante aca es JbpmType:</div>
<div class="itemizedlist">public JbpmType(JbpmTypeMatcher jbpmTypeMatcher, Converter converter, Class variableInstanceClass) {<br />
this.jbpmTypeMatcher = jbpmTypeMatcher;<br />
this.converter = converter;<br />
this.variableInstanceClass = variableInstanceClass;<br />
}</div>
<div class="itemizedlist">Ya que podemos observar como se crea engloba al matcher, al converter y al tipo de la clase que estamos por crear el VariableInstance.</div>
<div class="itemizedlist"></div>
<div class="itemizedlist">Para no extender mucho mas el post, termino dando tres aclaraciones que considero importantes:</div>
<div class="itemizedlist">
<ul>
<li>Vamos a tener que crear un nuevo VariableInstance cuando necesitemos persistir algun objeto de dominio (negocio) con algun mapeo poco comun. Espero tener tiempo y poder postear un ejemplo de eso, asi queda claro que seria un mapeo poco comun.</li>
<li>Para nuestros objetos de dominio que tengamos o decidamos mapear con hibernate de la forma mas comun (hbms), siempre y cuando agreguemos los hbms al archivo hibernate.cfg.xml, los objetos seran automaticamente persistidos por hibernate.</li>
<li>Para nuestros objetos que no esten mapeados con hibernate pero esten marcados como serializables, estos seran transformados como indica el matcher en jbpm.varmappings.xml a ByteArrayInstance y se guardaran en forma binaria en la base de datos.</li>
</ul>
</div>
</div>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Je garde ou je jette? les variables]]></title>
<link>http://thesasreference.wordpress.com/?p=417</link>
<pubDate>Mon, 25 Aug 2008 06:00:37 +0000</pubDate>
<dc:creator>The SAS Reference</dc:creator>
<guid>http://thesasreference.wordpress.com/?p=417</guid>
<description><![CDATA[Pour garder ou supprimer sous SAS des variables, il y a les mots-clés KEEP (garder) et DROP (enleve]]></description>
<content:encoded><![CDATA[<p>Pour garder ou supprimer sous SAS des variables, il y a les mots-clés KEEP (garder) et DROP (enlever). Sélectionner les variables nécessaires par la suite et seulement celles-ci est très important. Cela fait partie des outils pour améliorer la performance d'un programme tant en terme de temps d'exécution que le volume demandé pour stocker les data sets. Voici plus en détails, et avec des exemples, l'utilisation de ce vocabulaire qui s'applique au data step, aux procédures et à la syntaxe de l'ODS OUTPUT.</p>
<p><strong><span style="color:#ff6600;">1. L'option dans un data step</span></strong></p>
<p>Les mots KEEP et DROP servent principalement en tant qu'option appliquée à un data set donné. Elles sont alors listées juste après le nom du data set entre parenthèses et sont suivies du signe égal :</p>
<ul>
<li><a href="http://support.sas.com/onlinedoc/913/getDoc/de/lrdict.hlp/a000131144.htm">Keep= Data Set Option</a> : nom_du_dataset (keep=nom_var1 nom_var2 etc)</li>
<li><a href="http://support.sas.com/onlinedoc/913/getDoc/de/lrdict.hlp/a000131113.htm">Drop= Data Set Option</a> : nom_du_dataset (drop=nom_var1 nom_var2 etc)</li>
</ul>
<p><strong>Exemple 1</strong> : une instruction SET</p>
<p><span style="font-family:Courier New;"><span style="color:#000080;"><strong>data</strong></span> class (drop=weight: height:);<br />
   <span style="color:#0000ff;">set</span> sashelp.class (keep=name weight height);<br />
   weight_kg = weight*<span style="color:#008080;"><strong>0.45359237</strong></span>;<br />
   height_m  = height*<span style="color:#008080;"><strong>0.0254</strong></span>;<br />
   bmi       = weight_kg/height_m**<span style="color:#008080;"><strong>2</strong></span>;<br />
<strong><span style="color:#000080;">run</span></strong>;</span></p>
<p>Dans le cas présent, les variables NAME (nom), WEIGHT (poids) et HEIGHT (taille) sont lues dans le fichier d'origine SASHELP.CLASS et gardées. De nouvelles variables sont calculées pour avoir un poids en kilogramme (WIEGHT_KG) et une taille en mètres (HEIGHT_M). A partir du poids et de la taille, l'indicateur de masse corporelle (BMI) est calculé. Les variables, dont le nom commence par WEIGHT et HEIGHT, ne sont plus nécessaires par la suite. Elles sont donc supprimée dans le data set final appelé CLASS.</p>
<p>Soit le mot KEEP, soit le mot DROP est donné en option mais pas les deux afin d'éviter les confusions. Le choix entre KEEP et DROP dépend souvent du nombre de variables à lister par la suite. C'est donc un choix purement pratique.</p>
<p><strong>Note, Indice de masse corporelle</strong> : L'indice de masse corporel (Body Mass Index, BMI) est égal au poids divisé par la taille au carré (poids/taille<sup>2</sup>). Le site de l'Organisation Mondiale de la Santé (<a href="http://www.who.int/bmi/index.jsp?introPage=intro_3.html">World Health Organisation</a>, WHO) donne des précisions sur le sujet.</p>
<p><strong>Note, Conversion des unités de mesures</strong> (source <a href="http://fr.wikipedia.org/wiki/Conversion_des_unités">Wikipedia</a>) : je suppose que la taille donnée dans le fichier SASHELP.CLASS est exprimée en pouces (inches) et que le poids est exprimé en livres (pounds). Sachant qu'un pouce est égal à 2,54 cm et qu'une livre est égale à 0,45359237 kg, les tailles et poids du premier exemple ont pu être convertis en mètres et kilos.</p>
<p><strong>Exemple 2</strong> : une instruction MERGE</p>
<p><span style="font-family:Courier New;"><strong><span style="color:#000080;">data</span></strong> age_ae;<br />
   <span style="color:#0000ff;">merge</span> ae      (<span style="color:#0000ff;">in</span>=ref keep=name ae_id ae_sev)<br />
         patient (keep=name age);<br />
   <span style="color:#0000ff;">by</span> name;<br />
   <span style="color:#0000ff;">if</span> ref;<br />
<strong><span style="color:#000080;">run</span></strong>;</span></p>
<p>Dans ce second exemple, les patients ayant eu un effet secondaire (adverse event, AE) sont enregistrés dans le data set AE. Chaque effet secondaire est identifié de manière unique par les variables NAME et AE_ID. La sévérité de l'effet secondaire nous intéresse dans le data set AE.</p>
<p>A cette information, est ajouté l'âge du patient disponible dans la variable AGE du data set PATIENT.</p>
<p>La variable commune aux deux data sets est NAME. Il faut donc qu'elle reste dans les deux data sets. Seuls les patients ayant eu un effet secondaire sont sélectionnés grâce à l'option IN.</p>
<p>Pour tester l'exemple, vous trouverez en fin d'article un code créant les fichiers PATIENT et AE.</p>
<p><strong>NOTE</strong> : Une variable utilisée par une autre option du data set comme RENAME ou WHERE ne pourra pas être supprimée au même moment.</p>
<p><span style="color:#ff6600;"><strong>2. Quelques exemples de procédures</strong></span></p>
<p>Dans une procédure, elles suivent le nom du data set d'entrée et/ou du data set de sortie. Aucun autre mot ne doit être inséré entre le nom du data set et les options entre parenthèses.</p>
<ul>
<li>proc sort data=... () out=...();</li>
<li>proc print data=... () width=min;</li>
<li>proc transpose data=...() out=...() prefix=visit;</li>
<li>proc freq data=...();</li>
<li>proc report data=...() split='#';</li>
<li>proc tabulate data=...()</li>
<li>proc gplot data=...()</li>
<li>proc boxplot data=...()</li>
<li>proc univariate data=...()</li>
<li>proc ttest data=...()</li>
<li>etc.</li>
</ul>
<p>La procédure SQL liste les variables à garder après le mot SELECT. Il n'y a pas à ce stade d'option pour supprimer les variables. Par contre, on peut affiner la sélection après que le data set final soit créé. Bien sûr, le temps de lecture est augmenté puisque toutes les variables sont lues pour créer le data set et non un sous-ensemble.</p>
<p><span style="font-family:Courier New;"><strong><span style="color:#000080;">proc sql</span></strong>;<br />
   <span style="color:#0000ff;">create</span> <span style="color:#0000ff;">table</span> test (drop=ae_sdt ae_edt) <span style="color:#0000ff;">as</span><br />
      <span style="color:#0000ff;">select</span> <span style="color:#008080;">a.</span>*, age<br />
      <span style="color:#0000ff;">from</span> ae a<br />
      left join<br />
           patient b<br />
      <span style="color:#0000ff;">on</span> a.name=b.name;<br />
<strong><span style="color:#000080;">quit</span></strong>;</span></p>
<p><strong>NOTE</strong> : L'option WHERE est très pratique lorsqu'on en peut faire une sélection que sur le résultat de la fusion.</p>
<p><span style="font-family:Courier New;"><strong><span style="color:#000080;">proc sql</span></strong>;<br />
   <span style="color:#0000ff;">create table </span>test (<span style="color:#0000ff;">where</span>=(ae_sev=<span style="color:#008080;"><strong>1</strong></span> or age=<span style="color:#008080;"><strong>12</strong></span>)) <span style="color:#0000ff;">as<br />
</span>      <span style="color:#0000ff;">select</span> <span style="color:#008080;">a.</span>*, age<br />
      <span style="color:#0000ff;">from</span> (<span style="color:#0000ff;">select</span> name, ae_id, ae_sev<br />
            <span style="color:#0000ff;">from</span> ae) a<br />
      left join<br />
           (<span style="color:#0000ff;">select</span> name, age<br />
            <span style="color:#0000ff;">from</span> patient) b<br />
      <span style="color:#0000ff;">on</span> a.name=b.name;<br />
<strong><span style="color:#000080;">quit</span></strong>;</span></p>
<p><strong><span style="color:#ff6600;">3. L'option dans l'ODS OUTPUT</span></strong></p>
<p>Les sorties générées par une procédure sont redirigeables vers un data set via l'instruction ODS OUTPUT. Le nom de la sortie est alors suivi du signe égal et du nom du data set de destination. Après ce nom les options sont ajoutables.</p>
<p><span style="font-family:Courier New;"><span style="color:#0000ff;">ods exclude all</span>;<br />
<span style="color:#0000ff;">ods output</span> onewayfreqs=exemple_ods (keep=age frequency percent);<br />
<span style="color:#000080;"><strong>proc freq</strong></span> <span style="color:#0000ff;">data</span>=sashelp.class;<br />
<span style="color:#0000ff;">   table</span> age;<br />
<strong><span style="color:#000080;">run</span></strong>;<br />
<span style="color:#0000ff;">ods output</span> clear;<br />
<span style="color:#0000ff;">ods exclude none</span>;</span></p>
<p>Deux articles sur l'ODS OUTPUT sont déjà à votre disposition</p>
<ul>
<li><a href="http://www.sasreference.fr/2008/07/31/onewayfreqs/">Un tableau à une dimension avec PROC FREQ et l'ODS OUTPUT</a></li>
<li><a href="http://www.sasreference.fr/2008/07/24/ods_proc_means/">Diriger les sorties d'un PROC MEANS dans un data set SAS</a></li>
</ul>
<p><strong><span style="color:#ff6600;">4. Les instructions KEEP et DROP dans un data step</span></strong></p>
<p>En plus des options KEEP et DROP, il existe les instructions KEEP (<a href="http://support.sas.com/onlinedoc/913/getDoc/de/lrdict.hlp/a000202978.htm">KEEP Statement</a>) et DROP (<a href="http://support.sas.com/onlinedoc/913/getDoc/de/lrdict.hlp/a000202902.htm">Drop Statement</a>) pouvant être exécutées dans un data step. <strong>L'important ici est de se souvenir que l'instruction s'applique à la fin du data step, une fois que le data set final est créé</strong>. Ainsi il n'est pas possible de supprimer une variable en milieu de programme pour ensuite créer une autre variable du même nom.</p>
<p><span style="font-family:Courier New;"><strong><span style="color:#000080;">data</span></strong> class (drop=i);<br />
   <span style="color:#0000ff;">do</span> i=<span style="color:#008080;"><strong>0</strong></span> <span style="color:#0000ff;">to</span> <span style="color:#008080;"><strong>3</strong></span>;<br />
      <span style="color:#0000ff;">output</span>;<br />
   <span style="color:#0000ff;">end</span>;<br />
   <span style="color:#0000ff;">do</span> i=<span style="color:#008080;"><strong>10</strong></span> <span style="color:#0000ff;">to</span> <span style="color:#008080;"><strong>12</strong></span>;<br />
      <span style="color:#0000ff;">output</span>;<br />
   <span style="color:#0000ff;">end</span>;<br />
<strong><span style="color:#000080;">run</span></strong>;</span></p>
<p><span style="font-family:Courier New;"><strong><span style="color:#000080;">data</span></strong> class;<br />
  <span style="color:#0000ff;"> do </span>i=<span style="color:#008080;"><strong>0</strong></span> <span style="color:#0000ff;">to</span> <span style="color:#008080;">3</span>;<br />
      <span style="color:#0000ff;">output</span>;<br />
   <span style="color:#0000ff;">end</span>;<br />
   <span style="color:#0000ff;">drop</span> i;<br />
   <span style="color:#0000ff;">do</span> i=<strong><span style="color:#008080;">10</span></strong><span style="color:#0000ff;"> to </span><span style="color:#008080;"><strong>12</strong></span>;<br />
      <span style="color:#0000ff;">output</span>;<br />
   end;<br />
<strong><span style="color:#000080;">run</span></strong>;</span></p>
<p>Les deux exemples ci-dessus font le même travail. La variable I n'apparaîtra pas dans le data set final car elle est supprimée en fin de programme.</p>
<p><strong><span style="color:#ff6600;">Lectures complémentaires</span></strong> : Outre les options KEEP et DROP, le programmeur utilisera souvent les options <a href="http://support.sas.com/onlinedoc/913/getDoc/de/lrdict.hlp/a000131169.htm">RENAME</a> et <a href="http://support.sas.com/onlinedoc/913/getDoc/de/lrdict.hlp/a000131192.htm">WHERE</a> et de temps en temps les options  <a href="http://support.sas.com/onlinedoc/913/getDoc/de/lrdict.hlp/a000131129.htm">FIRSTOBS</a> et <a href="http://support.sas.com/onlinedoc/913/getDoc/de/lrdict.hlp/a000131154.htm">OBS</a>. Pour une liste complète des options, consultez la documentation en ligne : <a href="http://support.sas.com/onlinedoc/913/getDoc/de/lrdict.hlp/a002295655.htm">SAS Data Set Option</a>.</p>
<p>Après savoir comment supprimer les variables et donc les colonnes d'un data set SAS, vous serez peut-être intéressé de savoir comment supprimer ou garder certaines lignes d'un data set avec les mots-clés DELETE (<a href="http://support.sas.com/onlinedoc/913/getDoc/de/lrdict.hlp/a000201996.htm">DELETE Statement</a>) et OUTPUT (<a href="http://support.sas.com/onlinedoc/913/getDoc/de/lrdict.hlp/a000194540.htm">OUTPUT Statement</a>).</p>
<p><strong><span style="color:#ff6600;">Annexe</span></strong> : Créer les data sets PATIENT et AE pour tester l'exemple avec MERGE.</p>
<p><span style="font-family:Courier New;"><strong><span style="color:#000080;">data</span></strong> patient;<br />
   <span style="color:#0000ff;">set</span> sashelp.class;<br />
<strong><span style="color:#000080;">run</span></strong>;</span></p>
<p><span style="font-family:Courier New;"><strong><span style="color:#000080;">data</span></strong> ae;<br />
   <span style="color:#0000ff;">set</span> sashelp.class (keep=name);<br />
   <span style="color:#0000ff;">if</span> name=<span style="color:#800080;">'Thomas'</span> <span style="color:#0000ff;">then</span><br />
      <span style="color:#0000ff;">do</span>;<br />
         ae_id  = <span style="color:#008080;"><strong>1</strong></span>;<br />
         ae_sdt = <span style="color:#008080;"><strong>'21MAR2007'd</strong></span>;<br />
         ae_edt = <span style="color:#008080;"><strong>'28APR2007'd</strong></span>;<br />
         ae_sev = <strong><span style="color:#008080;">3</span></strong>;<br />
         <span style="color:#0000ff;">output</span>;<br />
         ae_id  = <strong><span style="color:#008080;">2</span></strong>;<br />
         ae_sdt = <strong><span style="color:#008080;">'03JUN2007'd</span></strong>;<br />
         ae_edt = <span style="color:#008080;"><strong>'19JUN2007'd</strong></span>;<br />
         ae_sev = <span style="color:#008080;"><strong>1</strong></span>;<br />
         <span style="color:#0000ff;">output</span>;<br />
     <span style="color:#0000ff;"> end</span>;<br />
<strong><span style="color:#000080;">run</span></strong>;</span></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Unvernünftige Primzahlen - Warum die Wurzel einer Primzahl nie rational sein kann]]></title>
<link>http://gedankenglas.wordpress.com/?p=24</link>
<pubDate>Thu, 21 Aug 2008 12:25:03 +0000</pubDate>
<dc:creator>leuchtzwiebel</dc:creator>
<guid>http://gedankenglas.wordpress.com/?p=24</guid>
<description><![CDATA[Für die Liebhaber des heimlichen Geliebten meiner Mitbloggerin (  ) hier eine kleine mathematische ]]></description>
<content:encoded><![CDATA[<p>Für die Liebhaber des heimlichen Geliebten meiner Mitbloggerin ( ;) ) hier eine kleine mathematische Spielerei von mir. Wie der Titel schon sagt, handelt es sich hier um den Beweis dafür, dass die Wurzel einer jeden Primzahl irrational ist. Wer Logik-und/oder Rechtschreibfehler findet, darf sie behalten oder sie mir meinetwegen auch mitteilen, ganz wie ihr wünscht. Mit dem Beweis sind mir zwar vermutlich schon ein paar Andere zuvorgekommen, aber den hier habe ich nicht geklaut. ;)</p>
<p>Behauptung: "Die Wurzel einer jeden Primzahl ist irrational."</p>
<p>Was tun, wenn man diesen Satz beweisen will? Ich liste als Erstes gern die Eigenschaften der genannten Zahlen auf:</p>
<p>1.: Irrationale Zahlen können nicht als Quotient zweier ganzer Zahlen dargestellt werden.</p>
<p>2.: Primzahlen gehören zur Menge der natürlichen Zahlen und...</p>
<p>3.: ...lassen sich nur durch 1 und sich selbst glatt teilen, daraus folgt:</p>
<p>4.: Die Wurzel einer Primzahl ist niemals ganz.</p>
<p>Für's Erste fallen mir keine weiteren Eigenschaften ein, also geht es weiter mit dem zweiten Schritt. Ich habe die Richtigkeit dieses Satzes mit einem sogenannten Widerspruchsbeweis bewiesen, das bedeutet, ich habe sein Gegenteil angenommen und gezeigt, dass es falsch ist.</p>
<p>In diesem Fall wäre das die Aussage "Es gibt Primzahlen, deren Wurzel rational ist."</p>
<p>Um das zu überprüfen, benutzen wir eine Gleichung mit ein paar Variablen. Die Primzahl bezeichnen wir mit dem Buchstaben p; die Wurzel von p drücken wir als rationale Zahl, also als Bruch m/n aus. m steht hier für eine ganze und n für eine natürliche Zahl. (Der Grund dafür, warum keine ganze, sondern eine natürliche Zahl im Nenner steht, liegt darin, dass die Menge der ganzen Zahlen die Null beinhaltet; die natürlichen Zahlen aber nicht. Nicht vergessen: Die Teilung durch Null ist nicht definiert!)</p>
<p>So sieht unsere Anfangsgleichung aus:</p>
<p>sqrt(p) = m/n</p>
<p>Als Nächstes habe ich sie ein wenig umgeformt und die Wurzel herausquadriert, sodass nun Folgendes in der Gleichung steht:</p>
<p>p = (m/n)^2 = m^2/n^2</p>
<p>Wir können aus der Tatsache, dass die Wurzel einer Primzahl nie ganz ist, schlussfolgern, dass m nicht durch n teilbar ist; ansonsten würde m/n eine ganze Zahl ergeben.</p>
<p>Daraus folgt, dass auch m^2 nicht durch n und damit auch nicht durch n^2 teilbar ist. Das würde wiederum bedeuten, dass p keine ganze Zahl ist. Da wir p jedoch am Anfang als Primzahl und somit auch als ganze Zahl festgelegt haben, entsteht hier ein Widerspruch, der uns sagt, dass die Wurzel einer Primzahl niemals rational sein darf, also stets irrational ist.</p>
<p>Q.E.D. (denk ich mal...)</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[J'ai pris l'air... de Lanaudière!]]></title>
<link>http://richard3.wordpress.com/?p=1105</link>
<pubDate>Tue, 19 Aug 2008 00:54:16 +0000</pubDate>
<dc:creator>Richard3</dc:creator>
<guid>http://richard3.wordpress.com/?p=1105</guid>
<description><![CDATA[Quoi faire, par un beau dimanche après-midi, quand un impondérable empêche de réaliser l&#8217;a]]></description>
<content:encoded><![CDATA[<p>Quoi faire, par un beau dimanche après-midi, quand un impondérable empêche de réaliser l'activité prévue?  Dans mon cas, ce fut de sauter dans la bagnole, et de partir faire un tour, qui m'a mené à différents endroits, dans la ravissante région de Lanaudière.  Les premières photos furent toutes prises sur le territoire de la ville de Jolette.</p>
<p><a href="http://richard3.files.wordpress.com/2008/08/003o.jpg"><img class="alignnone size-full wp-image-1106" src="http://richard3.wordpress.com/files/2008/08/003o.jpg" alt="" width="615" height="461" /></a></p>
<p><em><span style="color:#800080;">Je ne sais pas si le MTQ a oublié de faire installer la supersignalisation, mais en attendant, on a tout simplement utilisé un panneau à message variable (PMV), sur lequel on a indiqué que la rue Ernest-Harnois est désormais accessible, en prenant la sortie 12,...</span></em></p>
<p><a href="http://richard3.files.wordpress.com/2008/08/006o.jpg"><img class="alignnone size-full wp-image-1107" src="http://richard3.wordpress.com/files/2008/08/006o.jpg" alt="" width="615" height="461" /></a></p>
<p><em><span style="color:#800080;">...que voici.  Nous sommes sur l'autoroute Antonio-Barrette, mieux connue comme étant l'A-31.</span></em></p>
<p><a href="http://richard3.files.wordpress.com/2008/08/009o.jpg"><img class="alignnone size-full wp-image-1108" src="http://richard3.wordpress.com/files/2008/08/009o.jpg" alt="" width="615" height="461" /></a></p>
<p><em><span style="color:#800080;">J'ai décidé, une fois sorti de l'autoroute, de me rendre tout au bout de la nouvelle rue.  Alors d'intersection en intersection, j'ai finalement abouti à la toute fin de la rue Samuel-Racine Est.  Les véhicules que l'on voit, au loin, circulent à vive allure, sur la route 131.</span></em></p>
<p><a href="http://richard3.files.wordpress.com/2008/08/012o.jpg"><img class="alignnone size-full wp-image-1109" src="http://richard3.wordpress.com/files/2008/08/012o.jpg" alt="" width="615" height="461" /></a></p>
<p><em><span style="color:#800080;">Voici l'endroit où la nouvelle rue Samuel-Racine croise la route 158 (chemin des Prairies), tout juste au sud de l'échangeur A-31/QC-131/QC-158.  De l'autre côté de la route 158, on voit, au loin, la traverse de chemin de fer...</span></em></p>
<p><a href="http://richard3.files.wordpress.com/2008/08/015o.jpg"><img class="alignnone size-full wp-image-1110" src="http://richard3.wordpress.com/files/2008/08/015o.jpg" alt="" width="615" height="461" /></a></p>
<p><em><span style="color:#800080;">...que voici, cette fois vue de plus près.  Si vous avez l'impression que la traverse ne fait pas toute la largeur de la rue, dites-vous bien que ce n'est pas une impression.  La nouvelle rue Samuel-Racine Ouest a été réalisée sur un ancien chemin privé, qui donnait accès à un poste de distribution d'Hydro-Québec, de là la différence de largeur.</span></em></p>
<p><a href="http://richard3.files.wordpress.com/2008/08/018o.jpg"><img class="alignnone size-full wp-image-1111" src="http://richard3.wordpress.com/files/2008/08/018o.jpg" alt="" width="615" height="461" /></a></p>
<p><em><span style="color:#800080;">Ici, nous regardons vers le nord, sur la rue Ernest-Harnois, et la rue qui passe au bout, c'est la rue Samuel-Racine Ouest.</span></em></p>
<p><a href="http://richard3.files.wordpress.com/2008/08/019o.jpg"><img class="alignnone size-full wp-image-1112" src="http://richard3.wordpress.com/files/2008/08/019o.jpg" alt="" width="615" height="461" /></a></p>
<p><em><span style="color:#800080;">Quand on se retourne vers le sud, on voit la rue Ernest-Harnois qui s'étend sur une bonne longueur.</span></em></p>
<p><a href="http://richard3.files.wordpress.com/2008/08/024o.jpg"><img class="alignnone size-full wp-image-1113" src="http://richard3.wordpress.com/files/2008/08/024o.jpg" alt="" width="615" height="461" /></a></p>
<p><em><span style="color:#800080;">À ce niveau, la rue Ernest-Harnois est asphaltée, et existe depuis un peu plus longtemps.  Nous voyons ici l'intersection avec la rue Nazaire-Laurin.</span></em></p>
<p><a href="http://richard3.files.wordpress.com/2008/08/030o.jpg"><img class="alignnone size-full wp-image-1114" src="http://richard3.wordpress.com/files/2008/08/030o.jpg" alt="" width="615" height="461" /></a></p>
<p><em><span style="color:#800080;">Un peu au sud de la rue Nazaire-Laurin, toujours sur la rue Ernest-Harnois, une toute nouvelle rue, qui ne porte pas encore de nom.  Allons voir où elle mène.</span></em></p>
<p><a href="http://richard3.files.wordpress.com/2008/08/027o.jpg"><img class="alignnone size-full wp-image-1115" src="http://richard3.wordpress.com/files/2008/08/027o.jpg" alt="" width="615" height="461" /></a></p>
<p><em><span style="color:#800080;">Cette rue sans nom se rend, finalement, jusqu'au chemin Lasalle.  Cette intersection se trouve à quelques dizaines de mètres au nord de la limite de Saint-Thomas-de-Joliette.</span></em></p>
<p><a href="http://richard3.files.wordpress.com/2008/08/033o.jpg"><img class="alignnone size-full wp-image-1116" src="http://richard3.wordpress.com/files/2008/08/033o.jpg" alt="" width="615" height="461" /></a></p>
<p><em><span style="color:#800080;">De retour sur la rue Ernest-Harnois, à l'extrémité sud de celle-ci, où la rue se transforme en échangeur partiel.  La nouvelle sortie Ernest-Harnois, de l'A-31, n'existe qu'en direction nord, afin de mieux desservir le parc industriel du secteur du chemin Lasalle.  L'intersection du chemin Lasalle et de la route 158 n'est pas du tout conçue pour les camions-remorques, et cet échangeur partiel vient améliorer grandement l'accès à ce parc industriel, qui est d'ailleurs en pleine expansion.</span></em></p>
<p><a href="http://richard3.files.wordpress.com/2008/08/036o.jpg"><img class="alignnone size-full wp-image-1117" src="http://richard3.wordpress.com/files/2008/08/036o.jpg" alt="" width="615" height="461" /></a></p>
<p><em><span style="color:#800080;">Pendant que je me trouve à Joliette, autant en profiter pour prendre en photo la route 158, à la hauteur du chemin Base-de-Roc, là où l'énorme échangeur de ce qui devait être l'A-50 prend forme.  La dernière fois que j'ai photographié cet endroit, c'était en plein hiver, et on ne voyait pas les voies rapides centrales, parce qu'elles étaient ensevelies sous la neige.</span></em></p>
<p><a href="http://richard3.files.wordpress.com/2008/08/039o.jpg"><img class="alignnone size-full wp-image-1118" src="http://richard3.wordpress.com/files/2008/08/039o.jpg" alt="" width="615" height="461" /></a></p>
<p><em><span style="color:#800080;">En mettant le zoom à la position la plus éloignée, on voit bien les voies rapides se couper, ainsi que le viaduc sur lequel passe l'A-31, et sous lequel tout l'espace nécessaire pour construire les voies rapides était disponible.</span></em></p>
<p><a href="http://richard3.files.wordpress.com/2008/08/041o.jpg"><img class="alignnone size-full wp-image-1119" src="http://richard3.wordpress.com/files/2008/08/041o.jpg" alt="" width="615" height="461" /></a></p>
<p><em><span style="color:#800080;">Chemin faisant, j'ai remarqué ce panneau d'arrêt, qui n'est là que pour... la forme!  Je veux dire, une chance qu'il n'y a que les panneaux d'arrêt qui ont cette forme octogonale, sinon, on se demanderait bien de quoi il s'agit.  Photo prise à l'intersection du rang de la Grande Chaloupe, à Saint-Thomas-de-Joliette.</span></em></p>
<p><a href="http://richard3.files.wordpress.com/2008/08/046o.jpg"><img class="alignnone size-full wp-image-1120" src="http://richard3.wordpress.com/files/2008/08/046o.jpg" alt="" width="615" height="461" /></a></p>
<p><span style="color:#800080;"><em>Vous voyez cette intersection.  Eh bien, regardez-la comme il le faut, car elle va se transformer!  En effet, le MTQ vient de lancer l'appel d'offres pour sa reconstruction, avec feux de circulation, voies de virage à gauche, etc.  Ça devrait se faire cet automne.</em></span></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Completar variables con espacios a la izquierda]]></title>
<link>http://danielpanaro.wordpress.com/2008/08/16/completar-variables-con-espacios-a-la-izquierda/</link>
<pubDate>Sat, 16 Aug 2008 15:25:16 +0000</pubDate>
<dc:creator>Daniel Panaro</dc:creator>
<guid>http://danielpanaro.wordpress.com/2008/08/16/completar-variables-con-espacios-a-la-izquierda/</guid>
<description><![CDATA[Es común que en nuestras tareas diarias nos pidan generar archivos con algún formato en particular]]></description>
<content:encoded><![CDATA[<p>Es común que en nuestras tareas diarias nos pidan generar archivos con algún formato en particular. Para luego ser levantado por un aplicativo fuera de SAP.</p>
<p>Y&#160; es probable que nos pidan que ciertos campos los completemos con espacios en blanco adelante (a la izquierda). Por lo tanto acá dejo una sentencia ABAP para completar con espacios:</p>
<hr>
<p>DATA: lv_dato(14) TYPE C.
<p>lv_dato = 'HOLA'.
<p><font color="#0000ff"><strong>*-&#62; Con esta sentencia la variable lv_dato queda con 10 espacios en blanco y luego la palabra HOLA</strong></font> <br><strong>SHIFT lv_dato RIGHT DELETING TRAILING SPACE.</strong>
<p><strong></strong>&#160;
<p><strong><a href="http://help.sap.com/saphelp_nw70/helpdata/en/9f/db999535c111d1829f0000e829fbfe/content.htm" target="_blank">Para saber más sobre la sentencia SHIFT...</a> </strong></p>
<hr> <span style="font-size:85%;"><a href="http://technorati.com/">Technorati tags:</a><a href="http://technorati.com/tag/sdn%20blogger" rel="tag"><font color="red"> sdn blogger</font></a></span></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[[PHP] Use urls like index.php?mode=submit]]></title>
<link>http://matthewgall.wordpress.com/?p=20</link>
<pubDate>Thu, 14 Aug 2008 21:11:26 +0000</pubDate>
<dc:creator>Matthew Gall</dc:creator>
<guid>http://matthewgall.wordpress.com/?p=20</guid>
<description><![CDATA[Time for another tutorial&#8230;.. This time in saving files from your applications (which could be ]]></description>
<content:encoded><![CDATA[<p>Time for another tutorial..... This time in saving files from your applications (which could be used for form submission etc). In this tutorial, we are going to use the PHP $_GET[''] feature to obtain the mode parameter from the URL and act upon it's content. As with all URL based parameters, <strong>be sure to sanitise the data before doing anything with the data!</strong></p>
<p>1) In the top of the file that will use the ?mode= parameter we need to add the $_GET[''] function to get the data :D</p>
<blockquote><p><strong>$<em>mode</em> = $_GET['<em>mode</em>'];</strong></p></blockquote>
<p><em>(Note: customise the bits in italics)</em></p>
<p>2) Now the function will grab the data :D, now this is the time we sanitise the data, if you are passing variables, but we can increase security if we look for specific values.....</p>
<blockquote><p><strong>if ($mode != "submit") {<br />
                                    // What we want to display if it DOESN'T match<br />
                                    }<br />
elseif ($mode == "submit) {<br />
                                           // What we want it to do if it MATCHES!<br />
                                           }</strong></p></blockquote>
<p>Sorted, Have fun and enjoy using the expanding and exciting world of PHP :D</p>
<p><em>Waves,<br />
Matthew Gall</em></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Tipe Data, Variabel dan Konstanta]]></title>
<link>http://ccasp.wordpress.com/?p=65</link>
<pubDate>Mon, 28 Jul 2008 05:57:24 +0000</pubDate>
<dc:creator>cha</dc:creator>
<guid>http://ccasp.wordpress.com/?p=65</guid>
<description><![CDATA[Tipe Data
Tipe data dalam bahasa Java ada tiga, yaitu:
1.Tipe data primitive
Yaitu tipe data standar]]></description>
<content:encoded><![CDATA[<h3>Tipe Data</h3>
<p>Tipe data dalam bahasa Java ada tiga, yaitu:</p>
<p>1.Tipe data primitive<br />
Yaitu tipe data standar yang sudah tedefinisi di Bahasa pemprograman atau Java disini. Tipe data ini ada tiga jenis, yaitu Numerik(berbentuk kata atau bilangan, misalnya iinteger, double, float, dst), Karakter(berbentuk deretan karakter ataupun karakter tunggal ) dan Logika(bernilai true atau false). Lebih jelasnya:<!--more--></p>
<table border="1" cellpadding="3">
<tbody>
<tr>
<td><strong>Nama</strong></td>
<td><strong>Deklarasi</strong></td>
<td><strong>Memori (Byte)</strong></td>
<td><strong>Jangkauan Nilai</strong></td>
</tr>
<tr>
<td>Byte</td>
<td><strong>byte</strong></td>
<td>1</td>
<td>-128-127</td>
</tr>
<tr>
<td>Boolean</td>
<td><strong>boolean</strong></td>
<td>1</td>
<td><strong>True or False</strong></td>
</tr>
<tr>
<td>Character</td>
<td><strong>char</strong></td>
<td>1</td>
<td>0 sd 65,535</td>
</tr>
<tr>
<td>Short</td>
<td><strong>short</strong></td>
<td>2</td>
<td>-32,768 sd 32,767</td>
</tr>
<tr>
<td>Integer</td>
<td><strong>int</strong></td>
<td>4</td>
<td>2,147,483,648 sd 2,147,483,647</td>
</tr>
<tr>
<td>Long</td>
<td><strong>long</strong></td>
<td>8</td>
<td>-9,223,372,036,854,775,808 sd 9,223,372,036,854,775,807</td>
</tr>
<tr>
<td>Float</td>
<td><strong>float</strong></td>
<td>4</td>
<td>-3.4E38 sd 3.4E38</td>
</tr>
<tr>
<td>Double</td>
<td><strong>double</strong></td>
<td>8</td>
<td>-1.7E308 sd 1.7E308</td>
</tr>
</tbody>
</table>
<p>2. Tipe Data Referensi<br />
Yaitu tipe data yang bereferensi pada suatu kelas yang dibuat, didefinisikan dan di beri tingkah laku sebelumnya.</p>
<p>3. Tipe Data Array,<br />
Yaitu variable yang menyimpan sekumpulan data</p>
<p>memilih variable memang tidak begitu dirasakan bedanya walaupun menggunakan double, misalnya padahal menggunakan float pun cukup. Namun, jika kita berhubungan dengan program besar, ataupun dengan memori terbatas, misalnya Mikrokontroller pemilihan variable sangat perlu.</p>
<h3>Variable dan Konstanta</h3>
<p>Variable adalah suatu simbol ataupun nama yang memiliki nilai dan dapat berubah. Variable di sini bisa juga diartikan istilah bagi lokasi memori yang ditetapkan untuk menyimpan data tertentu, sehingga istilah atau nama dari variable ini merujuk pada nama bagi lokasi memori tersebut. Penulisan variable menggunakan huruf kecil pada awal, biasanya…. Sedangkan konstanta ialah nilai dari variable itu sendiri. Jadi, variable itu tempat berupa memori sedangkan kostanta itu isinya berupa numeric.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Día 15 "Variables y Asignaciones en Python"]]></title>
<link>http://programacionpython.wordpress.com/?p=108</link>
<pubDate>Tue, 22 Jul 2008 04:34:08 +0000</pubDate>
<dc:creator>crizur</dc:creator>
<guid>http://programacionpython.wordpress.com/?p=108</guid>
<description><![CDATA[En ocasiones deseamos que nuestro programa recuerde ciertos valores para usarlos más adelantes, por]]></description>
<content:encoded><![CDATA[<div>En ocasiones deseamos que nuestro programa recuerde ciertos valores para usarlos más adelantes, por ejemplo necesitamos realizar un programa que calcule el perímetro de un circulo, en este programa necesitaremos una variable llamada pi.</div>
<div>Una variable es una estructura que contiene datos y recibe un nombre único dado por el programador, mantiene los datos asignados a ella hasta que un nuevo valor se le asigne o hasta que el programa termine.</div>
<div>El acto de dar un valor a una variable se le denomina asignación, al asignar un valor a una variable que no existía, python reserva un espacio en la memoria, almacena el valor en él y crea una asociación entre el nombre de la variable y la dirección de memoria de dicho espacio.</div>
<div><code>  </p>
<div>&#62;&#62;&#62; pi = 3.14</div>
<div>&#62;&#62;&#62; r = 1.2</div>
<div>&#62;&#62;&#62; perimetro =2*pi*r</div>
<p></code> </p>
<div>
<div>Debes tener en cuenta que las asignaciones son mudas, es decir, no provocan salida por pantalla, si deseamos ver cuánto vale una variable, podemos evaluar una expresión que sólo contiene a dicha variable.</div>
<div><code>  </p>
<div>&#62;&#62;&#62; perimetro</div>
<div>7.5359999999999996</div>
<p></code> </p>
<div>
<div>Así pues, para asignar valor a una variable basta ejecutar una sentencia como ésta:</div>
<div style="text-align:center;"><strong>v</strong><strong>ariable = expresión</strong></div>
<div>Ten cuidado, el orden es importante, hacer expresión = variable, no es equivalente.</div>
<div>Una asignación no es una ecuación matemática, sino consiste en evaluar la expresión a la derecha del símbolo igual (=), y guardar el valor resultante en la variable indicada a la izquierda del símbolo igual.</div>
<div>Se puede asignar valor a una misma variable cuantas veces se quiera, el efecto es que la variable, en cada instante, sólo recuerda el ultimo valor asignado, hasta que se le asigne otro valor.</div>
<div><code>  </p>
<div>&#62;&#62;&#62; a=1</div>
<div>&#62;&#62;&#62; 2*a</div>
<div>2</div>
<div>&#62;&#62;&#62; a+1</div>
<div>2</div>
<div>&#62;&#62;&#62; a=3</div>
<div>&#62;&#62;&#62; a+a</div>
<div>6</div>
<p></code>Post realizado gracias al libro "Introducci</div>
</div>
</div>
</div>
</div>
]]></content:encoded>
</item>
<item>
<title><![CDATA[درس : الدوال Functions في لغة php]]></title>
<link>http://ebncana.wordpress.com/?p=50</link>
<pubDate>Thu, 10 Jul 2008 19:21:40 +0000</pubDate>
<dc:creator>EbNCaNa</dc:creator>
<guid>http://ebncana.wordpress.com/?p=50</guid>
<description><![CDATA[السلام عليكم ورحمة والله وبركاته
اخواني اخوتي اليوم در]]></description>
<content:encoded><![CDATA[<p>السلام عليكم ورحمة والله وبركاته</p>
<p>اخواني اخوتي اليوم درسنا عن موضوع مهم في في عالم php وهو يتمحور حول الدوال في هذه اللغة او ما يعرف بالانجليزية او الاسم العلمي functions ... الكثير من البرمجيات الناجحة تستعمل الداول للعديد من الاسباب منها الاختصار من الاكواد وزيادة سرعة وفاعلية البرنامج وبعض الفوائد الاخرى .</p>
<p>هذا الدرس <span style="color:#ff0000;">للمستوى الأبتدائي</span> وفيه سنشرح كيفية انشاء الدوال في لغة php وكيفية استعمالها بالشكل الصحيح مع ذكر اسباب استعمالها مع امثلة مفصلة .</p>
<p><!--more--></p>
<p>نبدأ بسم الله ..</p>
<p>الدالة هي مجموعة من الاوامر والمتغيرات تكتب بشكل مستقل داخل البرمجية ولكن البرنامج لا يقوم بتنفيذها الا اذا تم ارسال المتغيرات لهذه الدالة واستدعائها ... وقد يتسائل البعض لماذا لا نقوم بكتابة الكود بشكل مباشر وبالتالي عدم الدخول في متاهات برمجية ... والجواب هو انك سوف تجد ان استعمال الدوال سوف يوفر عليك الكثير من الوقت والجهد ويجعل البرمجية مرتبة اكثر وسهلة التطوير فمثلا اذا افترضنا ان لدنيا برمجية تحتوي على نظام عضويات سوف يحوي هذا النظام على كود للتأكد من صحة اسم المستخدم وكلمة المرور ... تخيل اننا نريد ان نكتب هذا الكود كل مرة للتاكد من المدخلات !! كم استعلام سوف نكتب لكي ننفذ عملية التأكد !!؟ الكثير من الاستعلامات وهذا يعني الكثير من الضغط على السيرفر ... لذلك ... ياتي هنا دور الدوال ... نقوم ببناء دالة وظيفتها التاكد من المدخلات ... وكل مرة نريد التأكد باستدعاء الدالة وتمرير المتغيرات لها ... وهكذا وفرنا على انفسنا الكثير من الاسطر البرمجية بالاضافة للكثير من الضغط واستهلاك موارد السيرفر وهذا مثال بسيط فقط لما يمكن للدوال القيام به .</p>
<p>الصيغة العامة لكتابة الدوال :</p>
<div style="float:right;width:98%;direction:ltr;background-color:#f2f2f2;text-align:left;border:#999999 1px solid;padding:2px;" dir="rtl">
<h5><span style="color:#ff9900;">Code :</span></h5>
<p>&#60;?</p>
<p>Function اسم الدالة هنا <br />
( المتغيرات التي سوف نمررها للدالة )<br />
{بداية الدالة<br />
الاوامر والعمليات<br />
return القيمة المعادة ;<br />
} نهاية الدالة</p>
<p>?&#62;</p></div>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>مثال حي :</p>
<div style="float:right;width:98%;direction:ltr;background-color:#f2f2f2;text-align:left;border:#999999 1px solid;padding:2px;">
<h5><span style="color:#ff9900;">Code :</span></h5>
<p>&#60;?</p>
<p>Function AddNum($num1,$num2) {<br />
$num3 = $num1 + $num2;<br />
return $num3 ;<br />
}</p>
<p>?&#62;</p></div>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>طريق استدعاء الدالة :</p>
<div style="float:right;width:98%;direction:ltr;background-color:#f2f2f2;text-align:left;border:#999999 1px solid;padding:2px;">
<h5><span style="color:#ff9900;">Code :</span></h5>
<p>&#60;?</p>
<p>echo AddNum(5,4); // النتيجة ستكون 9</p>
<p>echo AddNum(10,32); // النتيجة ستكون 42</p>
<p>?&#62;</p></div>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>قمنا في هذه الدالة بتمرير متغيرين لها وهي عبارة عن ارقام ... تستقبل الدالة هذه الارقام وتقوم بجمعها واعطائنا نتيجة الجمع عند استدعاء الدالة ... في عملية الاستدعاء الاولى جمعت الدالة الرقمين 5 و 4 وكانت النتيجة 9 ... اما في عملية الاستدعاء الثانية فقد جمعت الدالة العددين 10 و 30 وكانت النتيجة 42 ولاحظ اننا كتبنا الدالة قبل امر الاستدعاء ... فلو قمنا بكتابة امر استدعاء الدالة قبل كتابة الدالة نفسها فلن نحصل على اي نتيجة ... ولو كتبنا الدالة بدون امر الاستدعاء فلن نحصل ايضا على نتيجة .</p>
<p> </p>
<p>اتمنى ان تصل الفائدة جميع من يطلبها والرجاء عدم التردد في كتابة اي استفسار او سؤال وسنقوم بالاجابة عليها باقرب وقت ممكن .</p>
<p> </p>
<p>باحترام : اخوكم EbNCaNa</p>
<p> </p>
<p>سلامات</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Vessels]]></title>
<link>http://fractalontology.wordpress.com/?p=749</link>
<pubDate>Fri, 04 Jul 2008 10:32:15 +0000</pubDate>
<dc:creator>Joseph Weissman</dc:creator>
<guid>http://fractalontology.wordpress.com/?p=749</guid>
<description><![CDATA[
The charm of history and its enigmatic lesson consist in the fact that, from age to age, nothing ch]]></description>
<content:encoded><![CDATA[<p><a href="http://www.saatchi-gallery.co.uk/artists/artpages/kirstine_roepstorff_possible.htm"><img class="aligncenter size-full wp-image-757" src="http://fractalontology.wordpress.com/files/2008/07/kirstine_roepstorff_possible.jpg" alt="" width="720" height="469" /></a></p>
<p><span><em>The charm of history and its enigmatic lesson consist in the fact that, from age to age, nothing changes and yet everything is completely different.</em> (Aldous Huxley)<br />
</span></p>
<p><span>Through saturation an artist brings all the diverse elements of experience into a real interfusion, an affirmative disjunction. The artist opens passageways, a vessel for engendering a pure becoming. An encounter with an outside, presenting a pure force which art can only express -- art as transistor, as angel. As the cruelest resistance, which dispassionately disentangles the varieties of forces of essence, cautiously (even systematically) allowing the new to break free. </span></p>
<p><span>Art is certainly multiple, social, plurivocal. But our harmony is <em>also</em> a hint -- we remind each other at every turn that force is <em>also</em> musical, cosmic, vegetable, molecular, animal... </span></p>
<p><span>Greatness in art is the power of resonance, not of reflection. Communication is certainly not the point. An experiment approaches the real precisely in order to catch up, to leap behind it,  to <em>stop time</em>. Great art harbors no secret soothing, no escape into transcendence, but real insight into an immanent transformation. The human spirit -- that greatest of resistances which causes even the stars to resonate -- can overcome even itself. </span></p>
<p><span>The dimension called “aesthetic” could perhaps be distinguished as a singular torsion in the soul, a kind of critical overcoming of an internal limit, from which emerge limitless variations. A dangerous dimension of pure becoming which has always been working, in secret, just narrowly breaking free from this abyss overflowing with thorns, diverging lines, machines, animals, molecules, stars.</span></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[JAVAScript - 3]]></title>
<link>http://pwano.wordpress.com/?p=110</link>
<pubDate>Wed, 25 Jun 2008 06:12:43 +0000</pubDate>
<dc:creator>pwano</dc:creator>
<guid>http://pwano.wordpress.com/?p=110</guid>
<description><![CDATA[
Variables


]]></description>
<content:encoded><![CDATA[<div class="post">
<div class="text-container"><span style="color:#5cf0ee;">V</span><span style="color:#64dfe7;">a</span><span style="color:#6ccee0;">ri</span><span style="color:#50cccd;">a</span><span style="color:#34caba;">bl</span><span style="color:#259085;">e</span><span style="color:#175751;">s</span></div>
<div class="text-container"><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/YNVMy7NxBuo'></param><param name='wmode' value='transparent'></param><embed src='http://www.youtube.com/v/YNVMy7NxBuo&rel=0' type='application/x-shockwave-flash' wmode='transparent' width='425' height='350'></embed></object></span></div>
</div>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Sanitized PHP Include Navigation through GET variable]]></title>
<link>http://usernamedenied.wordpress.com/?p=49</link>
<pubDate>Mon, 23 Jun 2008 21:40:09 +0000</pubDate>
<dc:creator>usernamedenied</dc:creator>
<guid>http://usernamedenied.wordpress.com/?p=49</guid>
<description><![CDATA[We all have heard about the Remote File Inclusions, LFI, sql injections and all the other nasty vari]]></description>
<content:encoded><![CDATA[<p>We all have heard about the Remote File Inclusions, LFI, sql injections and all the other nasty variations of php "hacking".<br />
This mainly happens because people code pages without being aware of the security of their product.</p>
<p>In this tutorial I will explain how to sanitize a GET variable.<br />
This programming design is used to build pages without using iframes or frames and to optimize the homepage for search engines.<br />
An url usually looks like <em>www.domain.com/index.php?p=about</em> .<br />
[sourcecode language='php']<br />
include $_GET['page'];<br />
[/sourcecode]<br />
Let's take this piece of code for example, a normal url would look like <em>www.domain.com/index.php?page=about.php</em>. Now, an attacker could exploit this by simply changing the about.php into some shellcode like c99 or r57.<br />
He would include an evil piece of code that  is often used to deface homepages.<br />
The solution to this problem would be to check if the file exists, and if it doesn't, then it should include an error page.</p>
<p>We can use a function in PHP called <code>file_exists</code>.<br />
[sourcecode language='php']<br />
file_exists($file);<br />
[/sourcecode]<br />
It basically checks if the file exists in the current folder or not.<br />
[sourcecode language='php']<br />
$file = $_GET['page'].'.php';<br />
if (file_exists($file)) {<br />
   include $file;<br />
}else{<br />
   echo 'Error';<br />
}<br />
[/sourcecode]<br />
This would already do the job.<br />
You could also filter the forward slashes (/) and the double-dots(..) and delete them from $file.</p>
<p>The only problem is that the evil user can access all your files trough the <em>?page="page here"</em>.<br />
We can define which pages we want to allow with an array. This is a quite simple task to do with PHP, god bless those useful functions, I mainly code in Pascal (at school) and pascal has very few really useful functions...<br />
We define an array with all the pages we want to allow and then use the function <code>in_array</code>.<br />
We could also check if there are symbols such as / and .. inside the requested page and delete them.<br />
This is the syntax for the <code>str_replace</code> function.<br />
[sourcecode language='php']<br />
str_replace ("Text to find","Replace by",$_GET["page"]);<br />
[/sourcecode]<br />
The check would look like this<br />
[sourcecode language='php']<br />
  $allowed = array('page1','page2','page3');<br />
  $selection = str_replace ('..','',$_GET['page']);<br />
  $selection = str_replace ('/','',$_GET['page']);<br />
  if(in_array($selection,$allowed) && file_exists($selection)){<br />
    include $selection;<br />
  }<br />
  }else{<br />
    echo 'error, unauthorized page';<br />
  }<br />
[/sourcecode]</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[درس : أنواع المتغيرات (Variables) في لغة php]]></title>
<link>http://ebncana.wordpress.com/?p=28</link>
<pubDate>Fri, 20 Jun 2008 13:16:54 +0000</pubDate>
<dc:creator>EbNCaNa</dc:creator>
<guid>http://ebncana.wordpress.com/?p=28</guid>
<description><![CDATA[السلام عليكم اخواني واخواتي &#8230;
اليوم درسنا عن انواع ا]]></description>
<content:encoded><![CDATA[<p>السلام عليكم اخواني واخواتي ...</p>
<p>اليوم درسنا عن انواع المتغيرات في لغة البرمجة php ... حيث انا المتغيرات تكاد تكون من اهم العوامل لأي لغة برمجة واتقان التعامل مع المتغيرات من اهم الاساليب البرمجية لانها تمكننا من التعامل مع البرنامج بكل يسر وسهولة .</p>
<p>هذا الدرس <span style="color:#ff0000;">للمستوى الأبتدائي</span> وفيه سنشرح انواع المتغيرات المختلفة في لغة php وكيفية التعامل معها بجميع الاساليب المبسطة .</p>
<p><!--more--></p>
<p> </p>
<p>نبدأ بسم الله ...</p>
<p> </p>
<p><span style="color:#ff0000;">1</span><span style="color:#ff0000;">- الأعداد الصحيحة (Integers) :</span></p>
<p> هذا النوع من المتغيرات يأخذ القيم الرقمية الصحيحة اي الموجبة والسالبة مع العلم ان لغة php تعتبر اي رقم بهذه الخصائص وغير محاط بعلامات تنصيص عدد صحيح .</p>
<p>مثال :</p>
<div style="float:right;width:98%;direction:ltr;background-color:#f2f2f2;text-align:left;border:#999999 1px solid;padding:2px;">
<h5><span style="color:#ff9900;">Code :</span></h5>
<p>&#60;?</p>
<p>$a = 1234;</p>
<p>$a = -1234;</p>
<p>?&#62;</p></div>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p><span style="color:#ff0000;">2- الاعداد ذات العلامات العشرية (Floating point numbers) :</span></p>
<p>هذا النوع من المتغيرات يأخذ القيم الرقمية التي تحتوي على علامات عشرية مع العلم ان لغة php تعتبر اي رقم بهذه الخصائص وغير محاط بعلامات تنصيص عدد ذو علامة عشرية .</p>
<p>مثال :</p>
<div style="float:right;width:98%;direction:ltr;background-color:#f2f2f2;text-align:left;border:#999999 1px solid;padding:2px;">
<h5><span style="color:#ff9900;">Code :</span></h5>
<p>&#60;?</p>
<p>$a = 1.234;</p>
<p>$a = 1.2334;</p>
<p>?&#62;</p></div>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p><span style="color:#ff0000;">3</span><span style="color:#ff0000;">- المتغير النصي (String) :</span></p>
<p>هذا النوع من المتغيرات يأخذ حرف وارقام وعلامات مختلفة ...  لغة php تعتبر اي قيمة داخل علاماتي التنصيص هي متغير نصي .</p>
<p>مثال :</p>
<div style="float:right;width:98%;direction:ltr;background-color:#f2f2f2;text-align:left;border:#999999 1px solid;padding:2px;">
<h5><span style="color:#ff9900;">Code :</span></h5>
<p>&#60;?</p>
<p>$str = " This is a string 12234555&#62;&#60;&#62; ?!!!  ---- &#62; yes ";</p>
<p>?&#62;</p></div>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p><span style="color:#ff0000;">4- المصفوفات (Arrays) :</span></p>
<p>هي سلسة من القيم في متغير واحد يعبر عنه ككائن يحوي العديد من القيم ويمكن التعبير عن قيم المصفوفة بالارقام والاسماء حسب حاجة المبرمج ومن وظائف المصفوفات المتعددة تسهيل البرمجة وتوفير الوقت والجهد ... اذ يمكنك بواسطة المصفوفات قراءة ملف كامل بكتابة سطر برمجي واحد .</p>
<p>مثال :</p>
<div style="float:right;width:98%;direction:ltr;background-color:#f2f2f2;text-align:left;border:#999999 1px solid;padding:2px;">
<h5><span style="color:#ff9900;">Code :</span></h5>
<p>&#60;?</p>
<p>$a[0] = "ddf";</p>
<p>$a[1] = "ftr";</p>
<p>$a["bo"] = 14;</p>
<p>?&#62;</p></div>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p><span style="color:#ff0000;">- كيفية كتابة المتغيرات :</span></p>
<p>تعتبر لغة php اي قيمة مسبوقة بـ ($) على انها متغير .</p>
<p>مثال يشرح كيفية كتابة المتغيرين في السطر الأول والثاني ثم طلب طباعة قيمة المتغيرين في السطر الثالث وستكون نتيجة الطباعة هي "درس جميل" :</p>
<div>
<div style="float:right;width:98%;direction:ltr;background-color:#f2f2f2;text-align:left;border:#999999 1px solid;padding:2px;">
<h5><span style="color:#ff9900;">Code :</span></h5>
<p>&#60;?</p>
<p>$vari1 = "درس";</p>
<p>$vari2 = "جميل";</p>
<p>echo " $vari1 $vari2 ";</p>
<p>?&#62;</p></div>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p><span style="color:#ff0000;">- العمليات الحسابية على المتغيرات الرقمية :</span></p>
<p> <img class="alignright" style="float:right;" src="http://www.ebncana.com/upload/uploads/images/EbNCaNa.CoM-236cc010bd.jpg" alt="" width="466" height="327" /></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p><span style="color:#ff0000;">- المقارنة بين المتغيرات :</span></p>
<p> <img class="alignright" style="float:right;" src="http://www.ebncana.com/upload/uploads/images/EbNCaNa.CoM-70728a9fb7.jpg" alt="" width="466" height="346" /></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>واخيرا اتمنى ان كل من قرأ هذا الدرس قد استفاد منه خير الفائدة ... اتمنى ان لا تبخلوا علينا بتعليقاتكم او اسئلتكم او استفساراتكم .</p>
<p> </p>
<p> </p>
<p>سلامات .</p>
<p> </p>
<p> </p>
<p> </p></div>
]]></content:encoded>
</item>

</channel>
</rss>
