Flex Tip: ComboBox Events
(New tag "tips". I'll probably be posting a lot of little tips for various things I pick up that I didn't find immediately from Googling.)ComboBoxes in Flex have several useful events, the most used I believe are open, close, change. But one is lacking: itemClick. There is a difference between: opening a ComboBox then clicking outside or on the ComboBox itself to close it, and opening a ComboBox then clicking an item, even if it's the same one as before.
Fortunately Flex provides a way to detect this difference. The "close" event fires a DropdownEvent which has a "triggerEvent" member, which will be null when the item was clicked, will be a buttonDown event when the user closes with the ComboBox itself, and will be a mouseDownOutside event when the user clicks somewhere else. So simply return when the triggerEvent != null, and you have an itemClick feature. Edit: After some tests it appears that this technique isn't foolproof! Edit 2: My hack was to grab this.contentX and this.contentY and constrain them that way. Not very good.
See Full Post and Comments
Server Migration Completed
I finally made the jump to hostgator. I'm having some real issues with mod_rewrite however, so I'll get back to any readers on what I learn from it.The problem is with public_html/ being mapped to the default domain and I want it to go to public_html/domainname. However in the end I'll probably just symlink public_html to ~/domainname and remap the other domains to stuff outside of public_html.
See Full Post and Comments
Response to: The Perils of Java Schools
I read this good article here: http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html It is a very good rant, you should read it! While you don't need to read it to make sense of my response, it is still a response/thoughts about. Anyway, here is my response I initially wrote as an email to a former high school CS teacher.----
First, I think he has many good and strong points. We should be teaching recursion and pointers and threading much earlier than we are. If I had any suggestions for your [my old teacher's] AP CS class this year, it would be to teach it faster, especially if many of the students have passed your C++ class and should have a pretty decent grasp of the OOP material, if not a better one. (Also teach Researching by, for example, giving a somewhat challenging final problem on tests/quizzes requiring them to write code and give the students access to the internet. They are expected to only be able to solve it if they do research, so nothing so simple it comes up completed as a Yahoo Answer.)
See Full Post and Comments
How to turn an agnostic
This is a tongue-in-cheek mini-tutorial for how one might go about converting an agnostic to some theistic religion. It may work on some atheists. It may not work on anyone. I probably won't ever try this since it probably falls under my category of abuse.Step One: Stay away from mainstream religion, pick a relatively unknown one. This means no simple Christianity (Catholic, Protestant), no Judaism, no Islam. Acceptable alternatives include Mormonism (which is technically Christian but weirdly so, it's at such odds with the rest) and any far-Eastern religion.
Step Two: Pick some stereotype or misconception about the chosen religion and wash it away with Knowledge. For example, many people still believe Mormons practice polygamy. In fact, only an illegal sect does so, that is unrecognized by the official Church, and indeed the Church denounced such practices years ago. Also, there is a concept of "levels" in heaven. I can't remember the specifics, but if you're really holy and I think you may have to achieve some level of priesthood, you go to the highest level of heaven and you can then go off and create your own worlds. Pretty cool and futuristic-y eh?
See Full Post and Comments
Thinking In Groups
This is perhaps my least favorite form of religious thinking, simply because it afflicts many an Atheist as well. It's a useful heuristic of classification built into our brains, but nevertheless I also consider it a very harmful bias simply because of all the baggage it carries. Allow me.Can you spot the difference between these two quotes?
I am a scientist.
I am an Objectivist.
See Full Post and Comments
Power Levels
I realized a few days ago that it's been a bit over a year since I started writing on this blog. Wow, time flies a lot quicker now that I'm older. I still remember the summer after Kindergarten, not because of anything I did, but just because it felt oh so long. And every year after that, time has consistently seemed to go faster than the last.For the past few years, I've been trying to push myself more, trying to increase my level of knowledge and ability. I've consistently applied my "learn a new programming language / paradigm per year" mentality, which I think is great. I figure I've got at least two or three more languages to go before I can slow down that one.
Brief personal history: I started HTML at the end of 2004, and I consider myself starting to really program in 2005, so by the end of this year I'll have had 5 full years of programming experience. I've learned PHP (the whole LAMP stack), Java (which I'm now really mastering), Python, C, C++ (really mastering later this year), JavaScript, ActionScript, and while I 'know' Scheme and Common Lisp I still haven't finished working through SICP. Still, not bad eh? I've done Assembly and am taking an entire course on it next semester. J, R, and FORTH are on my list of languages to study next.
See Full Post and Comments
Teaching Programming
I've thought a lot about methods of teaching, specifically programming. While I don't immediately see myself writing a book or becoming a teacher, I nevertheless see those as two highish possibilities simply because I think about that sort of stuff a lot.Reading this post, I found myself agreeing, and I've already had mostly the same thoughts before. Teach by example, not by going through a reference and writing the same math functions over and over.
I've been going to my school the last couple of days for a focused work environment (since working from home sometimes proves to be distracting), and they're doing a summer project for kids where they teach them about using a piece of Software DigiPen developed called Project Fun to make basic video games. The software uses C++ as the main language, but also supports Lua and C#. The kids must use C++.
See Full Post and Comments
Recent Posts
2025-10-15
2025-08-18
2025-08-16
2025-07-31
2025-07-19