<?xml version="1.0" encoding="UTF-8"?><!-- generator="WordPress/2.6.1" -->
<rss version="0.92">
<channel>
	<title>Arquiva-me</title>
	<link>http://manifesto42.com/42</link>
	<description>Flex, PHP, Mysql, Flash, doubts and solutions. Kinda like IKEA, but about programming. And smaller. And not swedish.</description>
	<lastBuildDate>Fri, 23 Jul 2010 12:05:56 +0000</lastBuildDate>
	<docs>http://backend.userland.com/rss092</docs>
	<language>en</language>
	
	<item>
		<title>update table with values from other table</title>
		<description>I ran into a problem where i had to update two values on a table. One was fixed, but the other depended on a value stored on a second table. This is how its done.




TableA

id_cli   test_cut

1          15


2          56

TableB

id    num_of        job    test_cut    id_client

1     20090464    34      0               2

2     20081012    200    0               ...</description>
		<link>http://manifesto42.com/42/?p=64</link>
			</item>
	<item>
		<title>Air project doesn&#8217;t run. No error.</title>
		<description>Didn't quite know what to use as a title, because the problem sounds a bit too generic. Anyway, on to the problem/solution.

The problem was that i was trying to convert an already built/in progress Flex project to Air and it was giving me some grief, since it simply didnt run. ...</description>
		<link>http://manifesto42.com/42/?p=58</link>
			</item>
	<item>
		<title>Compare two tables/fields</title>
		<description>Found this somewhere on google.

If we need to compare two tables, this query will list the missing records on one of them (on table2):

SELECT t1.id
FROM table1 t1 LEFT JOIN table2 t2 ON t1.id = t2.id
WHERE t2.id IS NULL

Then you do it the other way around to check the mising records ...</description>
		<link>http://manifesto42.com/42/?p=43</link>
			</item>
	<item>
		<title>Mysql command line</title>
		<description>This is a simple reminder of the mysql command line tool.

In windows, open a command line, navigate to mysql binary folder (if you have it on your PATH, you can skip the navigation part), and use:

To login:

mysql -u #username# -p#password#

(if you dont add the #password#.. it will ask you for ...</description>
		<link>http://manifesto42.com/42/?p=34</link>
			</item>
	<item>
		<title>Find string in string</title>
		<description>Like other people i've seen complaining about in the net, i keep forgetting how to do this.

There are several ways of doing this, but here's a simple one:
$haystack = "Once upon a time, on a far away kingdom...";
$needle = "kingdom";
if(strstr($haystack,$needle)){
    echo "Word found.";
}else{
    echo ...</description>
		<link>http://manifesto42.com/42/?p=26</link>
			</item>
	<item>
		<title>update table with condition from different table</title>
		<description>If we want to make an update to a table, but have to condition that update with values from a second one, we do something like this:

TABLE_1
id_t1    name    fee
1         john      100
2 ...</description>
		<link>http://manifesto42.com/42/?p=23</link>
			</item>
	<item>
		<title>Format/convert decimal to hexadecimal (or other numeral system)</title>
		<description>My problem was to convert some calculations from decimal to hexadecimal to be used in a canvas background color. Specifically, convert from CMYK, from a pantone list, to RGB and apply the result to a canvas.

In a different post i will describe the convertion, might be useful for someone.

Flex has ...</description>
		<link>http://manifesto42.com/42/?p=19</link>
			</item>
	<item>
		<title>Automatic scroll to the bottom of a TextArea</title>
		<description>On my current project, i have a debug TextArea that continuously lists some var values and traces. This way i can keep track of whats going on without stopping execution to debug in Flex.

As the list fills, the Text starts going off the screen, downwards. I needed to keep the ...</description>
		<link>http://manifesto42.com/42/?p=16</link>
			</item>
	<item>
		<title>insert into table from a second table</title>
		<description>Its simple but i thought of leaving it here if i forget (which is usually the case) how to do it again.

If you want to insert the records from tableA into tableB, you do something like this:

INSERT INTO tableA SELECT * FROM tableB

You have to make sure all fields are ...</description>
		<link>http://manifesto42.com/42/?p=10</link>
			</item>
	<item>
		<title>Number formatting/padding before and after the decimal</title>
		<description>Before i came up with this solution, i had some trouble formatting and padding decimal numbers, specifically when i want to do it before and after the decimal mark. To top it all, i wanted the result signed (with a plus sign(+) or minus sign(-) depending on the value of ...</description>
		<link>http://manifesto42.com/42/?p=8</link>
			</item>
</channel>
</rss>
