Skip to content

Instantly share code, notes, and snippets.

View danahern's full-sized avatar

Dan Ahern danahern

View GitHub Profile
D:\helpdesk\charts
D:\helpdesk\client
D:\helpdesk\dbserver
D:\helpdesk\install
D:\helpdesk\login
D:\helpdesk\report
D:\helpdesk\tmp
D:\helpdesk\filelisting.bat
D:\helpdesk\debug.txt
D:\helpdesk\filelisting.txt
NameError in Dealerships#existing_promotion
Showing app/views/dealerships/existing_promotion.rhtml where line #15 raised:
undefined local variable or method `dealership' for #<#<Class:0x416c340>:0x416c318>
Extracted source (around line #15):
12: <label for='dealers_<%=dealership.id%>' ><%= dealership.companyname %><%= check_box(:dealers, dealership.id, {:checked => true, 'onchange' => remote_function(:url => { :controller => "dealership", :action => "update_promotion_prices"}, :with => 'Form.serialize(this.form)')}) %></label> (<%= number_to_currency(dealership.listing_type.cost) %>)<br/>
13: <% end %>
top - 17:25:34 up 83 days, 55 min, 2 users, load average: 82.39, 72.90, 56.34
Tasks: 245 total, 72 running, 173 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 99.9%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 3107024k total, 2987900k used, 119124k free, 216k buffers
Swap: 2031608k total, 2031608k used, 0k free, 2896k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
24995 root 21 0 573m 371m 296 R 2 12.2 13:37.20 /usr/bin/ruby /usr/bin/mongrel_rails start -d -e production -p 8006 -P tmp/pids/mongrel.8006.pid -l log/mongrel.8006.log
25028 root 18 0 496m 248m 316 R 17 8.2 15:06.16 /usr/bin/ruby /usr/bin/mongrel_rails start -d -e production -p 8017 -P tmp/pids/mongrel.8017.pid -l log/mongrel.8017.log
<% if false %>
<ul>
<% ["0-15 days", "16-30 days", "31-45 days", "46-60 days", "61-75 days", "76-90 days", "Over 90 days"].each do |time_frame| %>
<li><%= check_box_tag "conditions[inventory_age][]", time_frame, false, {} %><label><%= time_frame %></label></li>
<% end %>
</ul>
<% end %>
<%=checkbox_funk ["0-15 days", "16-30 days", "31-45 days", "46-60 days", "61-75 days", "Over 75 days", "All", "0-15 days"]%>
def listings_tab
conditions = ["dealership_id in (?)", "listing_status_id in (?)"]
condition_args = []
@dealerships = (User.find(params[:user_id]).all_dealerships rescue current_user.all_dealerships)
if params[:conditions]
condition_args << (params[:conditions][:dealership_id].blank? ? @dealerships.map(&:id) : params[:conditions][:dealership_id])
condition_args << (params[:conditions][:listing_status_id].blank? ? 1 : params[:conditions][:listing_status_id])
params[:conditions].delete_if{|k,v| k == "dealership_id" || k == "listing_status_id"}.each do |key, value|
if key == "inventory_age"
if value.include?("Over ")
import javax.swing.JOptionPane;
public class cards
{
public static void main(String[] args)
{
String input;
String typeofcard = ".......";
String valueofcard = ".....";
int picture=0;
char[] chararray = new char[5];
@danahern
danahern / cashier.java
Created November 12, 2008 07:48
A cash register to tell change
//http://www.developer.com/open/article.php/610011
import javax.swing.JOptionPane;
class cashier
{
private static final int penny_value = 1;
private static final int nickel_value = 5;
private static final int dime_value = 10;
private static final int quarter_value = 25;
private static final int dollar_value = 100;
public class BeerSong {
public static void main (String[]args){
int beerNum = 99;
String word = "bottles";
while (beerNum > 0){
if (beerNum == 1){
word = "bottle"; // singular, as in ONE bottle.
}
System.out.println(beerNum + " " + word + " of beer on the wall");
1) We'll need 1000 fake dealerships created with 1000 fake users
Dealerships can all belong to a single corporation, or create their own corporation whichever is easier.
Tables:
dealerships
users
2) The imported dealership log for each dealership needs to be created.
Table:
imported_dealership_logs
3) Sanitized Dealership Listings should be created for the imported dealership log
When creating the sanitized listings the dealership_ fields should match up with the imported_dealership_log record.
mysql> select * from listing_types;
+----+--------------------+--------+---------------+---------+--------------+----------+------------+----------------+-------------+---------------------+
| id | name | cost | picture_count | amount | listing_time | position | level | promotion_time | pillar_type | discount_percentage |
+----+--------------------+--------+---------------+---------+--------------+----------+------------+----------------+-------------+---------------------+
| 1 | Gold | 0.00 | 8 | 1 | NULL | 1 | Listing | 0 | NULL | 0 |
| 2 | Platinum | 0.00 | 20 | 1 | NULL | 2 | Listing | 0 | NULL | 0 |
| 3 | Home Page Featured | 99.00 | 20 | 1 | NULL | 3 | Listing | 0 | NULL | 0 |
| 4 | Entry Level | 250.00 |