Friday, October 19, 2007

Sockets in Visual Studio using Visual Basic.net (VB.net)

I created this code to open a socket connection in Visual Studio using VB.net:

Dim winsock1 As New Socket(AddressFamily.InterNetwork, SocketType.Stream,
ProtocolType.Tcp)
Dim myIP As New IPAddress(IPAddress.Parse("127.0.0.1").GetAddressBytes())
Dim myPort As Integer = 23
Dim myIPend As New IPEndPoint(myIP, myPort)

Public Function Sockets()
If (winsock1.Connected = True) Then
winsock1.Close()
End If

winsock1.Connect(myIPend)


Do While (winsock1.Connected <> True)
Loop

If winsock1.Connected = True Then
winsock1.DoStuff()
End If

If (winsock1.Connected = True) Then
winsock1.Close()
End If

Do While (winsock1.Connected <> True)
Loop

End Function



Friday, October 12, 2007

For Tired Computer Users: A Headband To Tell You When To Quit

A Tufts University team wants to expand on technology that uses near-infrared spectroscopy sensors to measure the brain's emotional state.

By W. David Gardner InformationWeek October 12, 2007 06:00 AM

A high tech headband that monitors blood oxygenation levels in the brain may tell people working at PCs and terminals when they are becoming overly fatigued, distracted, or just plain stressed out.

The concept was described at this week's ACM Symposium on User Interface Software and Technology by a Tufts University team that has been awarded a $445,000 grant by the National Science Foundation. The technology involves the use of a MRI-like headband to gain real time insight into the brain's emotional state.

The research could produce valuable insight into a range of situations, but particularly for people peering into video screens in stressful situations like air traffic controllers, emergency workers and military personnel in combat situations. A long-term goal of the research would be to improve user interfaces for normal computer users.

Using functional near-infrared spectroscopy (fNIRS), the team said the technology is "safe, portable, non-invasive and can be implemented wirelessly."

The team has been directed by computer science professor Robert Jacob and biomedical engineering professor Sergio Fantini. They have noted that while there have been some successful evaluations of workload, emotion and fatigue of computer users, it has traditionally been difficult to measure mental workload, frustration and distraction.
"One moment a user may be bored, and the next moment, the same user may be overwhelmed," stated professor Jacob. "Measuring mental workload, frustration and distraction is typically limited to qualitatively observing computer users or to administering surveys after completion of a task, potentially missing valuable insight into the users' changing experiences."
Infrared sensors on the headband are fitted with laser diodes that send near-infrared light into the forehead, enabling oxygenation to be tracked. Stress levels from bored to overwhelmed can be measured. In initial experiments using the fNIRS technology, the Tufts researchers were able to obtain relatively accurate depictions of subjects' workload. Now they want to take the technology further.

In initial experiments, subjects were asked to carry out various tasks online before they were asked to rate the difficulty of the tasks. The subjects' ratings coincided 83% of the time with the date developed by the fNIRS technology.

"We don't know how specific we can be about identifying users' different emotional states," said Sergio Fantini, a biomedical engineering professor at Tufts. "However, the particular area of the brain where the blood-flow change occurs should provide indications of the brain's metabolic changes and by extension workload, which could be a proxy for emotions like frustration."

Compupter Science Grads Enjoy Record Starting Salaries

In another sign of economic recovery, starting salaries for computer science graduates have soared to an average of $53,051, rising 4.5 percent and making a new high for the decade, according to Ars Technica.

The surge suggests a deficiency in professional IT manpower, which Ars' Nate Anderson attributes to the dot-com bust and "subsequent mass migration of programming jobs to south Asia," which caused computer science students to "bolt from their majors like horses from a barn fire."

Sure enough, the Chronicle of Higher Education reported in 2005 that interest in the major was in a free fall, with those who declared it dropping 32% from 2000 to 2004.

Drake University Virtual Reality Program on the Rise

