
ballouta
Members-
Posts
625 -
Joined
-
Last visited
Profile Information
-
Gender
Male
-
Location
California
-
Age
34
ballouta's Achievements

Advanced Member (4/5)
0
Reputation
-
Hi I am frustrated from this simple task, I've been testing this script for two hours trying to find the problem but no luck! My script reads a command line argument(ARGV[0]), then creates a directory named as #{ARGV[0]}, then it reads the DATA object (after the __END__ which looks below), and create those directories inside ARGV[0] __END__ app/views/layouts app/models app/controllers config db doc lib public/javascripts public/stylesheets public/images log note that I am using Notpad++ and i have EOL set to UNIX, so it is NOT supposed to cause any \n troubles My script creates what looks like directories, i can see them in my FTP but I can't delete any! when I asked my instructor about it, he said, review your code, lib (directory) is NOT like lib? so I am wondering where did the question mark come from? also note that I do NOT see ? when i use SSH client or FTP! i had to run another script to delete these weird directories this is my script require 'fileutils' include FileUtils if ARGV.empty? puts "__________________________________________ _ _" puts " " puts "USAGE: ruby script/generate.rb Your_Site_Name" puts "__________________________________________ _ _" elsif Dir.exists?("/home/students/myname/public_html/cis113/#{ARGV[0]}") puts "This directory already exist!" puts "Would you like to use the existing directory (Y/N)?" #I need help with this part later #read DATA and create directories else Dir.mkdir("/home/students/myname/public_html/cis113/#{ARGV[0]}") DATA.each do |line| FileUtils.mkpath ("/home/students/myname/public_html/cis113/#{ARGV[0]}/#{line}") end end help is highly appreciated
-
Hello I have these relations FLIGHTS (flight-num, source-city, destination-city) DEPARTURES (flight-num, date, plane-type) BOOKINGS (passenger-name, flight-num, date, seat-number) How is it possible to find all cities that have nonstop to Paris? a bit of explanation is appreciated thank you
-
I just finished studying your queries, thanks again I am thinking of how to wrie the same query without aggregators but with subqueries in the where clause I have these idea, If it is true, I am not sure yet hot to translate it to a query so the same query above without aggregator SELECT reviewer, COUNT(*) FROM BookAuthor ba INNER JOIN BookReview br ON ba.book = br.book WHERE ba.author = 'ggg' AND br.reviewer IN (SELECT author FROM bookauthor) GROUP BY reviewer HAVING COUNT(*) >= 2; I say: after joining the two tables on the same criteria above get a Distinct list of reviewers from the tuples (that are the result of the inner join) then the "inner join tuples" Except (difference) the "distinct list" will tell us who had reviewed 2 books or mores what do you think?
-
Thank you, let me study your answers I really appreciate the help.
-
May someone help me with Question no 2 please so I have the correct query for question # 1 which is Select reviewer, count(reviewer) From BookAuthor BA INNER JOIN BookReview BR ON BA.book = BR.book where BA.author = 'Charles Dickens' Group by reviewer Having count(reviewer) > 2 I need to convert it to subqueries in the where clause, thank you
-
unfor this class didn't provide any kind of DB access to test our code, this is why it is difficult to wite queries for me as a beginner
-
Select reviewer, count(reviewer) From BookAuthor BA INNER JOIN BookReview BR ON BA.book = BR.book where BA.author = 'Charles Dickens' Group by reviewer Having count(reviewer) > 2 this?
-
this? Select author, count(reviewers) From BookAuthor BA INNER JOIN BookReview BR ON BA.book = BR.book where BA.author = 'Charles Dickens' Group by author Having count(reviewers) > 2
-
so for question 1, would this query be correcy? Select author, count(reviewers) From BookAuthor BA INNER JOIN BookReview BR ON BA.book = BR.author where BA.author = 'Charles Dickens' Group by author Having count(reviewers) > 2
-
For this first question I have Select author, count(reviewers) From BookAuthor BA, BookReview BR where BA.autgor = 'ballouta' Group by author Having count(reviewers) > 2
-
consider these four relations BookAuthor (book, author, earnings) BookReference (book, referenceBook, times) BookReview (book, reviewer, score) BookPublish (book, year, price, num) *an author can review his book 1) I need a sql query that finds all the authors who reviewed more than two books written by 'ballouta' USING aggregators 2) I need a sql query that finds all the authors who reviewed more thna two books written by 'ballouta' with subqueries 3) Find all authors who have written exactly one book and reviewed more than one book 4) Find all reviewers who have reviewed everybook by 'ballouta' using Except' thank you so much
-
Thank you Psycho, very helpful
-
Hello I have two tables, one called order_products with ten attriubtes, and the table products with many different attributes one of them is "weight" the original query selects all of the ten colums based on a given order number: $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_product WHERE order_id = '" . (int)$order_id . "'"); I am trying to modify the ablove query to get the weight of each product that (weight) is in products table, I wrote this query that worked well on phpMyAdmin and gave me the correct result,. However, when I use the query in the original context of OpenCart it has to have the $order_id avraible, and I wanna make sure I ahve the correct syntax, because writing the correct sytnax is not enough yet to test my code, I have to edit other arrays and stuff! thank you $query = $this->db->query("SELECT OP.order_product_id, OP.order_id, OP.product_id, OP.name, OP.model, OP.price, OP.total, OP.tax, OP.quantity, OP.subtract, P.weight FROM dmc9strorder_product OP, dmc9strproduct P WHERE OP.order_id = '" . (int)$order_id . "' AND OP.product_id = P.product_id" );
-
Hello Everyone I've installed wordpress already for a sex education website. I need to show a warning page before a visitor can proceed to the main website. I was wondering if there's a plugin that I can install for wordpress that shows a warning message/page before someone can entre the main website. If not, is this my best choice to create a custome HTML page, add the put the wanring text needed, then place two links for I agree & I don't agree , for example? but in this case, I have to move the wordress installation to another location right? thank you so much
-
yes the Guide from MySQL Press. I bought it from Amazon. I just wanted to buy a DVD separately if available. Because I highlighted many parts of the book while studying, I need the book as is thanks