Beyond Verses

My blog that specialize in Space Science and Latest news from NASA

Thursday, April 12, 2018

Cheating (plagiarism) detection with MOSS on Linux

Hi all,

This post will be very helpful for teaching assistants like me who is trying to make plagiarism detection for the assignments they receive.

We shall use MOSS, thanks to Professor Aiken.

I have developed a simple script that will prepare the data for the MOSS. As MOSS will read only one level of directories, and hence comes my script to move all the files to the student's parent folder.

Linux OS and Perl should be installed.

1. Register for a new account though MOSS home page, an email will be sent to you with a script, there will be a different user id.

2. Copy the script from your email and paste it to ""

3. Find my preparation script

echo "Staring the script";
echo "[IMP] Is that the correct folder '$1'? (y/n) "
read ans;
if [ $ans != "y" ]; then
# move source code to root directories
for student in "$1"/*; do
  if [ -d "$student" ]; then
    echo "Processing student: "$student;
    for files in "$student"/*; do
      if [ -d "$files" ]; then
        find "$files"/ -type f -regextype posix-extended -regex ".*\.($2)" | wc -l > tempFile;
        count=$(cat tempFile); rm -f tempFile;
        if [ $count -ne 0 ]; then
          find "$files"/ -type f -regextype posix-extended -regex ".*\.($2)" -print0 | xargs -0 mv -t "$student"/;
          if [ $? -eq 0 ]; then
            echo "Removing ... "$files;
            rm -rf "$files";
            echo "run the script one more time";
    echo "";

4. Copy the script and paste it to ""

5. Give both scripts execute permissions

    sudo chmod ug+x
    sudo chmod ug+x

6. Run the "" script

    ./ Minesweeper "c|h"

Where "Minesweeper" is the folder has a set of folders, each one represents a student.
Where "c|h" is the file extensions you want to move to the student's parent folder.

7. Run "" script

    perl -l c -m 20 -d Minesweeper/*/*.c Minesweeper/*/*.h

Where "-l" is the language attribute (c, java, ...)
Where "-m" 20 is a parameter to indicate if a segment of code has been found in more than 20 students, then it is not cheating.
Where "-d" is followed by the files to be checked.

8. Wait until it finishes, then you will be given a link in the terminal like this

The above link contains the results of the plagiarism detection.

9. You can save the results also for offline use

    wget -r -np

I hope that would help you :)

Ahmed Hamdy, M.Sc.
Teaching Assistant at Computer and Systems Engineering Dept.
Faculty of Engineering, Alexandria University, Egypt.

Saturday, December 22, 2012

Change Google's Search Domain in Google Chrome

To explain the problem a little bit, it happens when you try to search from the address bar in Google Chrome, Chrome redirects you from to (, ...). And it is the localization feature presented form Google Chrome.
But it will become like HELL when you try to change this localization setting, or when you travel to another country. you can try change search engine form chrome setting, but Na  that wont work out because the address bar (omnibox) URL depends on {google:baseURL}.

I figured that out after a lot of investigation in my Chrome installation directory and pain in my head!!!, as I couldn't find any workable solution by googling the problem, so I prefer to share it :)

You better do the following:
How to fix:
  1. Open "C:\Users{your_user_account}\AppData\Local\Google\Chrome\User Data" folder.
  2. Open "Local State" file.
  3. Add/Edit these in the node "browser":
    "last_known_google_url": "", "last_prompted_google_url": "",
  4. Open "Default/Preferences" file.
  5. Add/Edit these in the node "browser":
    "last_known_google_url": "", "last_prompted_google_url": "", 
How node "browser" looks like:
 "browser": {
   //your code here

This is My Original Topic. you can spread the word :D 
Thanks for reading.

Friday, June 3, 2011

New Post at Beyondverses

NASA | Swift Finds Most Distant Gamma-ray Burst Yet 

On April 29, 2009, a five-second-long burst of gamma rays from the constellation Canes Venatici triggered the Burst Alert Telescope on NASA's Swift satellite. As with most gamma-ray bursts, this one -- now designated GRB 090429B -- heralded the death of a sta ........
Check out the full Post at Beyondverses

Friday, April 29, 2011

Save Desktop Icon Positions and restore them easily

Hi Friends,
It is very important to have the ability of saving your Desktop Icon Positions, so when you connect your laptop to a projector or screen resolution re-adjust or even installing a driver and may be a game changing the screen resolution (and that common) ,,,, you will not lost your icon positions that you arrange to help you customize desktop like you love.

The program I talking about today, is easy to use, Portable and Free :)

Save and restore the positions of icons.
DesktopOK is a small but effective solution for user that have to change the screen resolution often.

:::: Features :::::
# Save your favorite icon locations for each screen resolution.
# Each user can then have his own arrangement.
# Automatically hide and display desktop icons
# Minimises to tray area for easy access.
# Easily minimize all of the windows on your screen
# Launch at Windows startup.
# Autosave
# Portable 

Download the program
After downloading the program, change the language to English, from the lower left of the window.

Wednesday, March 30, 2011

Artist makes beautiful light with Microsoft's Kinect

Artist Audrey Penven used a Kinect and a camera with an infrared filter to create a series of hauntingly beautiful photos. Her gallery exhibition of the images opens Friday.
(Credit: Audrey Penven)
For months, we've known that Microsoft's Kinect could help make video games fun. But who knew that it projects such beautiful light?
Until San Francisco Bay Area artist Audrey Penven and some friends started taking pictures of themselves playing Kinect games, no one. But when Penven looked at the images, she realized she was on to something special.
In normal light, you can't even see the light put out by the Kinect, Microsoft's new motion control system for the Xbox 360. But with the help of a roommate's camera, which is modified to shoot infrared, Penven discovered scenes at once ghostly and straight from the cover of a Neal Stephenson novel.

Penven said she learned that the Kinect projects a known pattern of infrared structured light, and that when it picks this up with its built-in camera, the device figures out the shape of the 3D space based on the distortion of the pattern. "It uses infrared light so ambient visible light won't interfere with the process," Penven said. "I imagine this is also so it can remain invisible."
The images that resulted from Penven's photographic experiment show a cacophony of bright dots that encompass and enfold the people in them. They evince movement and wonder and hint at art. Yet the first time around, the light was little more than Kinect trying to gauge the movements of Penven and her roommates while they played a little Dance Central.

"I thought it was really amazing to see people defined by these infrared dots," Penven said of discovering the surprise in her photos. "I knew that infrared was used in some way by the Kinect to map out 3D space, but I didn't know what to expect when shooting with an infrared camera...I thought it was interesting that the human form could still be so recognizable, even when only shown in tiny dots. I loved the quality of light and the different way of looking at depth and form. [And] I was inspired by the way the Kinect was using a pattern invisible to human eyes to see us."

Related links
 Culture hacker talks Kinect bounty hunt (Q&A)
 Bounty offered for open-source Kinect driver
 Hacker wins contest for open-source Kinect driver
 Microsoft announces plans for Kinect SDK

That inspiration led Penven to take what she had just inadvertently learned and run with it. Created with the help of artist and animator Aaron Muszalski, the result is her first-ever solo art exhibition, titled "Dancing with Invisible Light," which opens Friday at the Pictopia gallery in Emeryville, Calif., and which will run through April 29.
"With these images I was exploring the unique photographic possibilities presented by using a Microsoft Kinect as a light source," Penven writes in the invitation to the opening of the exhibit. "As a photographer, I am most interested in the nature and quality of light: how light behaves in the physical world, and how it interacts with and affects the subjects that it illuminates. For this shoot my models and I were essentially working blind, with the results visible only after each image was captured. Together, we explored the unique physicality of structured light, finding our way in the darkness by touch and intuition. Dancing with invisible light."
Unanticipated use of the Kinect 
Though the Kinect has been an unqualified success as a video game accessory, selling more than 10 million units since its November debut, it's also been a huge hit in the hacker community.
Literally from day one, that community has been out to take the Kinect places where Microsoft never intended. A $3,000 bounty offered by the open-source hardware outfit Adafruit Industries for the first open-source driver for the device bore fruit almost immediately, and since then there's been a near free-for-all among people wanting to use the Kinect for things far outside of gaming.
And to some of those who have been following this movement since the beginning, Penven's work fits in beautifully.

"[It's] stunning. This is another great example of the tool being used in a way that [Microsoft] could not imagine," said Phil Torrone, a principle at Adafruit Industries. "Are they diamonds, are they points of light? It doesn't matter--it's just one of the many expressions the hacked Kinect has enabled for artists, designers, and even photography--something that's been around for almost two centuries."
To Kyle Machulis, a hacker and artist who has experimented with Kinect-created visualizations, Penven's work is deeply impressive, particularly given that the device has been on the market for such a short time.

"It's really amazing, the way she brings such beauty to [something] happening in millions of homes around the world right now," Machulis said. "We're only five months into the release of the Kinect and the technology is already becoming a bit of an afterthought to many consumers. But what's going on behind it still seems like magic even to those of us close to the technology, and [Penven's] pictures really bring that out."

Of course, Penven is hardly the only one using the Kinect to make art. Do a quick Google search on the term, and a seemingly endless supply of links pops up. They range in style from the art that can be captured on screen with a series of gestures to 3D printed representations of Kinect users' motions to a storytelling initiative that helps children gain confidence in their self-expression to an effort to use the Kinect to help blind people restore some sense of sight.

Just a little flash 
While Penven's final images blossom with light, the reality is that when she and her models were shooting the pictures, they were in a dark room with nothing more than a camera flash to illuminate them. But throw in the infrared filter and the pictures burst into life.
"Most of what you see was done in camera," she explained. "For some shots, we experimented with longer exposures and movement. Color and contrast are the only adjustments I made after the fact. Infrared photography, by its nature, is a false color process. The infrared spectrum is represented by colors that we can actually see. I hadn't intended to change the color much from what came out of the camera, but I thought that the difference between the light from the flash and the Kinect was really cool. I decided to emphasize that by pushing the colors in different directions."
Although Penven and her friends discovered the artistic possibilities of the Kinect while playing Dance Central on an Xbox, she said that for the photos in the exhibition, they never hooked up the game console. So what you see in the images doesn't has no relationship to any game--it's nothing more than the million points of light from the Kinect rolling over Penven's models.

In the end, she came up with a whole set of images from the shoot. But one that she is using to promote the exhibit may do the best job of illustrating what the show is all about. In the image, a woman is seen half normal, and half flooded with purple dots. It screams cyberpunk.

"I love the contrast between the sides of her face," Penven said. "Right after this one was taken, and there was a group of us standing around the camera to see it, someone said that she looked like she fell out of a sci-fi story. That really stuck with me. It's like a traditional portrait of a half-digital human."


NASA snaps first image from Mercury orbit

Mercury's Debussy crater and environs, in the first photo ever taken by a spacecraft in orbit around Mercury.
(Credit: NASA/Johns Hopkins University Applied Physics Laboratory/Carnegie Institution of Washington)
NASA this afternoon released the first-ever photo of Mercury taken from a spacecraft in orbit around the innermost planet of the solar system.
The most arresting element of the photo is the rayed crater Debussy, which lends to the overall image the impression of the vine end of a cantaloupe after the vine has been snapped off. Straight out to the left of Debussy and much smaller, about halfway to the left border, lies the crater Matabei "with its unusual dark rays," NASA says.
The space agency has seen Debussy and Matabei before. What it hasn't ever seen until now is a region of Mercury that lies in the darker bottom half of the image, in the direction of the planet's south pole.

The photo comes from the Messenger spacecraft, which took off from Earth in 2004 and which has taken plenty of flyby photos of Mercury since 2008. Earlier this month, Messenger became the first spacecraft to go into orbit around Mercury. And with that, scientists are hoping to get a much fuller sense of the inhospitable planet, addressing questions such as these: Why is Mercury, the planet closest to the sun, so dense? How big is the planet's core, and is the outer core really molten? What are the unusual materials at its poles--could that actually be ice?

In the six hours since snapping this image of Debussy and environs at 2:20 a.m. PT with the Wide Angle Camera of the Mercury Dual Imaging System, Messenger acquired 363 more images and began downloading the data to researchers here at home. NASA plans to release additional images tomorrow.

The spacecraft is still in what NASA refers to as the commissioning phase of its mission, as Messenger and its instruments get checked out. The science mission begins April 4 and is expected to last at least a year and to generate more than 75,000 images.