Drake University's Virtual Reality program could someday rival that of Iowa State. The recent retirement of Ken Kopecky seemed as if it would cripple the Virtual Reality program at Drake University, but the hiring of Timothy Urness, PhD, has given the Drake Mathematics and Computer Science department a huge boost. Adding to the all star cast of Dan Alexander, Luz DeAlba, Alex Kleiner, Lawrence Naylor, David Oakland and Michael Rieck, Tim Urness brings to the table experience in Scientific Visualization, Computer Graphics and Virtual Reality. It is a very exciting time for the Drake University Mathematics and Computer Science Department.

Drake Mathematics and Computer Science News

Professor DeAlba to give Stalnaker Lecture on September 18
Luz Maria DeAlba will give the annual Luther W. Stalnaker Lecture at Drake University on Tuesday, September 18. The lecture titled "Combinatorial Matrix Theory: Origins and Applications," will start at 7 p.m. in Sheslow Auditorium in Old Main, 2507 University Ave. A reception will follow in Levitt Hall, Old Main. The lecture and reception are free and open to the public.

Professor Baker Publishes on Mathematics Education
Professor Baker recently published a paper entitled "Schema Thematization: A Framework and an Example", by Laurel Cooley, Maria Trigueros, and Bernadette Baker. It is published in the Journal for Research in Mathematics Education, Vol 38, No 4, July 2007.

Professor Afrin Naz Joins Faculty
We are pleased to announce that Afrin Naz has recently joined the faculty in the Department of Mathematics and Computer Science. Professor Naz received her Ph.D. from the Department of Computer Science and Engineering at the University of North Texas in Denton. She holds bachelors and masters degrees from Dhaka University in Bangladesh and an M.S. in Computer Science from Midwestern State University in Wichita Falls, TX. Her research interests include computer architecture, parallel and distributed systems, compilers and embedded system designs.

Math and Computer Science Students Participate in DUSCI Summer Research
Zac Oler, Jon Botts, and Maren Mann participated in the 2007 Drake Undergraduate Science Collaborative Institute (DUSCI) Summer Undergraduate Research Program. Participants in the program are advised by a faculty member and conduct research over a span of eight weeks during the summer. Zac developed a simulation and visualization of a magnetic energy system, Jon researched matrix theory, and Maren worked on molecular modeling in a virtual reality environment. Zac and Maren were advised by Professor Urness. Jon was advised by Professor DeAlba.

Professor Urness Presents Architecture Education Paper
Professor Urness presented the paper "Teaching Computer Organization/Architecture by Building a Computer" at the 2007 Workshop on Computer Architecture Education held in conjunction with the 34th International Symposium on Computer Architecture. The paper is based off of the activity he conducted as a part of teaching CS 172 during the spring semester. The activity was paid for by a grant from the Center for Digital Technology and Learning.
Drake Students Win Best Research Paper Award

Skyler Nesheim and Luong Hoang won the award for best undergraduate paper at the 40th Midwest Instruction and Computing Symposium, hosted at the University of North Dakota. Their paper, "Creating an Object-Oriented Network Simulator" was supervised by Professor Rieck. View the official Drake press release by clicking here.

Professor DeAlba honored as 2007 Stalnaker Lecturer
Professor Luz DeAlba was appointed the 2007 Stalnaker Lecturer at the annual Drake University Honors Convocation held on April, 18th. The Stalnaker Lecturer is recognized as an influential member of the faculty at Drake University, particularly in the area of scholarship. In the fall of 2007, Professor DeAlba will present her contributions in the area of matrix theory in a lecture open to the public.

Drake Students Win Math Contest
Drake University won the 13th Iowa Collegiate Mathematics Competition held at Grinnell College on March 10. There were 25 teams of undergraduate students from colleges and universities throughout Iowa competing. The students comprising the Drake team were Luong Hoang, Quentin Roper, and Zach Kertzman. The team was organized by Larry Naylor in the Department of Mathematics and Computer Science. The competition is sponsored by the Iowa Section of the Mathematical Association of America.

