Creating threads that can interact with form elements, an easy alternative

Written by: dave

I’ve been working on a personal project (more for learning than anything else) in C# where the user can perform a search and preview images as thumbnails on a button then select an image they want. I wanted images to start showing up as soon as the user began typing. The time it takes to shrink just 9 full sized photos to a thumbnail image is large enough that performing the search can become unbearable. Naturally I decided to solve the problem using threads, but ran into a brick wall when an exception was thrown – apparently, developers are unable to change form elements from different threads.

The exception had a link I followed that gave information on how to overcome this issue. While the article was not super easy to follow, I was able to manage. I noticed a lot of people posted questions on forums on how to overcome this error, so I got to thinking and came up with what I think is an easier alternative.

My basic setup is as follows:

  1. The buttons are first created on the form.
  2. A timer is started.
  3. Threads are created that shrink images to thumbnail sizes for being displayed on the button.
  4. A class ThreadedQ is created in which it stores a thread number, a reference to a button, a reference to the image to be shrinked, and a reference to Q (defined next)
  5. The calling form has a variable, List Q, defined.
  6. As threads complete, they push ThreadedQ objects onto Q.
  7. Whenever the timer ticks, it checks Q for items; when one is found, it maps the newly created thumbnail to the button it references.
  8. When all threads have completed, the timer stops.

While this setup may not be as good as what the original tutorial proposed, I think it may be easier for beginners to follow.

Leave a Comment

Qube in the News

Written by: nick

The Qube Lab has been all over the media lately.

OK, maybe not all over, but a few of us were on Channel 3 News and we were in a Crain’s Cleveland Business story in October. We’ve been hearing from a bunch of people on both stories.  It is amazing how many people watch WKYC news and read page 11 of Crain’s.

On Channel 3, it was a story about how Wi-Fi is easily circumvented and packets can get intercepted:

http://www.wkyc.com/news/local/news_article.aspx?storyid=125268&catid=45

Of course, they were with us for two hours but the story was just a couple of minutes. Anything we mentioned about SSID, opening portals, and the detailed, balanced way we viewed these things did not really come across.  We were probably too technical and Mike the reporter wanted sound bites (like the comment James made about what is “stupid”).

The Crain’s story was about Goldstein, Caldwell & Associates – our friends who work with small startups (http://www.goldcald.com/).   It did a nice job introducing us.  Here’s the text that discussed the Qube, followed by a link to the story:

“…The Qube Lab, a software development company Mr. Berente leads at Case Western Reserve University [note: The Qube Lab is not formally associated with Case, beyond all of us also either work or go to school at Case], stood to benefit by partnering with the early stage business development firm in University Heights. However, Mr. Berente also found that he and Goldstein Caldwell’s founders shared a passion: helping Northeast Ohio’s young entrepreneurs…

“…More people should share that focus, said Mr. Berente, who leads a group of students who provide low-cost software development services to Goldstein Caldwell’s portfolio companies and other organizations. “The companies that everybody is talking about were not created by 40-somethings,” said Mr. Berente, who also is an adjunct professor at CWRU’s Weatherhead School of Management and a research fellow at the University of Michigan’s school of information.”

The article “Young entrepreneurs build firm around startup investments,” was written by Chuch Soder and ran on the October 19 issue:

http://www.crainscleveland.com/article/20091019/FREE/310199972

Leave a Comment

The Importance Of Good Code Deployment

Written by: omri

Thoroughly testing software is a good idea. Yes, that’s a pretty obvious statement; however, it’s one that doesn’t seem to be fully understood all the time. I understand bugs popping up under the most random of circumstances. That’s almost expected; however, when a bug pops up when a program is running through set-up, that’s unacceptable.

We’re working on a project that requires the Drupal platform for a client. The client requires that new stories that are created on Drupal will be posted to Twitter and Facebook. That should be simple enough as there are modules to do this using Drupal. Wrong.

I’ve now spent a good two hours trying to set up Twitter integration with the site. Not only was the module completely unintuitive, that is, I expected it to post immediately after I set up my account and created a story. No, it required more modules that needed to be installed, but weren’t required upon activation as well as setting up a user’s specific twitter account, creating special triggers, and a lot of debugging. This is where my frustration stems from.

Why is it that once I hit publish I’m immediately greeted by that all too reassuring PHP error handler. A Google search quickly turned up multiple users experiencing the same problem with the creator saying he fixed it in the next release. After I fixed the first bug, another came up of the same nature. Luckily, there was another patch on the same page as the original problem.

So is the fun of using open-source, community driven applications

Leave a Comment

GridMove

Written by: dave

Ever have a lot of windows open at one time? Ever want to lay them all out nicely without having to do a lot of manual dragging and resizing? Then you should take a look at a small utility called GridMove.

On my system, I can press Windows+G at any time and resize and place the current window in the top left corner, or fill the entire right half the screen (or a number of other configurations), or force it to be on top of all other windows by pressing 1-9. You can choose from a number of “templates” (mappings of buttons to screen locations) or create your own.

I find this utility to be helpful when programming (cycling through tutorials, code, output, etc) and grading programs for my TA position, where I have literally seven active windows up at a time.

Gridmove can be found here: http://jgpaiva.dcmembers.com/gridmove.html

Comments (1)

Windows Grep

Written by: dave

A recent project I’ve been working on was built with Ruby on Rails. Anyone who has had the experience of starting to learn RoR by working on another person’s already built project may agree with me – finding how things are generated is difficult. When I wanted to change text or learn where the design was stored, I had a rough time. Then I discovered Windows Grep.

Windows Grep allows users to do in depth file searches. The user can define a string to search (or a regular expression) and specify a directory and file types and the program searches within the file’s contents.

In case you were not aware, Grep comes from a unix command and is an ancronym for Global Regular Expression Print. There are variations of this tool for windows, but I am drawn to Windows Grep because of its GUI layout and informative search results.

I used this tool by looking at a web page on rails, viewing it’s source, copying a small string of text that I thought would be unique, and pasting it into Windows Grep to find results. It certainly helped with the beginning stages of learning my way around the project.

Windows Grep can be found here: http://www.wingrep.com/

Leave a Comment

Mobile browsers and the future of mobile web applications

Written by: eric

I see mobile devices as an exciting platform due to their ability to stay up-to-date. There are many issues with web standards, and browser compatibility issues that will be absent from most current and future mobile platforms. Right now Apple, Google, and Palm use Safari, Android Browser, and WebOS as their mobile web browsers. All of these browsers are based on the WebKit layout engine. This commonality will help make web applications share a similar aesthetic and feel across these various devices.

The ability to easily update your mobile device by pushed updates or syncing with your laptop are also a cause of excitement. Today we see how many users still use out-dated versions of Microsoft’s Internet Explorer, causing many security and layout issues for developers. Now that devices can be updated more easily, updates to mobile browsers are even easier.

With mobile browsers in mind, I wonder what HTML 5 features will be incorporated into mobile browsers. The new features of HTML 5 are really exciting — If you have not had a chance to read about HTML 5, I would recommend reading Dive Into HTML 5, a book written by Mark Pilgrim. Dive Into HTML 5 is available on the web, reads easy, and is free!

Should be interesting to see just how many new mobile browsers come online within the next year.

Leave a Comment

Physical Computing – Art From Necessity

Written by: omri

Physical Computing is an art that blends software, hardware, and human interaction. I’ve been incredibly interested in this process from both an art standpoint (I’m a musician and a designer at heart) and from the software and hardware standpoint (I’ve been programming for as long as I can remember).

I bought the Arduino platform as well as the Parallax RFID reader and keychain tags a while ago when I first got serious about making the jump into the hardware side of things. During that time, I’ve created a device that will Tweet what beer you pull out of the fridge (Code, I need to put the movie up).

In our apartment, I have a cat and my roommate has a dog. Besides the occasional roughhousing between them, we have stumbled upon another problem. While my cat can jump to a high place to get his food, the dog cannot. In fact, we have yet to find a place to keep the dog’s food where the cat cannot get to it. This has become a problem as 1)I don’t want my cat to get sick eating dog food and 2)my roommate would rather not pay for my cat’s dinner.

