This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <? | |
| // Written for my own use, 2009 | |
| function select_exisiting_or_new($object,$field_name){ | |
| // To use: | |
| // echo select_exisiting_or_new($product,'manufacturer')? | |
| $current_value = $object->$field_name; | |
| $possible_values = $object->query("SELECT `$field_name` from $object->table_name GROUP BY `$field_name` ORDER BY `$field_name`"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //in public void Update() | |
| //change | |
| if (updateResult.Errors) { throw new CouldNotUploadBudget(); } | |
| //to | |
| if (updateResult.Errors) { throw new CouldNotUploadBudget( this, updateResult); } | |
| //change | |
| public class CouldNotUploadBudget : System.Exception { } | |
| //to | |
| public class CouldNotUploadBudget : System.Exception { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Learning both Lua, and OpenGL. Probably NOT GOOD CODE. | |
| -- But it's pretty in action. | |
| -- Click to add squares. | |
| require 'luagl' | |
| require 'luaglut' | |
| local fps = 60 | |
| local msec = 1000 / fps | |
| quit = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Reflection; | |
| using System.Collections; | |
| public static void ShowProperties(Object myObject){ | |
| Hashtable PropertiesOfMyObject = new Hashtable(); | |
| Type t = myObject.GetType(); | |
| PropertyInfo[] pis = t.GetProperties(); | |
| for (int i=0; i<pis.Length; i++) { | |
| PropertyInfo pi = (PropertyInfo)pis.GetValue(i); | |
| Console.WriteLine(pi.Name); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| you = "Frog" | |
| me = "Frog" | |
| you == me # True |
NewerOlder