Нашли или выдавили из себя код, который нельзя назвать нормальным,
на который без улыбки не взглянешь?
Не торопитесь его удалять или рефакторить, — запостите его на
говнокод.ру, посмеёмся вместе!
// can only do five hundred at a time. can't find documentation
// for this number, but if I do more than that I get an error
// message
for (five_hundred <- pageranks.grouped(500))
{
try
{
upload(five_hundred)
}
catch
{
// the datastore is not entirely reliable. for less than 1% of the
// calls it seems to fail randomly. which is a bit annoying if
// you're uploading a lot of data and don't want to stop when half of
// it is already stored
case ex : Throwable =>
{
try
{
ex.printStackTrace()
// try a second time
upload(five_hundred)
}
catch
{
// don't try a third time. just continue
case ex : Throwable => ex.printStackTrace()
}
}
}
}
Наткнулся на пост, в котором некий Ph. D рекламировал scala в качестве замены питону
kurwa # 0
Fike # 0 ⇈
3.14159265 # 0
Интересно, а если заказчик datastore станет требовать 5 попыток?
roman-kashitsyn # 0
guest # 0