1
2
3
4
var message = ""
if (XMLHttpRequest.responseText.length > 0)
  message = jQuery.parseJSON(XMLHttpRequest.responseText).error
...

JavaScript Double 'if'

by AlekSi, August 23, 2010 14:32, 6 refactorings, tagged with if

How to make this code looks...

Af19cd0c0141bf7d6b42516706eb1d1d Talk
1
2
3
4
  def is_pos_activation?
    if session[:pos_activation]
      block_given? ? yield : true
...

Ruby better way?

by RoadHouse, July 21, 2010 18:48, 5 refactorings, tagged with block, ruby, if

i like this code, but exist...

70089e712ed13abb99bec89bd5bfba77 Talk
1
2
3
4
             #insert new record if it dosent already exist
             if !dbh.select_one('SELECT Salenm FROM Auctions Where Salenm LIKE "%' + c.attributes["href"][/....$/] + '%"')
                dbh.do("INSERT INTO Auctions (Salenm, Date, Location) VALUES (?, ?, 1)", 
...

Ruby Insert new record if it dos...

by bain19.myopenid.com, June 24, 2010 04:33, 1 refactoring, tagged with if, mysql, select, bain19, sql injection

Is there a safer way to-do ...

642d333608cc3483f64dba38cb81bdd2 Talk
1
2
3
4
    if current_user
      @var = current_user.search_terms.build
    else
...

Ruby if else more elegant

by RoadHouse, March 25, 2010 15:33, 5 refactorings, tagged with ruby, if

is a better way to do this?

70089e712ed13abb99bec89bd5bfba77 Talk
1
2
3
4
y_max = 10

arr_data.each do |arr|
...

Ruby 2D array manipulation

by asmega.myopenid.com, September 12, 2009 13:10, 1 refactoring, tagged with ruby, array, each, iterate, if, break, first

an array within array itera...

8969b3dc2e4211b514c08ee9879bb0c4 Talk
1
2
3
4
stuff.each do |name|
  name = name.downcase
  #size
...

Ruby ungliness and long too

by uberholden.myopenid.com, September 10, 2009 13:15, 6 refactorings, tagged with case, ruby, if else, if, rails

any ideas on making this mo...

Avatar Talk
1
2
3
int x, y;
...

C# Which is more readable? Mat...

by cohen.myopenid.com, January 02, 2009 16:43, 2 refactorings, tagged with Math.Max, Math.Min, if

I see a lot of code like in...

49c552e21b2fcbff0ff6567507ef1715 Talk
1
2
3
4
if @events != nil
  @events.each do |event|
    if @recurrents != nil
...

Ruby superfluous if statements

by ttdavett.myopenid.com, August 10, 2008 22:51, 4 refactorings, tagged with ruby, rails, if, else

I'm pretty sure theres a be...

F677fa685a2cfe8aff31f161062db3d3 Talk