Brute Force Sorting Algorithms

The brute force sorting method is the simplest of the design strategies and in most cases the easiest to apply. The brute force approach is used for many algorithmic tasks such as finding the largest numerical value in an array and finding the sum of n numbers. Although the brute force approach is very costly as it must exhaust all items in a list, it is sometimes the only solution and therefore the cost is acceptable. Let us explore some different brute force sorting algorithms and take a closer look at their properties.

The Problem:
Given a list of n orderable items in an array, rearrange them in increasing order.

Selection Sort
Selection sort is the simplest of the sorting algorithms. It begins by scanning the entire array for the smallest element. This element then gets swapped with the element stored in the first position of the array. Then it again scans the list, starting with the second element for the next smallest element, swapping it with the element in position two. This process continues until all n elements have been arranged in increasing order. Selection Sort is a O(n^2) algorithm in all cases (best, worst, average). This means for n elements in an array it will take n^2 steps to complete the sort.

Bubble Sort
Bubble Sort begins by comparing the first two elements in the array. If element two is less than element one, the elements are swapped. Next, elements two and three are compared and swapped if need be. This process continues until the array is sorted. Essentially Bubble Sort compares adjacent elements and swaps them if they are out of order. After a few iterations the algorithm will "Bubble Up" the largest element to the last position. Bubble Sort is also a O(n^2) algorithm for all cases (best, worst, average). An example of the worst case would be a decreasing array.

Thursday, October 11, 2007

MIT Model Could Improve Some Drugs' Effectiveness

MIT researchers have developed a computer modeling approach that could improve a class of drugs based on antibodies, molecules key to the immune system. The model can predict structural changes in an antibody that will improve its effectiveness.
The team has already used the model to create a new version of cetuximab, a drug commonly used to treat colorectal cancer, that binds to its target with 10 times greater affinity than the original molecule.

The work, which will appear Sept. 23 in an advance publication of Nature Biotechnology, results from a collaboration using both laboratory experiments and computer simulations, between MIT Professors Dane Wittrup and Bruce Tidor.
"New and better methods for improving antibody development represent critical technologies for medicine and biotechnology," says Wittrup, who holds appointments in MIT's Department of Biological Engineering and Department of Chemical Engineering. Tidor holds appointments in Biological Engineering and the Department of Electrical Engineering and Computer Science.
Antibodies, which are part of nature's own defense system against pathogens, are often used for diagnostics and therapeutics. Starting with a specific antibody, the MIT model looks at many possible amino-acid substitutions that could occur in the antibody. It then calculates which substitutions would result in a structure that would form a stronger interaction with the target.
"Combining information about protein (antibody) structure with calculations that address the underlying atomic interactions allows us to make rational choices about which changes should be made to a protein to improve its function," said Shaun Lippow, lead author of the Nature Biotechnology paper.

"Protein modeling can reduce the cost of developing antibody-based drugs," Lippow added, "as well as enable the design of additional protein-based products such as enzymes for the conversion of biomass to fuel." Lippow conducted the research as part of his thesis work in chemical engineering at MIT, and is now a member of the protein engineering group at Codon Devices in Cambridge, Mass.

"Making drugs out of huge, complicated molecules like antibodies is incredibly hard," said Janna Wehrle, who oversees computational biology grants at the National Institute of General Medical Sciences, which partially supported the research. "Dr. Tidor's new computational method can predict which changes in an antibody will make it work better, allowing chemists to focus their efforts on the most promising candidates. This is a perfect example of how modern computing can be harnessed to speed up the development of new drugs."
Traditionally, researchers have developed antibody-based drugs using an evolutionary approach. They remove antibodies from mice and further evolve them in the laboratory, screening for improved efficacy. This can lead to improved binding affinities but the process is time-consuming, and it restricts the control that researchers have over the design of antibodies.
In contrast, the MIT computational approach can quickly calculate a huge number of possible antibody variants and conformations, and predict the molecules' binding affinity for their targets based on the interactions that occur between atoms.

