Menu

Filmy Quiz

Question: What lasagna-loving cat starred in his own feature film in 2004? 
Correct Answer: Garfield

Question: Zootopia's' Nick Wilde is modeled after what other Disney fox? 
Correct Answer:Robin Hood
Question: What is the name of the titular dog that starred in this 2008 film with Owen Wilson? 
Correct Answer:Marley

Question: What 2003 film is a true story about an undersized Depression-era racehorse? 
Correct Answer:Seabiscuit

Question: In 1773, The Resolution became the first ship to accomplish what feat? 
Correct Answer:Cross Antarctica
Question: What year did the Titanic set sail? 
Correct Answer:1912

Question: Kite capital of the world, where Kites were first created? 
Correct Answer:Weifang, Shandong, China

If else condition in shell script with $? and grep command

In shell script condition check is very easy and simple using if else statements. Here is a example which we would like to discuss with our readers.

Scenario: We have a variable that contains long string value, user wants to find matching value from given string and perform check whether that text/character has matched from string value or or not.


#Program in Bash Shell
Line 1: CHECK_SOURCE="[main] INFO com.adobe.jcr.checknode.existence - Node does not exist"
line 2: echo $CHECK_SOURCE | grep -w -o -i 'Node exists'
Line 3: if [ $? == 0 ]; then
Line 4:        echo " matched"
Line 5: else 
Line 6: echo "not matched" 
Line 7: fi 

Explanation:

In line 1 we have declared a variable CHECK_SOURCE which have some value.
In line 2 we are finding text "Node exists" in value of variable CHECK_SOURCE using grep command.
In line 3 using if statement we are checking number of matches from last executed statement. $? sign will return number of matches. If text passed in grep command will find some matching text in variable then $? will number of matching otherwise it will return zero. 



Import and Export Java project in a Zip file in Eclipse

Importing a Java Project from a Zip File into a Workspace

In the past, we have imported projects as JAR files into the src folder of an existing project. For this course, it will probably be easier to import projects directly into the workspace. This is especially true with shader programs since they often require additional text file resources (in our case, shader source code in simple text files) that we didn’t encounter in previous Java programs. When I create demo projects for you, I will often create them for you as zip files.

To import a Java project from a zip file into a workspace:

1. Open Eclipse and navigate to the workspace. To make life easier for us all, make that the workspace that includes your other JOGL projects.
2. Select File…Import…
3. Expand General, select Existing Projects into Workspace and click Next.
4. Click the Select archive file radio button and browse for the zip file containing the project.
5. Click Finish and the project should appear in your workspace. Note: Eclipse will not import a project if you already have one with the same name. If you still want to proceed, rename the existing one and try importing again.

Exporting a Java Project to a Zip File

If you want to export one of your projects to a zip file, do this:

1. Left-click the project name in Package Explorer that you want to export (For example, if the project is named ColorMixer, left-click on that name).
2. Select File…Export…
3. Expand General, select Archive File, and click Next.
4. In the Export dialog, make sure that your selected project is checked and that the options Save in zip format and Create directory structure for files are both selected.
5. Browse for a location to save the archive file. A zip extension will be added automatically.
6. Click Finish and your project should be saved as a zip file in the location you requested.