Our ultimate plan is to let the pets roam free; however, we can’t leave their food unattended or each one will eat the other’s food. After verbalizing the problem, I immediately had the solution:

We will put both bowls out in the kitchen (this isn’t necessary, nor is it desired as the cat, for the moment, spends most of his day in my room). We will also rig up a piece of cardboard on a stick that’s the diameter of the bowls. Each bowl will have it’s own cardboard cover. We’ll attach the sticks to servos and connect the servos to the Arduino. Additionally, we’ll have the RFID reader plugged into the Arduino, and we’ll put the tags on the pets. When a pet comes next to the bowl, the RFID reader will pick up his tag and know, based on the tag’s serial number, which arm to lift. They will only be able to get their own food (unless they decide to collude, walk together, and eat the other’s food). Problem solved!

I know there’s probably a much simpler, non-technical solution, but where’s the fun in that :P

Leave a Comment

ZedGraph – Making My Life Easier Since Friday

Written by: dave

Given the task to create a dashboard for a client, I went through the usual steps of building a project – the initial frustration of finding a library to handle the more intricate portions of the project, figuring how everything will be laid out, etc. Luckily, I stumbled across an amazing library for handling graph generation in C# called ZedGraph.

You can find the source code here:
http://sourceforge.net/projects/zedgraph/

A wiki is also available:
http://zedgraph.org

And a handy startup tutorial:
http://www.codeproject.com/csharp/zedgraph.asp

Leave a Comment

The Qube Lab

Written by: admin

Where Northeast Ohio organizations can work with the region’s brightest students in a win-win web development relationship.

Web Applications.

Next-Generation Thinking. (Literally!)

Cutting Edge Technology.

The Qube Lab provides a low-cost alternative for organizations to develop software that they might not otherwise create or to explore ideas from an innovative point of view.  At the same time, local university students gain valuable experience developing real-world applications.


Real-world Projects

The Qube Lab helps organizations with small scale web-based applications of all sorts. Examples include new application prototyping, mobile applications, dashboards, and virtually anything creative and IT related.

Qube Lab Fellows will be trained using the MS .NET environment and JAVA. They will also have training with databases and some specific applications such as Microsoft SharePoint.


The Qube Lab is open for business as of September 1, with five “Qube Fellow” web app developers (see “The Team”).

Leave a Comment