Using the new approach, researchers can predict the effectiveness of mutations that might never arise by natural evolution.

"The work demonstrates that by building on the physics underlying biological molecules, you can engineer improvements in a very precise way," said Tidor.
The team also used the model with an anti-lysozyme antibody called D44.1, and they were able to achieve a 140-fold improvement in its binding affinity. The authors expect the model will be useful with other antibodies as well.
The research was funded by the National Science Foundation and the National Institutes of Health.

Wittrup and Tidor also co-teach a class focusing on connecting fundamental molecular and cellular events to biological function through the use of mathematical models and computer simulations.

Bat and Mouse Game


This image by MIT researchers, based on a computer model of a bat in flight, won first place in the Informational Graphics category of the 2007 International Science and Technology Visualization Challenge.

"When viewed in slow motion, bat flight is beautiful and complex. The goal of this illustration is to capture that beauty while also adding scientific merit," David J. Willis, a research scientist in the Department of Aeronautics and Astronautics, told Science magazine. The competition is sponsored by Science, published by the American Association for the Advancement of Science, and the National Science Foundation.

Willis created the winning image with Professor Jaime Peraire of aeronautics and astronautics and several colleagues from Brown University led by Professor Kenneth Breuer.

For the contest, illustrators, photographers, computer programmers, and graphics specialists from around the world were invited to submit visualizations that would intrigue, explain and educate. More than 200 entries were received from 23 countries, representing every continent except the Arctic and Antarctica.

"Breakthroughs in science and engineering are often portrayed in movies and literature as 'ah-ha!' moments. What these artists and communicators have given us are similar experiences, showing us how bats fly or how nicotine becomes physically addictive," said Jeff Nesbit, director of NSF's Office of Legislative and Public Affairs. "We look at their visualizations, and we understand."

Software Allows Scientists Better Access To Expensive Microscopes And Telescopes Over Internet

Science Daily — Software under development at Ohio State University is helping scientists operate big-budget research instruments -- such as high-powered microscopes and telescopes -- over the Internet, more safely and efficiently than was possible before.

