public function get($paymentType, $carrier, $gds, $clearingCompany, $allowDirectPayment)
{
AcqData::preload();
$carrier = strtoupper($carrier);
if($paymentType == 'cc') {
$gdsVal = $this->acqData->getGdsVal($gds);
if(!$allowDirectPayment ||
!$gdsVal ||
!isset($gdsVal['lr'], $gdsVal['direct'], $gdsVal['lr_commission_acq'], $gdsVal['direct_commission_acq'])
) {
$ccDefaultVal = $this->acqData->getPaymentTypeVal($paymentType);
return [[$ccDefaultVal, $ccDefaultVal], false];
}
$commission = $gdsVal['direct_commission_acq'];
$isDirect = $this->isDirect($carrier, $gds, $clearingCompany);
if(!$isDirect) {
$gdsVal['direct'] = $gdsVal['lr'];
$commission = $gdsVal['lr'];
}
return [
[$gdsVal['direct'], $commission],
$isDirect
];
}
$paymentTypeVal = $this->acqData->getPaymentTypeVal($paymentType);
return [
[$paymentTypeVal, $paymentTypeVal],
false
];
}
$ccDefaultVal = $this->acqData->getPaymentTypeVal($paymentType); is duplicated in two branches...
char * dataFunc(){
TCHAR tc[256];
LONG tc_len = sizeof(tc);
getData((LPBYTE)&tc, &tc_len);
char * data = new char[tc_len];
for(int i = 0;i < tc_len;i++)
data[i] = tc[i];
return data;
}
public static int maximum(int f, int g)
{
try
{
int[] far = new int[f];
far[g] = 1;
return f;
}
catch(NegativeArraySizeException e)
{
f = -f;
g = -g;
return (-maximum(f, g) == -f)? -g : -f;
}
catch(IndexOutOfBoundsException e)
{
return (maximum(g, 0) == 0)? f : g;
}
}
public enum DataSize {
BYTE,
DOUBLE_BYTE,
INT,
LONG;
public boolean isEqualTo(Object value) {
if(value instanceof Byte && this.equals(BYTE)) {
return true;
} else if ((value instanceof Character || value instanceof Short) && this.equals(DOUBLE_BYTE)) {
return true;
} else if ((value instanceof Integer) && this.equals(INT)) {
return true;
} else if ((value instanceof Long) && this.equals(LONG)) {
return true;
}
return false;
}
}
public class SentCon3 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
double input;
char choice;
System.out.println("**** Menu-Driven Temperature Converter*****");
System.out.println("only lowwer case is vaild");
System.out.print("Enter the value to beconverted==> ");
input = scan.nextDouble();
System.out.println("What is your choice?");
System.out.println("a)Fahrenheit to Celsius");
System.out.println("b)Celsius to Fahrenheit");
System.out.println("c)Kelvin to Celsius");
System.out.println("d)Celsius to Kelvin");
System.out.println("e)Kelvin to Fahrenheit");
System.out.println("f)Fahrenheit to Kelvin.");
System.out.print("Please enter your choice ==>");
choice = scan.next().charAt(0);
while (choice == 'a') {
System.out.println((input / 5) * 9 + 32);
break;
}
while (choice == 'b') {
System.out.println((input - 32) * 5 / 9);
break;
}
while (choice == 'c') {
System.out.println(input - 273.15);
break;
}
while (choice == 'd') {
System.out.println(input + 273.15);
break;
}
while (choice == 'e') {
System.out.println((input - 273.5) * 9 / 5 + 32);
break;
}
while (choice == 'f') {
System.out.println((input + 459.67) * 5 / 9);
break;
}
}
}
use while as if!!!!
let arr = []
if(arr[record.id]) {
arr[record.id] = false
} else {
arr[record.id] = false
}
this.setState({a: arr})
arr = []
<div ng-repeat="recipient in $ctrl.resource.invoiceRecipients track by $index">
<div>
{{$ctrl.resource.invoiceRecipients[$index]}}
</div>
</div>
You could easily use the "recipient" variable instead of getting it again from the array, is there a reason for doing this?
apps_to_be_deployed = apps_to_be_deployed.strip()
if apps_to_be_deployed.endswith(":"):
apps_to_be_deployed_length = len(apps_to_be_deployed)
apps_to_be_deployed_list = list(apps_to_be_deployed)
apps_to_be_deployed_list[apps_to_be_deployed_length - 1] = ''
apps_to_be_deployed = "".join(apps_to_be_deployed_list)
if ((string)filtros[0] != "-1" && (string)filtros[0] != "0")
filtros[0] = (string)filtros[0] != "" ? filtros[0] : DBNull.Value;
else
filtros[0] = DBNull.Value;
http://localhost:52108/Trade/Details/1953452?class=pull-left
foreach (Byte bajt in data ) {
BufferIndex = i++;
if (!char.IsControl((char)bajt))
MyCharacter = Convert.ToChar(bajt).ToString();//Encoding.ASCII.GetString(new[]{bajt});
else
MyCharacter = " ";
if (BufferIndex == 200)
{
int a = BufferIndex;
}
if (BufferIndex < 200)
{
sw.WriteLine("PrintBuffer1[" + BufferIndex + "] :=\t" + bajt + "\t; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "\t" + MyCharacter );
}
if (BufferIndex >= 200 && BufferIndex < 400)
{
BufferIndex = BufferIndex - 200;
sw.WriteLine("PrintBuffer2[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + " " + MyCharacter);
}
if (BufferIndex >= 400 && BufferIndex < 600)
{
BufferIndex = BufferIndex - 400;
sw.WriteLine("PrintBuffer3[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + " " + MyCharacter);
}
if (BufferIndex >= 600 && BufferIndex < 800)
{
BufferIndex = BufferIndex - 600;
sw.WriteLine("PrintBuffer4[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + " " + MyCharacter);
}
if (BufferIndex >= 800 && BufferIndex < 1000)
{
BufferIndex = BufferIndex - 800;
sw.WriteLine("PrintBuffer5[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + " " + MyCharacter);
}
if (BufferIndex >= 1000 && BufferIndex < 1200)
{
BufferIndex = BufferIndex - 1000;
sw.WriteLine("PrintBuffer6[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + " " + MyCharacter);
}
if (BufferIndex >= 1200 && BufferIndex < 1400)
{
BufferIndex = BufferIndex - 1200;
sw.WriteLine("PrintBuffer7[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + " " + MyCharacter);
}
if (BufferIndex >= 1400 && BufferIndex < 1600)
{
BufferIndex = BufferIndex - 1400;
sw.WriteLine("PrintBuffer8[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + " " + MyCharacter);
}
if (BufferIndex >= 1600 && BufferIndex < 1800)
{
BufferIndex = BufferIndex - 1600;
sw.WriteLine("PrintBuffer9[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + " " + MyCharacter);
}
if (BufferIndex >= 1800 && BufferIndex < 2000)
{
BufferIndex = BufferIndex - 1800;
sw.WriteLine("PrintBuffer10[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + " " + MyCharacter);
}
if (BufferIndex >= 2000 && BufferIndex < 2200)
{
BufferIndex = BufferIndex - 2000;
sw.WriteLine("PrintBuffer11[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + " " + MyCharacter);
}
if (BufferIndex >= 2200 && BufferIndex < 2400)
{
BufferIndex = BufferIndex - 2200;
sw.WriteLine("PrintBuffer12[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + " " + MyCharacter);
}
}
don't repeat yourself.. whyy we don't have PrintBufeer[i] ?
public showOrHideLegends(seriesList: any[]) {
if (seriesList.length === 0)
return false;
else
return true;
}
more code lines => more money; that's how our contractor company thinks
if (baza[mCurrentIndex] == Boolean.TRUE) {
if (mCurrentIndex != baza.length-1) {
up();
nextQuestion();
}
if (mCurrentIndex == baza.length) {
WypiszWynik();
}
}
so you have an array of booleans and you're comparing it to Boolean.TRUE why
if(computedDate != null){
myObject.setDueDate(computedDate);
}
else{
myObject.setDueDate(null);
}
def possibilities():
alphabets=(n,o,r,t,h,e,a,s,u,w,m,y)
combinations=list()
for n in range(9,-1,-1):
for o in range(9,-1,-1):
for r in range(9,-1,-1):
for t in range(9,-1,-1):
for h in range(9,-1,-1):
for e in range(9,-1,-1):
for a in range(9,-1,-1):
for s in range(9,-1,-1):
for u in range(9,-1,-1):
for w in range(9,-1,-1):
for m in range(9,-1,-1):
for y in range(9,-1,-1):
if len(set([n,o,r,t,h,e,a,s,u,w,m,y]))==12:
north=10000*n + 1000*o +100*r +10*t +h
east=1000*e +100*a +10*s +t
south=10000*s + 1000*o +100*u +10*t +h
west=1000*w + 100*e +10*s +t
earth= 10000*e + 1000*a + 100*r +10*t +h
if north +east +south +west == earth:
combinations.append((north,east,south,west,earth))
return combinations