+142
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
function GetDiscountGroupId($discount)
{
//TODO: create a parameter "Discount groups" and use an array from it
$discount = $discount * 1;
if ($discount == 3)
return 8;
elseif ($discount == 5)
return 9;
elseif ($discount == 7)
return 10;
elseif ($discount == 10)
return 11;
elseif ($discount == 12)
return 12;
elseif ($discount == 15)
return 13;
elseif ($discount == 18)
return 14;
else
return 15;
}
Функция определения ID скидки по значению.. Ппц.. Теллур снова жжет.
lscin,
02 Июня 2015
+142
- 1
- 2
- 3
- 4
- 5
else{
// тот случай когда будет сразу нажата кнопка
// однако это будет перехватывать валидация на отправку
// в итоге сюда мы никогда не попадем
}
sevenflash,
02 Июня 2015
+142
- 1
- 2
- 3
- 4
if (currentValueP > 1 || currentValueP < 1)
valueIsCorrect = false;
else if (currentValueP == 1)
valueIsCorrect = true;
бесплатно valueIsCorrect = currentValueP == 1;
belozorov63,
01 Июня 2015
+142
- 1
- 2
- 3
- 4
- 5
<?$last_update = filemtime('../b/z.zip');
$formatter = new IntlDateFormatter('ru_RU', IntlDateFormatter::FULL, IntlDateFormatter::FULL);
$formatter->setPattern(' d MMMM y года ');
$dateOstap = $formatter->format(new DateTime(date('Y-m-d H:i:s', $last_update)));
echo $dateOstap;?>//30 мая 2015 года
масло масленное
igorkrets,
30 Мая 2015
+142
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
using (new MPI.Environment(ref args))
{
//Эта программа для MPI. Внешний алгоритм
System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
stopwatch.Start();
Intracommunicator world = Communicator.world;
if (world.Rank == 0)
{
RightRectangleSubDomain(horror, world);
LeftRingSubdomain(dolor, world);
world.Barrier();
SendArthas(dolor, world);
RecvKelthuzad(kelthuzad, world);
}
if (world.Rank == 1)
{
LeftRectangleSubDomain(pavor, world);
RightRingSubdomain(tristicia, world);
world.Barrier();
SendKelthuzad(tristicia, world);
RecvArthas(arthas, world);
}
stopwatch.Stop();
Console.WriteLine("Elapsed time: {0}", stopwatch.ElapsedMilliseconds);
}
Очень сильно напугала лабораторная, что отразилось на названиях переменных. Да и сам файл был назван MPITenebris.
Stubborn,
29 Мая 2015
+142
- 1
- 2
- 3
return optionsBackButtonCommand ?? ((Func<RelayCommand>)(() =>
optionsBackButtonCommand = new RelayCommand(param =>
RandomMethod() )))();
Сам придумал. "Изящно" обошел использование if.
mee2xuh,
28 Мая 2015
+142
- 1
- 2
- 3
- 4
- 5
#header .innerdiv > *:nth-child(odd):not(.logo) {
float: right;
width: 220px;
margin-right: 15px;
}
stail,
28 Мая 2015
+142
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
public class DaoFactory {
private Map<Class<?>, Class<?>> daos = null;
public DaoFactory() {
init();
}
private void init() {
this.daos = new HashMap<>();
this.daos.put(AllSettings.class, AllSettingsDao.class);
this.daos.put(ClientProfile.class, ClientProfileDao.class);
}
public EntityDao<?> getDao(Class<?> entityClass) {
EntityDao<?> dao = null;
try {
if(daos.containsKey(entityClass)) {
dao = (EntityDao<?>)daos.get(entityClass).newInstance();
}
} catch (Exception e) {
e.printStackTrace();
}
return dao;
}
}
Фабрика Dao для сущностей
carapuz,
28 Мая 2015
+142
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
// Check if the subnet begins with $startip and ends before $endip
if (($targetsub_min == $startip) && ip_less_than($targetsub_max, $endip)) {
break;
}
// Check if the subnet ends at $endip and starts after $startip
if (ip_greater_than($targetsub_min, $startip) && ($targetsub_max == $endip)) {
break;
}
// Check if the subnet is between $startip and $endip
if (ip_greater_than($targetsub_min, $startip) && ip_less_than($targetsub_max, $endip)) {
break;
}
Коль уж старые посты потерлись, принесу это говно снова. Я тогда самое главное забыл. Теперь эти пидорасы не оправдаются ущербностью PHP.
https://github.com/pfsense/pfsense/blob/master/etc/inc/util.inc#L542-L555
superhacker777,
27 Мая 2015
+142
- 1
Код не мой, но очень неоптимизированный. И так ещё десяток таких блоков. С сайта: http://ninjahonor.com/.
$(document).ready(function(){
$(".coffin-box1 a.name1").click(function(){
$(".vid1").addClass('active')
$(".vid2 , .vid3 , .vid4 , .vid5 , .vid6 , .vid7 , .vid8 , .vid9 , .vid10 , .vid11 , .vid12 , .vid13 , .vid14 , .vid15 , .vid16 , .vid17 , .vid18 , .vid19 , .vid20 , .vid21 , .vid22 , .vid23 , .vid24 , .vid25 , .vid0 ").removeClass('active')
});
});
$(document).ready(function(){
$(".coffin-box1 a.name2").click(function(){
$(".vid2").addClass('active')
$(".vid1 , .vid3 , .vid4 , .vid5 , .vid6 , .vid7 , .vid8 , .vid9 , .vid10 , .vid11 , .vid12 , .vid13 , .vid14 , .vid15 , .vid16 , .vid17 , .vid18 , .vid19 , .vid20 , .vid21 , .vid22 , .vid23 , .vid24 , .vid25 , .vid0 ").removeClass('active')
});
});
$(document).ready(function(){
$(".coffin-box2 a.name1").click(function(){
$(".vid6").addClass('active')
$(".vid2 , .vid3 , .vid4 , .vid5 , .vid1 , .vid7 , .vid8 , .vid9 , .vid10 , .vid11 , .vid12 , .vid13 , .vid14 , .vid15 , .vid16 , .vid17 , .vid18 , .vid19 , .vid20 , .vid21 , .vid22 , .vid23 , .vid24 , .vid25 , .vid0 ").removeClass('active')
});
});
Dev_18,
27 Мая 2015