The need for such remote operation is growing, and it's driven by the costs of doing research, explained Prasad Calyam, a doctoral student in electrical and computer engineering at Ohio State. Calyam is a senior systems developer at the Ohio Supercomputer Center (OSC), where he and other researchers are developing the software in collaboration with materials scientists at Ohio State's Center for the Accelerated Maturation of Materials (CAMM).
Today, distant institutions often share the costs -- and also the use -- of expensive instruments. With the Internet, it's now possible for distant research partners to run their own experiments on shared instruments without leaving home.
But Internet traffic congestion can make remote operation slow, frustrating, and even dangerous.
"Communication delays can prevent remote operators from knowing exactly what is happening with an instrument at a particular moment, and that can lead to making the wrong decisions as a result," Calyam said.
When that happens, one wrong keystroke could spell disaster. Expensive physical components in the instrument could smash into one another. Repairing these damaged components can cost over $100,000 to fix. All because the remote video feed froze up, and the researcher couldn't see what he or she was doing.
Calyam and his colleagues began developing RICE -- short for Remote Instrumentation Collaboration Environment -- to prevent remote researchers from making such mistakes. It also helps them perform experiments more efficiently, regardless of network congestion.
At the IMMERSCOM conference in Verona, Italy, on October 11, 2007, Calyam described the first test of the software, which was conducted late last year at OSC with researchers from CAMM.
On the surface, RICE would look very familiar to anyone who's used Internet videoconferencing software, or even an Internet chat program. There's a window that lists the names of researchers who are logged in, and another window for text messaging. A third window shows a video feed of the object being studied, along with buttons to control the instrument. One primary user -- presumably, the lead researcher on an experiment -- can transfer control of the instrument from one remote researcher in one location to another.
For this study, the test subjects were researchers from the Department of Materials Science and Engineering at Ohio State. That department houses CAMM, which recently installed several of the world's most powerful electron microscopes with the idea of making them remotely operable.
The CAMM engineers and their students used RICE to operate a microscope from different locations -- first, directly at the microscope, then elsewhere inside the laboratory, then at another location inside the same building. Finally, they operated the microscope from two miles away at the OSC offices on Ohio State's west campus in Columbus. Each test utilized a different kind of network setup; the test at OSC was performed over the public Internet.
In each test, the CAMM engineers were able to operate their microscope without incident. While they experienced some delays in performance when using RICE over the Internet, they still reported a high level of satisfaction with the software.
Calyam was also pleased to note that the experiment at OSC didn't affect the network performance of the center's employees, despite the fact that the software's video feed requires 10-30 megabytes per second of bandwidth.
"The first question a system administrator in a campus environment has to ask before installing this kind of software is, 'If we use this in the laboratory, how will it affect all my other users in the building?'" Calyam said. "Now we know, if the lab has a well-designed network, RICE won't affect them -- they can go about business as usual."
RICE works so well because it relies on the economic principles of supply and demand to utilize network bandwidth. It's a unique way of understanding how network health affects end-user experience, and -- as it turns out -- it's a vitally important strategy for operating instruments remotely.
Special algorithms take control of the software when a user's commands -- in effect, the user's demands on the system -- outweigh the supply. In this case, the "supply" is bandwidth consumed by the video feeds from the instrument. For example, when Internet congestion has caused the video feed to freeze up, RICE blocks commands from the user, who may mistakenly think that the instrument hasn't moved, when it actually has.
He or she may even try to correct the mistake by pressing more buttons -- and may actually make the problem worse.
"It's just human nature -- when we hit a button, and nothing happens, we hit the button again," Calyam said. "We know from our previous studies that people using Internet software tend to click more buttons when the network is slow, and they also get less done.
"RICE notices when a user issues commands that are probably caused by network congestion, and it blocks those commands. In addition, it allows the user to tune their supply to cope with network congestion. In the end, the user is less frustrated, because they've gotten the result they wanted with fewer clicks and without worrying about potentially damaging the instrument."
OSC eventually plans to make the RICE software code publicly available. In the meantime, Calyam's team is continuing to test the software with other instruments in Ohio -- some located at the Department of Chemistry at Ohio State, the Electron Microscopy Facility at Miami University, and the Department of Physics and Astronomy at Ohio University.
The need for better software for remote operation is growing, Calyam said. The National Science Foundation recently began encouraging the use of remote operation on the major instruments that it funds. And some laboratories are seeking to recoup their investment in expensive instruments by allowing outside researchers to rent the use of instruments and related analytic tools over the Internet, for a fee.
Calyam's co-investigators on the study included Nathan Howes, an undergraduate in the Department of Computer Science and Engineering, and Abdul Kalash and Mark Haffner, both graduate students in the Department of Electrical and Computer Engineering.
Numerous Ohio State faculty members contributed to the project (some of whom also have appointments at OSC), including: Calyam's advisor, Eylem Ekici, assistant professor of electrical and computer engineering; Ashok Krishnamurthy, associate professor of electrical and computer engineering, associate professor of speech and hearing, and Director of Research and Scientific Development at OSC; Steven Gordon, professor of city and regional planning and Director of Education and User Support at OSC; and Dong Xuan, associate professor of computer science and engineering.
At CAMM, Peter Collins, a senior research associate, Robert Williams, a graduate research associate, and Daniel Huber, a student research assistant, aided in the study. CAMM is directed by Hamish Fraser, Ohio Regents Eminent Scholar and professor of materials science and engineering.
"CAMM provided feature sets, design goals, and also enabled pilot deployment of the software," Calyam said. "Without CAMM, this project would not have existed."
This work was funded by the Ohio Board of Regents and Ohio State's CAMM-VIM (CAMM Visualization, Instrumentation and Modeling) program.

