We spent a lot of time looking at all the important elements required to design and launch a business website. We looked at different elements used to "measure" the success of the website. Remember clicks, click throughs, visitors, etc? So how do we optimize a website? Take a few of your favorite websites that you buy items from and talk about things you think that they could do to optimize (enhance/make better) their site
In: Computer Science
Consider dynamic arrays with geometric expansion and no shrinking. Match operations to their complexity.
Always choose the most informative answer. For instance, if an operation is O(1) and O(n) choose O(1); if an operation is O(1) and O(1) amortized, choose O(1).
Options to choose from are: O(1), O(1) amortized or O(n)
addFirst :
len (length/size) :
deleteLast :
deleteFirst :
addLast (append) :
In: Computer Science
UNIX/TERMINAL ASSIGNMENT - DIFFICULT
Could you please type line by line what I should be entering in the terminal command line to complete the assignment as instructed?
INSTRUCTIONS AS FOLLOWS:
In this lab you will create a script to backup certain number of oldest or newest files in the current directory into a compressed archived file. The objective of this lab is to familiarize and gain proficiency with the following:
• Use of command line arguments
• Use of conditional statement
• Use of for loops
You need to write a script named backup.sh which will receive 3 command line arguments. The arguments are:
• The 1st argument is the string “old” or “new” indicating whether
the oldest files or the newest files needs to be backed up
• The 2nd argument is an integer indicating how many files needs to be backed up.
• The 3rd argument is the name of archive file (tar file).
Your script should perform the following functions
• Check whether 3 arguments have been passed or not.
• If three arguments have not been passed display appropriate message and exit.
• Check whether the 1st argument is not the string “old” or “new” display appropriate message and exit.
• Create a temporary directory under current directory • Using a “for loop” copy all the required files in the temporary directory.
• Create an archive file of the copied files. The name of the archive files is the 3rd argument. Compress the archived file.
• Delete the temporary directory along with copied files.
Example execution: If user type the following ./backup.sh old 5 backup.tar The script will create a compressed archive file named backup.tar.gz in the current directory containing five oldest file in the current directory. ./backup.sh new 4 backup.tar The script will create a compressed archive file named backup.tar.gz in the current directory containing four newest t file in the current directory
How would I create a script named backup.sh and do the 3 arguments?
Have some Python and C++ experience, but Unix in Terminal is completely foreign to me so as much detail as possible would be appreciated.
Thanks!
In: Computer Science
Java programming language:
1. Create a new Netbeans project called ArrayLoop.
2. Declare a fixed length array of integers which can store 8 elements. Do not assign any values.
int[] myAddresses = new int[8];
3. Create a statement which raises 2 to the power of your loop counter, then subtracts 1, and assigns that value to the corresponding element. For example, when i = 3, 2 to the third power is 8, minus 1 = 7. When i = 4, 2 to the fourth power is 16, minus 1 = 15. Etc etc for all values of i.
Fill up the entire array with these values.
4. Use Array.toString to print out the entire Array to the console.
5. Create another FOR loop which counts from 8 down to 1.
6. Use the counter values as indexes to print out your Array values in REVERSE order, from largest to smallest.
7. Create a String object which stores your last name. Mine would be myName = "Hughes";
8. Use the .length field to find the number of char's in your name. Use that value in a new FOR loop. This loop will print out the letters of your name one at a time. For example, my output should be:
H
u
g
h
e
s
TIP: Watch out for the 'Off by one' error.
9. SCREENSHOT AND PRINT all source code in Notepad++.
a. MARK AND LABEL the line which defines a FOR loop
b. MARK AND LABEL the line which declares your integer Array.
c. MARK AND LABEL the line which stores your computed values in the Array.
d. MARK AND LABEL the line which prints out an entire Array at once.
e. MARK AND LABEL a line which uses a loop counter as an Array index.
f. MARK AND LABEL a line which finds the length of your name.
SCREENSHOT AND PRINT all outputs.
In: Computer Science
In Python Complete the oddNumbers() functions to take an int (as a parameter). Return a list of all of the odd numbers between 1 and one less than the parameter. Also, complete the evenNumbers() functions to take an int (as a parameter). Return a list of all of the even numbers between 2 and one less than the parameter.
In: Computer Science
1. Create a Python module that reads Linux_syslog_ip_parser.py that reads syslog file and parses the IPV4 addresses and stores the result into a csv file. Your module should contain the following functions:
a. linux_logfile_reader(filename) function that reads the syslog file and returns all IPV4 addresses
b. count_ipfrequency(ip_list) function that accepts the list of IPV4 addresses retuned by linux_logfile_reader function and returns a dictionary list with ip:frequency pair.
c. Writeto_csv_file(ip_frequency) function that accepts a dictionary list containing ip:frequency pair returned from count_ipfrequeny function and stores the IpV4 addresses with its frequency value into a ‘ipv4.csv’ file.
i. Which internal IP address is the most frequency found in the ‘syslog’ file ( hint: internal ip addresses start with either 10, 172, or 192)
ii. Which external Ip address is the most frequently found in the ‘syslog’ file
Example From File.
83.149.9.216 - - [17/May/2015:10:05:03 +0000] "GET
/presentations/logstash-monitorama-2013/images/kibana-search.png
HTTP/1.1" 200 203023
"http://semicomplete.com/presentations/logstash-monitorama-2013/"
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [17/May/2015:10:05:43 +0000] "GET
/presentations/logstash-monitorama-2013/images/kibana-dashboard3.png
HTTP/1.1" 200 171717
"http://semicomplete.com/presentations/logstash-monitorama-2013/"
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [17/May/2015:10:05:47 +0000] "GET
/presentations/logstash-monitorama-2013/plugin/highlight/highlight.js
HTTP/1.1" 200 26185
"http://semicomplete.com/presentations/logstash-monitorama-2013/"
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [17/May/2015:10:05:12 +0000] "GET
/presentations/logstash-monitorama-2013/plugin/zoom-js/zoom.js
HTTP/1.1" 200 7697
"http://semicomplete.com/presentations/logstash-monitorama-2013/"
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [17/May/2015:10:05:07 +0000] "GET
/presentations/logstash-monitorama-2013/plugin/notes/notes.js
HTTP/1.1" 200 2892
"http://semicomplete.com/presentations/logstash-monitorama-2013/"
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [17/May/2015:10:05:34 +0000] "GET
/presentations/logstash-monitorama-2013/images/sad-medic.png
HTTP/1.1" 200 430406
"http://semicomplete.com/presentations/logstash-monitorama-2013/"
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [17/May/2015:10:05:57 +0000] "GET
/presentations/logstash-monitorama-2013/css/fonts/Roboto-Bold.ttf
HTTP/1.1" 200 38720
"http://semicomplete.com/presentations/logstash-monitorama-2013/"
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [17/May/2015:10:05:50 +0000] "GET
/presentations/logstash-monitorama-2013/css/fonts/Roboto-Regular.ttf
HTTP/1.1" 200 41820
"http://semicomplete.com/presentations/logstash-monitorama-2013/"
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [17/May/2015:10:05:24 +0000] "GET
/presentations/logstash-monitorama-2013/images/frontend-response-codes.png
HTTP/1.1" 200 52878
"http://semicomplete.com/presentations/logstash-monitorama-2013/"
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [17/May/2015:10:05:50 +0000] "GET
/presentations/logstash-monitorama-2013/images/kibana-dashboard.png
HTTP/1.1" 200 321631
"http://semicomplete.com/presentations/logstash-monitorama-2013/"
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [17/May/2015:10:05:46 +0000] "GET
/presentations/logstash-monitorama-2013/images/Dreamhost_logo.svg
HTTP/1.1" 200 2126
"http://semicomplete.com/presentations/logstash-monitorama-2013/"
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [17/May/2015:10:05:11 +0000] "GET
/presentations/logstash-monitorama-2013/images/kibana-dashboard2.png
HTTP/1.1" 200 394967
"http://semicomplete.com/presentations/logstash-monitorama-2013/"
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [17/May/2015:10:05:19 +0000] "GET
/presentations/logstash-monitorama-2013/images/apache-icon.gif
HTTP/1.1" 200 8095
"http://semicomplete.com/presentations/logstash-monitorama-2013/"
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [17/May/2015:10:05:33 +0000] "GET
/presentations/logstash-monitorama-2013/images/nagios-sms5.png
HTTP/1.1" 200 78075
"http://semicomplete.com/presentations/logstash-monitorama-2013/"
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [17/May/2015:10:05:00 +0000] "GET
/presentations/logstash-monitorama-2013/images/redis.png HTTP/1.1"
200 25230
"http://semicomplete.com/presentations/logstash-monitorama-2013/"
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [17/May/2015:10:05:25 +0000] "GET
/presentations/logstash-monitorama-2013/images/elasticsearch.png
HTTP/1.1" 200 8026
"http://semicomplete.com/presentations/logstash-monitorama-2013/"
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [17/May/2015:10:05:59 +0000] "GET
/presentations/logstash-monitorama-2013/images/logstashbook.png
HTTP/1.1" 200 54662
"http://semicomplete.com/presentations/logstash-monitorama-2013/"
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [17/May/2015:10:05:30 +0000] "GET
/presentations/logstash-monitorama-2013/images/github-contributions.png
HTTP/1.1" 200 34245
"http://semicomplete.com/presentations/logstash-monitorama-2013/"
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [17/May/2015:10:05:53 +0000] "GET
/presentations/logstash-monitorama-2013/css/print/paper.css
HTTP/1.1" 200 4254
"http://semicomplete.com/presentations/logstash-monitorama-2013/"
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [17/May/2015:10:05:24 +0000] "GET
/presentations/logstash-monitorama-2013/images/1983_delorean_dmc-12-pic-38289.jpeg
HTTP/1.1" 200 220562
"http://semicomplete.com/presentations/logstash-monitorama-2013/"
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [17/May/2015:10:05:54 +0000] "GET
/presentations/logstash-monitorama-2013/images/simple-inputs-filters-outputs.jpg
HTTP/1.1" 200 1168622
"http://semicomplete.com/presentations/logstash-monitorama-2013/"
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [17/May/2015:10:05:33 +0000] "GET
/presentations/logstash-monitorama-2013/images/tiered-outputs-to-inputs.jpg
HTTP/1.1" 200 1079983
"http://semicomplete.com/presentations/logstash-monitorama-2013/"
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36"
83.149.9.216 - - [17/May/2015:10:05:56 +0000] "GET /favicon.ico
HTTP/1.1" 200 3638 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X
10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77
Safari/537.36"
24.236.252.67 - - [17/May/2015:10:05:40 +0000] "GET /favicon.ico
HTTP/1.1" 200 3638 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64;
rv:26.0) Gecko/20100101 Firefox/26.0"
In: Computer Science
C++
Summary
To make telephone numbers easier to remember, some companies use letters to show their telephone number. For example, using letters, the telephone number 438-5626 can be shown as GET LOAN.
In some cases, to make a telephone number meaningful, companies might use more than seven letters. For example, 225-5466 can be displayed as CALL HOME, which uses eight letters.
Instructions
Write a program that prompts the user to enter a telephone number expressed in letters and outputs the corresponding telephone number in digits.
If the user enters more than seven letters, then process only the first seven letters.
Also output the - (hyphen) after the third digit.
Allow the user to use both uppercase and lowercase letters as well as spaces between words.
Moreover, your program should process as many telephone numbers as the user wants.
Use the dialpad below for reference:
The program should accept input and produce output similar to the example program execution below.
Enter Y/y to convert a telephone number from letters to digits. Enter any other letter to terminate the program. Y Enter a telephone number using letters: Hello world The corresponding telephone number is: 435-5696 To process another telephone number, enter Y/y Enter any other letter to terminate the program. z
In: Computer Science
c++
Create a one-dimension array, y, of this struct data type with a length 4. Pass y into a function: PrintArrayElement( …). Finish the interface of this function, and loop over each array element inside this function
In: Computer Science
In: Computer Science
In: Computer Science
In: Computer Science
I have char memory[1024]. i want to write integer value of 300 into the memory. Type casting worked ok for all values 0-127. above that it looks like a garbage. could you write a function in c++ that will write an integer value say 300 into the memory. Thank you.
In: Computer Science
In: Computer Science
Using egrep and grep in linux
What sentences.txt contains:
Anything goes here.
Or not
When, why or how.
A bat can die
The dog never does.
Yikes! he proclaimed
A big can of doo doo is gone.
The zebra never yells at x-rays well unless it is proscribed.
Once upon a time.
Farther. Back down the road!
Yes, a time once did exist
In: Computer Science
Consider two functions
f (x; y) = (x10)2 + (y + 2)2; and
g(x; y) = (x ? 10)2 + (x ? y + 5)4
Please implement a basic gradient descent algorithm using
python
Starting with (x; y) = (0; 0), and set up a xed learning rate =
0:5,
run the gradient descent algorithm for each function. Run for
10
iterations, and report both (x; y) and the function value at the
end of
each iteration.
Adjust the , and nd out the fastest convergence (smallest
function
value) after T steps (try T = 10 or 100).
In: Computer Science