Roboticists to ride wave of power, chip and sensor improvements

CAMBRIDGE, Mass.--The Boston area has become a leading robotics hub, with a larger cluster of related companies than any other area in the U.S., according to a group of panelists assembled for the Massachusetts Institute of Technology Enterprise Forum on Robotics Wednesday night.

The Stata Center, where the MIT Enterprise Forum on Robotics was held Wednesday night, houses MIT's Computer Science and Artificial Intelligence Lab (CSAIL).(Credit: Candace Lombardi/CNET News.com)
The group, which consisted of executives from ABB Robotics, Brooks Automation, iRobot, Kiva Systems, North End Technologies and Vecna Technologies, said robotics companies are drawn to the university-rich New England area because of their unique need for highly educated employees from a multitude of disciplines.
While there are some great robots, the panelists said, they are not yet user-friendly enough to be viable as consumer products. Part of that is due to a lack of quality designed interfaces, something that will come from hiring people in disciplines other than just software and engineering.
"Here's a little thing for you engineers out there. Engineers make the suckiest interfaces ever," said Rod Brooks, the director of MIT's Computer Science and Artificial Intelligence Lab (CSAIL) and the chief technology officer of iRobot.
After field soldiers had trouble figuring out how to control the PackBots iRobot initially made for the military, one iRobot engineer suggested that the robots needed better trained people to work them, not 19-year-old soldiers, according to Brooks.
"Now we ship (PackBots) with a game controller and have instant usage. Know your market user," he said.

iRobot's PackBot with a video game style-controller.(Credit: iRobot)
Robotics is an interdisciplinary industry, but also one that's wide open to new methods and business models, according to Debra Theobald, chief executive officer of Vecna Instustries, the maker of the BEAR (Battlefield Extraction and Retrieval Robot).
Some robotics companies, like Vecna, are beginning to follow the software company model and sell services as well as products. Vecna , for example, customizes and implements the open-source JAUS robotic platform to fit the specific needs of customers. (Note: We've fixed that JAUS reference from an earlier misspelling.)
Since robotics is such an interdisciplinary field, its enhancement will largely be dependent on the breakthroughs in other tech industries. Specifically, the panelists said, it comes down to better sensors, renewable or rechargeable power sources and better real-time computational power.
Storage is no longer an issue, as the iPod has shown. Improved computational power will come as software developers learn to better capitalize on quad-core chips through parallel computing. Sensors are a technology that will have to come down in cost, as well as improve in performance in order for robots to improve.
"I was at DARPA. I saw Stanley. While that's very exciting what they don't tell you is that they made sure it would win," said Tom Ryden, CEO of North End Industries, who is also a former iRobot employee.
"It was a beautiful sunny day and there was no wind. What would have happened if it was raining? That car wouldn't have made it ten feet. Sensors are really the area that need a lot of improvement...We need sensors that can provide instant feedback and at an affordable cost," he said.

The BEAR (Battlefield Extraction and Retrieval Robot) from Vecna Technologies.(Credit: Candace Lombardi/CNET News.com)
Nintendo is one example of a non-robotic company helping the robotic industry with its technology developments. Accelerometers such as those used in the Wii game controller have come down in price since their introduction into such a high volume product.
"We just need to be the benefactors of other industries that are going out and pushing the limits," said Theobald.
"Power is an issue, whether it's making renewable or rechargeable, that will be driven by other technologies. We see battery power improving in our computers and communication devices," she said.
With these improvements already on the way, and an anticipated need for more automation in manufacturing, robotics will go through a revolution similar to the one that took place with software, communications and the Internet. And it will happen just as the world begins to need more robots.
With Chinese wages growing by as much as 35 percent per year within the last few years in some regions and an expected growth in its older population, China will not be the cheap labor haven it is right now for U.S. companies 50 years from now, said Brooks.
"People think it may jump to Africa, but there are a lot of structural needs there, so I think it's going to go to robotics," he said.